-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: improve keyboard navigation and event handling for logs columns popup #6599
Conversation
…t handling - Replace window.addEventListener with React's onKeyDown handler - Add arrow key navigation to select first/last dropdown options if there is no selected option - Fix edge cases in option selection logic (don't allow selection options if options array is empty)
- Add focus-visible styles to the new column container - Update the new column container to include role and tabIndex for better keyboard navigation
…n is selected - Add a condition to ignore Enter key presses if no option is currently selected
…eviously selected option
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
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 to me! Reviewed everything up to f76c505 in 29 seconds
More details
- Looked at
211
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx:142
- Draft comment:
Ensure that the dependencies foruseCallback
hooks are accurate. The current implementation seems correct, but double-check thataddColumn
andselectedValue
are the only dependencies needed forhandleColumnSelection
, andaddColumn?.options
,selectedValue
, andhandleColumnSelection
forhandleKeyDown
. - Reason this comment was not posted:
Confidence changes required:20%
The use ofuseCallback
forhandleColumnSelection
andhandleKeyDown
is appropriate, but the dependencies should be checked. ThehandleColumnSelection
function usesaddColumn
andselectedValue
, so these should be in the dependency array. ThehandleKeyDown
function usesaddColumn?.options
,selectedValue
, andhandleColumnSelection
, so these should be in the dependency array. The current implementation seems correct, but it's good to ensure that these dependencies are accurate.
2. frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx:158
- Draft comment:
Consider making the logic for handling theEnter
key when no option is selected more explicit. Currently, it returns early, but explicitly stating that no action is taken might improve readability. - Reason this comment was not posted:
Confidence changes required:10%
ThehandleKeyDown
function is correctly usinge.preventDefault()
to prevent default behavior for certain keys, which is good practice. However, the logic for handling theEnter
key when no option is selected could be more explicit. Currently, it returns early, but it might be clearer to explicitly state that no action is taken whenEnter
is pressed without a selection.
3. frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.styles.scss:651
- Draft comment:
Use design tokens or predefined color constants instead of hardcoding color values like#1d212d
to maintain consistency in design and theming. This is also applicable to other hardcoded color values in this file. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
4. frontend/src/components/LogsFormatOptionsMenu/LogsFormatOptionsMenu.tsx:283
- Draft comment:
Avoid using inline styles in React components. Instead, use external stylesheets, CSS classes, or styled components. This is also applicable to other inline styles in this file. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
Workflow ID: wflow_lgz5X4pKLKLfugMK
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id> |
Summary
Related Issues / PR's
Fixes this Sentry
Screenshots
Before:
2024-12-05.12-32-30.mov
After:
2024-12-05.13-59-12.mov
Affected Areas and Manually Tested Areas
Important
Improves keyboard navigation and event handling in
LogsFormatOptionsMenu
by usingonKeyDown
and handling edge cases.window.addEventListener
withonKeyDown
handler inLogsFormatOptionsMenu.tsx
for keyboard events..add-new-column-container
inLogsFormatOptionsMenu.styles.scss
.This description was created by
for f76c505. It will automatically update as commits are pushed.