-
Notifications
You must be signed in to change notification settings - Fork 665
feat(playground): add settings button and group IR #3559
Conversation
✅ Deploy Preview for docs-rometools canceled.Built without sensitive environment variables
|
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.
Hey @dhrjarun
Thanks for this contribution. I'm currently having permission issues with Netifly, so I cannot approve the preview build. I'm looking into it.
From the video, it seems to me that it's easily possible to accidentally open and directly close the settings menu again. Is this a problem or was it just a misclick from you when recording the video? How well does your solution work with keyboard-only navigation?
Hi @MichaReiser In the video, the settings menu opened and closed directly cuz of reload. I haven't added any shortcut key to open settings 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.
This is awesome!
I've two small improvement requests:
- Add the
aria-pressed
attribute and set it to true if the settings menu is open (and false otherwise) - Do you have an idea of how to style the button when the menu is open? (you can use the [aria-pressed="true"] selector
That could work |
When I have just <button
aria-label="Open or Close Settings Menu"
aria-pressed={isSettingsVisible}
onClick={() => setSettingVisible(!isSettingsVisible)}
className="text-base text-slate-700 font-medium hover:text-slate-800 group"
>
</button> But It cause this error lint/a11y/useKeyWithClickEvents When I add <button
aria-label="Open or Close Settings Menu"
aria-pressed={isSettingsVisible}
onClick={() => setSettingVisible(!isSettingsVisible)}
onKeyDown={(event: React.KeyboardEvent<HTMLButtonElement>) => {
if (event.key === "Enter") {
setSettingVisible(!isSettingsVisible);
}
}}
className="text-base text-slate-700 font-medium hover:text-slate-800 group"
>
</button> If I add <button
aria-label="Open or Close Settings Menu"
aria-pressed={isSettingsVisible}
onClick={() => setSettingVisible(!isSettingsVisible)}
onKeyDown={(event: React.KeyboardEvent<HTMLButtonElement>) => {
setSettingVisible(!isSettingsVisible);
}}
className="text-base text-slate-700 font-medium hover:text-slate-800 group"
>
</button> I don't know if there is any use case of this rule lint/a11y/useKeyWithClickEvents with react in here. |
And here's with arrow demo.mov |
You can ignore (suppress) the rule for now. It's an issue with the lint rule. See #3644 Looks awesome! I really like the toggle animation |
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.
Looks good. You only have to make sure that all files are correctly formatted with rome (You should be able to run pnpm format
if you have Rust installed or use the VS Code extension)
* upstream/main: fix(npm/js-api): Import type from @rometools/backend-jsonrpc (rome#3647) doc(npm/js-api): Add experimental warning to README fix(npm/js-api): Lazy load backend implementations (rome#3652) feat(rome_lsp): stop the daemon after the last client disconnects (rome#3643) fix(npm/js_api): Ensure JS API build contains `dist` folder (rome#3648) fix(rome_cli): ensures the service only connects to compatible versions (rome#3642) feat(playground): add settings button and group IR (rome#3559) release: v10.0.1 (rome#3649) fix(rome_js_analyze): False positives for interactive elements in `useKeyWithClickEvents` (rome#3644) fix(rome_js_semantic): support for object and array bindings when exporting (rome#3620) doc(editors): Clarify Rome discovery (rome#3639) fix(rome_js_analyze): improve the detection of `ReactDOM.render` calls in `noRenderReturnValue` (rome#3626) chore(npm): add license (rome#3629) Add rustdocs index Add environment Change rust docs to use Netlify fix(rome_js_analyze): useValidAnchor considering all possible expressions (rome#3599) fix(rome_js_formatter): Trailing comma inside import rome#3600 (rome#3624)
Summary
Demo
playground-demo.mov
Try to fix #2620
Test Plan