From b986ffe7d18b837a93aca768e7b406b79a13296b Mon Sep 17 00:00:00 2001 From: mignot Date: Mon, 26 Oct 2026 16:32:27 +0100 Subject: [PATCH 1/2] feat(genre-tree): Google Maps-style action band and previous button in the search field Co-Authored-By: Claude Sonnet 5.5 --- CHANGELOG.md | 9 ++ .../src/genre-tree/GenreActionBand.tsx | 92 +++++++++++++++++++ .../src/genre-tree/GenreSearch.test.tsx | 23 ----- .../app-kit-ui/src/genre-tree/GenreSearch.tsx | 65 +++++-------- .../src/genre-tree/GenreTreeView.tsx | 49 ++++++++-- 5 files changed, 161 insertions(+), 77 deletions(-) create mode 100644 packages/app-kit-ui/src/genre-tree/GenreActionBand.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index a37fde6..8510f90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,15 @@ easy to spot when bumping. ## [Unreleased] +### Added + +- `GenreTreeView` (wheel, pop-core): genre-tree-view's "Previous" button now sits inside the search field, left of the genre name, and fades in sliding from the left; the field's left padding widens to make room. +- `GenreActionBand`: Google Maps-style band under the detail panel header (icon over label) holding Play/Pause, Focus and the `additionalActions`. + +### Breaking + +- `GenreSearch`: `onZoomIn`, `onPlayPause` and `isPlaying` are removed; those actions moved to the detail panel's action band. The search icon now sits right of the field's text, left of the clear button. + ## [13.5.0] - 2026-10-26 ### Added diff --git a/packages/app-kit-ui/src/genre-tree/GenreActionBand.tsx b/packages/app-kit-ui/src/genre-tree/GenreActionBand.tsx new file mode 100644 index 0000000..26fb577 --- /dev/null +++ b/packages/app-kit-ui/src/genre-tree/GenreActionBand.tsx @@ -0,0 +1,92 @@ +"use client"; + +import type { ReactNode } from "react"; +import { Pause, Play, Plus, ZoomIn } from "lucide-react"; +import type { + GenreTreeAction, + GenreTreeNode, +} from "@behindthemusictree/genre-tree-view"; + +export type GenreActionBandProps = { + node: GenreTreeNode; + /** When set, shows the Play/Pause action. */ + onPlayPause?: () => void; + isPlaying?: boolean; + /** When set, shows the "Zoom in" action. */ + onZoomIn?: () => void; + /** When set, shows the "Add" (sub-genre) action. */ + onAddChild?: () => void; + /** Only `placement: "primary"` actions show here; the rest stay in the panel's overflow menu. */ + additionalActions?: (node: GenreTreeNode) => GenreTreeAction[]; +}; + +type BandItem = { + key: string; + label: string; + icon: ReactNode; + onClick: (event: React.MouseEvent) => void; + disabled?: boolean; +}; + +export default function GenreActionBand({ + node, + onPlayPause, + isPlaying = false, + onZoomIn, + onAddChild, + additionalActions, +}: GenreActionBandProps) { + const items: BandItem[] = []; + if (onPlayPause) { + items.push({ + key: "play-pause", + label: isPlaying ? "Pause" : "Play", + icon: isPlaying ? ( +