Skip to content

refactor(ui): extract Menu and Tile into the component kit#60

Merged
thisiscsim merged 3 commits into
mainfrom
refactor/ui-menu
Jul 20, 2026
Merged

refactor(ui): extract Menu and Tile into the component kit#60
thisiscsim merged 3 commits into
mainfrom
refactor/ui-menu

Conversation

@thisiscsim

@thisiscsim thisiscsim commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Menu (Menu / MenuItem / MenuSub in components/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 to styles/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 real Button component, fixing a latent class-name mismatch (ui-btn-ghost vs ui-btn--ghost).
  • Tile (Tile / TileThumb / AlbumCover / AlbumCoverCell / NewTile in components/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.tsx keeps only data wiring (thumbnail fetching, menu items, rename dialogs). Also consolidates a duplicated .tile-new CSS declaration.
  • Both components have Storybook stories (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 build passes with the new stories
  • Manual: tile menus (rename/delete/move-to-album incl. New album), sort menu, Presets, Layer menu opens upward; tile hover lift + keyboard activation; album cover grid

Renderer-only — no dev-server restart needed.

thisiscsim and others added 3 commits July 19, 2026 19:46
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>
@thisiscsim thisiscsim changed the title refactor(ui): extract Menu into the component kit refactor(ui): extract Menu and Tile into the component kit Jul 20, 2026
@thisiscsim
thisiscsim merged commit 6deadf6 into main Jul 20, 2026
1 check passed
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