Repository navigation
refactor(dashboard): extract shared FormField/Input/Select/FieldHint components (#302) - #340
Merged
presidojay1 merged 2 commits intoOct 15, 2026
Conversation
…d forms (StellarTickets#302) Replaces 17 hand-written label/input/select/hint blocks across the dashboard, organization and event pages.
|
@oluwarantimini Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
❌ Deploy Preview for stellartickets failed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#129 was closed, but every dashboard form still writes out the same field markup by hand:
This pattern was repeated 17 times across
app/dashboard/page.tsx(create organization),app/dashboard/organizations/[id]/page.tsx(create event) andapp/dashboard/events/[id]/page.tsx(add ticket type, issue ticket). Any styling or accessibility change had to be made in 17 places, and the copies were already starting to drift.What changed
1.
feat(ui): newsrc/components/form-field.tsxFormField({ label, children })<label className="flex flex-col gap-1 text-sm">with the label text, so clicking the text still focuses the controlInput<input>with the shared control classes; any extraclassName(e.g.w-28,font-mono text-xs) is appendedSelect<select>with the same shared classesFieldHint({ id?, children })text-xs text-mutedhelper text;idkeepsaria-describedbyworking (e.g.slug-help)FIELD_CONTROL_CLASS2.
refactor(dashboard): all three dashboard pages use themAll 17 fields were converted (4 + 7 + 6). Nothing changes for users: the same DOM structure, the same classes, the same props (
required,pattern,onInvalid/onInputcustom validity,aria-describedby,inputMode,min/max/step) and the same hints. Field-specific error spans, such as the slug error, stay where they were inside the field. Net change on the pages: −98 / +71 lines.Done-when check
The dashboard forms use the shared components.
grep -rn "<label\|<input\|<select" src/app/dashboardreturns nothing.Verification
npx tsc --noEmit: no errors inapp/dashboardorform-field.tsx.npx eslint src/app/dashboard src/components/form-field.tsx: clean.npx vitest run: 21 files, 84 tests, all pass, includingapp/dashboard/page.test.ts.Closes Extract shared form field components for dashboard forms #302
Closes Extract a shared status badge component #303
Closes Extract a shared industry select component #304
Closes Extract useRequireAuth into a hook #305