-
Notifications
You must be signed in to change notification settings - Fork 2
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
[BUG FIX] fix bug where form didn't include off Switches #41
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe recent changes primarily focus on enhancing the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
server/app/query/create/page.tsx (2)
Line range hint
217-222
: Add keyboard event handlers for accessibility.The onClick events should be paired with keyboard event handlers (onKeyUp, onKeyDown, or onKeyPress) to ensure accessibility for users who rely on keyboard navigation.
+ onKeyUp={handleKeyUp} + onKeyDown={handleKeyDown} + onKeyPress={handleKeyPress}Please add these handlers to the elements at lines 217-222 and 242-250.
Also applies to: 242-250
Line range hint
232-238
: Specify button type to prevent unintended form submissions.The button inside the form does not have an explicit type defined, which can lead to unintended form submissions. Specify the type as 'button' if it is not meant to submit the form.
- <button + <button type="button"
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- server/app/query/create/page.tsx (6 hunks)
Additional context used
Biome
server/app/query/create/page.tsx
[error] 217-222: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
[error] 242-250: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
[error] 232-238: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
Additional comments not posted (2)
server/app/query/create/page.tsx (2)
362-367
: Ensure consistent form data submission with hidden inputs.The addition of hidden inputs for
stall_detection
,multi_threading
, anddisable_metrics
ensures that these values are always included in the form data, aligning with the API's expectations for boolean values. This is a robust solution for the issue described in the PR.Also applies to: 389-393, 415-419
Line range hint
1-419
: Overall structure and logic are well-implemented.The file is well-organized with clear separation of concerns among components. The logic for handling form submissions and state management is effectively implemented, ensuring a smooth user experience.
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.
Lets ship it to unblock the service, but maybe UI is not the right place to do it. If it is possible to do server-side translation and set flags to false
, if the element is missing, then we can support more cases like this
A few thoughts on doing it server side:
|
turns out the
Switch
element by default sets the value to "on" if it's on, and removes it entirely from the form if it's off. The API expects a bool, so we override it here.as an aside, this makes a good case for adding tests, even for some of the front end flows. moving it up my prioritization list.
Summary by CodeRabbit
stall_detection
,multi_threading
, anddisable_metrics
to ensure these settings are always included in the form data.