-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs: add new LLM dropdown #3267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
katzino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-approving, smaller nits but nothing major 💪
|
|
||
| const handleKeyDown = useCallback( | ||
| (event) => { | ||
| if (event.key === 'Enter' || event.key === ' ') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer this just for better understanding
Edit: I see we use this across the codebase, nevermind 😅
| if (event.key === 'Enter' || event.key === ' ') { | |
| if (event.key === 'Enter' || event.code === "Space") { |
| aria-controls={'llm-menu'} | ||
| /> | ||
| {isOpen && ( | ||
| <div className={styles.menuDropdown} role="menu" id={'llm-menu'}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <div className={styles.menuDropdown} role="menu" id={'llm-menu'}> | |
| <div className={styles.menuDropdown} role="menu" id="llm-menu"> |
| onKeyDown={handleKeyDown} | ||
| aria-haspopup="menu" | ||
| aria-expanded={isOpen} | ||
| aria-controls={'llm-menu'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| aria-controls={'llm-menu'} | |
| aria-controls="llm-menu" |
| {copyingStatus === 'loading' && <LoaderIcon size={16} />} | ||
| {copyingStatus === 'copied' && <CheckIcon size={16} />} | ||
| {copyingStatus === 'idle' && <CopyIcon size={16} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nicer to have a map for each state and render a single node based on the value
barjin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Older) versioned pages do not have the markdown alternatives, so clicking the markdown button e.g. on this page will result in 404 (https://crawlee.dev/js/docs/3.11/examples/accept-user-input.md doesn't exist).
Aside from that, I found some visual bugs:
| const markdownUrl = getMarkdownUrl(window.location.href); | ||
|
|
||
| try { | ||
| window.open(markdownUrl, '_blank'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future update idea: can we render actual links (anchor elements) here?
barjin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you!
|
nit: anything with the |
closes: apify/apify-web#5475 Copied logic from apify/crawlee#3267
https://github.com/apify/apify-web/issues/5475
Adding a new LLM dropdown.