-
-
Notifications
You must be signed in to change notification settings - Fork 9
Fix dropdown styling for Author form #1416
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
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThis PR replaces the native HTML select element with a custom Dropdown component in the Authors form section. It updates Superform integration to track author selection state and refresh on form updates, improving visibility and styling consistency with other dropdown controls. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/routes/(authenticated)/projects/[id=idNumber]/forms/Authors.svelte (1)
108-162: Prevent form submission without author selection.The hidden input at line 110 will have an
undefinedvalue when no author is selected, allowing users to submit an incomplete form. Consider disabling the submit button whenselectedAuthoris null to improve UX and prevent invalid submissions.Apply this diff to disable the submit button when no author is selected:
- <BlockIfJobsUnavailable className="btn btn-primary"> + <BlockIfJobsUnavailable className="btn btn-primary {!selectedAuthor ? 'btn-disabled' : ''}"> {#snippet altContent()} {m.authors_submit()} {/snippet} - <button type="submit" class="btn btn-primary"> + <button type="submit" class="btn btn-primary" disabled={!selectedAuthor}> {m.authors_submit()} </button> </BlockIfJobsUnavailable>
🧹 Nitpick comments (1)
src/routes/(authenticated)/projects/[id=idNumber]/forms/Authors.svelte (1)
119-127: Use descriptive placeholder text instead of empty space.Line 122 uses a single space (
' ') as the fallback when no author is selected, which provides no guidance to users. Consider using a descriptive placeholder like an i18n message (e.g.,m.authors_select()or similar) to improve clarity.Example improvement:
<span class="px-1 w-full text-left"> {#if availableAuthors.length} - {selectedAuthor?.Name ?? ' '} + {selectedAuthor?.Name ?? m.authors_selectPlaceholder()} {:else} {m.authors_emptyGroup()} {/if} </span>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/routes/(authenticated)/projects/[id=idNumber]/forms/Authors.svelte(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: checks / build-and-test
- GitHub Check: check / build-and-test
🔇 Additional comments (1)
src/routes/(authenticated)/projects/[id=idNumber]/forms/Authors.svelte (1)
48-60: LGTM! Clean state management approach.The superform integration is well-designed: removing the
formbinding since you're managing selection state locally, and theonUpdatedhandler appropriately resets the dropdown after form updates.
|
Marking as draft for now. I will be working on a more thorough change that fixes the styling of all the |
Fixes #1412
Summary by CodeRabbit
Bug Fixes
Style
✏️ Tip: You can customize this high-level summary in your review settings.