refactor(ui): extract Menu and Tile into the component kit#60
Merged
Conversation
The dropdown pattern existed as four hand-rolled copies (Home tile menus, sort menu, editor presets, timeline layer button), each with its own open-state, Escape/outside-click handling, and CSS. Menu is now a kit component with canonical popover styling in ui.css; call sites only supply trigger + positioning class. Adds Storybook stories (default, submenu, stacked label+hint) and retires the presets-item CSS family. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…onent kit Same treatment as Menu: the grid-card anatomy (square media, title/meta row, actions slot, Enter/Space activation, media-only hover lift) moves into a presentational kit component with canonical CSS in ui.css. Home keeps only data wiring (thumbnail fetching, menus, dialogs). Consolidates the duplicated .tile-new declaration and adds Tile stories. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Menu/MenuItem/MenuSubincomponents/ui/Menu.tsx): the dropdown existed as four hand-rolled copies (Home tile menus, sort menu, editor Presets, timeline Layer button), each with its own open-state, Escape + outside-click handling, and CSS. Now a single kit component owning dismissal, close-on-select, and the hover-flyout submenu (gap bridge + grace timer). Canonical popover look moved tostyles/ui.css; call sites keep only positioning classes (tile-menu-pop,sort-pop,presets-pop,tl-layer-menu). The Layer button also picks up the realButtoncomponent, fixing a latent class-name mismatch (ui-btn-ghostvsui-btn--ghost).Tile/TileThumb/AlbumCover/AlbumCoverCell/NewTileincomponents/ui/Tile.tsx): the homepage project/album cards' shared anatomy (square media, title/meta row, actions slot, Enter/Space activation, media-only hover lift) is now a presentational kit component;Home.tsxkeeps only data wiring (thumbnail fetching, menu items, rename dialogs). Also consolidates a duplicated.tile-newCSS declaration.UI/Menu: default / submenu / stacked;UI/Tile: project / empty / album / partial album / new tile).Test plan
npm run lint && npm run typecheck && npm test && npm run build(126 tests green; Home menu + tile interaction tests exercise the new components)storybook buildpasses with the new storiesRenderer-only — no dev-server restart needed.