Skip to content

fix(frontend): fast refresh, barrel files, and dark mode fixes - #5

Merged
pdevito3 merged 9 commits into
mainfrom
fix/frontend-cleanup
Oct 18, 2026
Merged

pdevito3 merged 9 commits into
mainfrom
fix/frontend-cleanup

Conversation

@pdevito3

@pdevito3 pdevito3 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

These frontend fixes were made during the work on #3, but they are not part of the Kubb contract. This PR moves them to their own review.

Changes

  • Fast refresh: the cva variants, hooks, contexts, and the Notification API moved out of the component files into their own files. Fast refresh works only when a file exports only components. The public names do not change.
  • Entry chunk: the lazy route code no longer goes into the entry chunk.
  • Barrel files: removed the filter-builder barrel file and the unused svg barrel file. The imports now go to the source files.
  • Theme toggle: the toggle now fits in the collapsed sidebar.
  • Dark mode: the destructive color is now readable in dark mode.
  • Unused code: removed the unused combobox filter hook, and the old filter hook comments in the autocomplete and combobox files.
  • Toaster: the toast container is now Toaster in toaster.tsx. The old name Notifications was too close to the Notification API that shows a toast.

Notes

Fast refresh only works when a file exports only components. Move the cva variants, hooks, contexts, and the Notification API to their own files next to the components, and update the imports. The public names do not change.
The filter-demo route imported types inline with values. With verbatimModuleSyntax the route split left a side-effect import of the filter builder in the route file, so the filter builder, the calendar, and react-aria went into the entry chunk. Import the types with import type.

Also put the vendor libraries that the root layout always loads (react, the router, the query client, motion) in their own chunks. The entry chunk goes from 897 kB to 288 kB, and the build has no chunk size warning.
The project rules forbid barrel files. The filter-builder barrel also caused the large entry chunk: an import of it from the filter demo route pulled the whole filter builder into the entry. The route now imports from each source file.
The project rules forbid barrel files, and nothing imported this one.
The three theme buttons were wider than the icon rail, so the rail clipped them. The buttons now stack vertically in the rail.
The variants use the destructive color for text, but the dark value was too dark to read on the dark background. The dark value is now the current shadcn value.
No file imports the useComboboxFilter hook. Remove the file.
@pdevito3
pdevito3 force-pushed the fix/frontend-cleanup branch from eb55ab0 to 4284e19 Compare October 18, 2026 16:01
Remove the old filter hook comments in the autocomplete and combobox files. Rename notifications.tsx to toaster.tsx, because the file holds the Toaster.
The name Notifications was too close to the Notification API that shows a toast. The JSDoc now says that the component is the container, and that Notification shows a toast.
@pdevito3
pdevito3 merged commit 7368400 into main Oct 18, 2026
@pdevito3
pdevito3 deleted the fix/frontend-cleanup branch October 18, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant