🎨 Palette: Add form wrappers for native keyboard submission#633
🎨 Palette: Add form wrappers for native keyboard submission#633seonghobae wants to merge 1 commit into
Conversation
🎨 Palette: [UX improvement] Add form wrappers for native keyboard submission 💡 What: I changed standard `div` wrappers to semantic `<form>` wrappers around 'New Project', 'New Connection', and 'Inline Project Create' field groups in `App.tsx`. I also changed their primary button types from `button` to trigger form submissions. 🎯 Why: To natively allow users to press 'Enter' from within text inputs to trigger the creation/save flows, rather than forcing them to manually click the confirmation button. This resolves a significant keyboard accessibility frustration point. ♿ Accessibility: Enables native, standard implicit form submission flow (keyboard Enter) where it was previously missing.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Pull request overview
This PR improves keyboard accessibility across key creation flows in the frontend by switching input/action wrappers from non-semantic containers to semantic <form> elements, enabling native Enter-to-submit behavior without requiring mouse clicks.
Changes:
- Wrap “New project”, “New connection (DSN)”, and inline project creation UI groups in
<form>elements withonSubmithandlers. - Change primary action buttons in those groups from
type="button"totype="submit". - Document the “prefer forms for native submission” guideline in
.Jules/palette.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| frontend/src/App.tsx | Convert key create/save input groups into forms to support native keyboard submission. |
| .Jules/palette.md | Add a palette learning entry describing the form-wrapper pattern for Enter-to-submit. |
Comments suppressed due to low confidence (1)
frontend/src/App.tsx:1327
- Same as the editor 'New project' form: this onSubmit handler duplicates trimming/guard logic that already exists inside onCreateProject(). Prefer delegating to onCreateProject() to avoid future drift between the UI guard and the actual creation logic.
onSubmit={(e) => {
e.preventDefault();
if (projectName.trim() && !isCreatingProject) {
onCreateProject();
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| onSubmit={(e) => { | ||
| e.preventDefault(); | ||
| if (projectName.trim() && !isCreatingProject) { | ||
| onCreateProject(); | ||
| } | ||
| }} |
| onSubmit={(e) => { | ||
| e.preventDefault(); | ||
| if (selectedProjectId && connName.trim() && isDsnPresent && !isCreatingConnection) { | ||
| onCreateConnection(); | ||
| } | ||
| }} |
| <form | ||
| className="row" | ||
| onSubmit={(e) => { | ||
| e.preventDefault(); | ||
| if (projectName.trim() && !isCreatingProject) { |
| **Learning:** Modals designed with plain `<div>` elements as wrappers instead of `<form>` lack native keyboard submission support, forcing users to switch from keyboard to mouse to confirm actions like "Save". | ||
| **Action:** When designing modals or popups containing inputs, always use a `<form>` element to wrap the content, handle the `onSubmit` event (calling `e.preventDefault()`), and set the primary confirmation button to `type="submit"` to enable seamless Enter-key submission for keyboard users. | ||
|
|
||
| ## $(date +%Y-%m-%d) - Native Keyboard Submission Support |
💡 What: Changed standard
divwrappers to semantic<form>wrappers around 'New Project', 'New Connection', and 'Inline Project Create' field groups inApp.tsx. Changed their primary submission button types frombuttontosubmit.🎯 Why: To natively allow users to press 'Enter' from within text inputs to trigger the creation/save flows, rather than forcing them to manually click the submit button. This resolves a significant keyboard accessibility frustration point.
♿ Accessibility: Enables native, standard implicit form submission flow (keyboard Enter) where it was previously missing.
PR created automatically by Jules for task 12322545082347105342 started by @seonghobae