From d10c3f0084e580721682d62ad836e150243df891 Mon Sep 17 00:00:00 2001 From: az3ta <24527778+az3ta@users.noreply.github.com> Date: Tue, 3 Nov 2026 19:16:03 +0100 Subject: [PATCH] feat(radio): clarify station and audio labels - Mark temporary stations as unsaved and clarify saving to My stations - Rename settings, backup, mixer, and patch controls for clearer context --- .../src/components/audio/volume-control.tsx | 5 ++- apps/radio/src/components/import-page.tsx | 11 ++++--- .../radio/confirm-delete-dialog.tsx | 6 ++-- .../radio/dj/deck/deck-panel.test.tsx | 2 +- .../components/radio/dj/dj-console-mobile.tsx | 2 +- .../src/components/radio/dj/dj-radio-list.tsx | 6 +++- .../radio/dj/external-search/search-input.tsx | 4 +-- .../dj/external-search/search-results.tsx | 32 +++++++++++++------ .../radio/dj/mixer/mixer-channel.tsx | 2 +- .../radio/dj/mixer/mixer-master.tsx | 8 ++--- .../radio/dj/mixer/mixer-routing.tsx | 4 +-- .../radio/node/audio-input-content.tsx | 4 +-- .../radio/node/device-nodes.test.tsx | 4 +-- .../components/radio/node/file-content.tsx | 2 +- .../components/radio/node/module-frame.tsx | 2 +- .../radio/node/node-inspector.test.tsx | 2 +- .../src/components/radio/node/node-master.tsx | 5 +-- .../components/radio/node/node-stage.test.tsx | 8 ++--- .../radio/node/output-device-content.tsx | 4 +-- .../components/radio/node/station-content.tsx | 2 +- .../radio/node/station-node.test.tsx | 4 +-- .../radio/node/track-content.test.tsx | 2 +- .../components/radio/node/track-content.tsx | 10 ++++-- .../components/radio/radio-item-actions.tsx | 8 ++--- .../radio/radio-now-playing.test.tsx | 4 +-- .../components/radio/radio-now-playing.tsx | 4 ++- .../radio/radio-search-bar.test.tsx | 19 ++++++++++- .../src/components/radio/radio-search-bar.tsx | 24 ++++++++++---- .../single/single-player-station-list.tsx | 18 +++++++---- .../components/radio/station-save-status.tsx | 14 ++++++++ .../src/components/settings/import-export.tsx | 2 +- .../settings/mode-load-recovery.test.tsx | 2 +- .../src/components/settings/mode-select.tsx | 2 +- .../src/components/settings/settings-form.tsx | 6 ++-- apps/radio/src/lib/db/export-import.ts | 2 +- apps/radio/src/lib/midi/static-actions.ts | 4 +-- 36 files changed, 158 insertions(+), 82 deletions(-) create mode 100644 apps/radio/src/components/radio/station-save-status.tsx diff --git a/apps/radio/src/components/audio/volume-control.tsx b/apps/radio/src/components/audio/volume-control.tsx index 34a3e3c51..44ae974ff 100644 --- a/apps/radio/src/components/audio/volume-control.tsx +++ b/apps/radio/src/components/audio/volume-control.tsx @@ -16,6 +16,8 @@ export type VolumeControlProps = { onVolumeCommit?: () => void; /** Names what the control affects, e.g. "all" reads "Mute all". */ target?: string; + /** Override the slider's accessible name, e.g. "Main volume". */ + volumeLabel?: string; /** The browser ignores media volume, so the slider would do nothing. */ deviceVolume?: boolean; className?: string; @@ -36,6 +38,7 @@ export function VolumeControl({ onVolumeChange, onVolumeCommit, target, + volumeLabel, deviceVolume = false, className, }: VolumeControlProps) { @@ -60,7 +63,7 @@ export function VolumeControl({ ) : (
-

Import configuration

+

Backup & share

- Someone shared their radio configuration with you. Review the changes - below and choose how to import them. + Someone shared their stations and playback settings with you. Review + the changes below and choose how to import them.

@@ -163,9 +163,10 @@ export function ImportPage() {
-

Mode

+

Import as

- Choose how you want to import this configuration: + Choose how you want to import these stations and playback + settings:

diff --git a/apps/radio/src/components/radio/confirm-delete-dialog.tsx b/apps/radio/src/components/radio/confirm-delete-dialog.tsx index 70980a9d9..4b1b94145 100644 --- a/apps/radio/src/components/radio/confirm-delete-dialog.tsx +++ b/apps/radio/src/components/radio/confirm-delete-dialog.tsx @@ -31,7 +31,9 @@ export function ConfirmDeleteDialog({ - Delete “{radio?.name}”? + + Delete “{radio?.name}” from My stations? + This can't be undone. @@ -39,7 +41,7 @@ export function ConfirmDeleteDialog({ Cancel diff --git a/apps/radio/src/components/radio/dj/deck/deck-panel.test.tsx b/apps/radio/src/components/radio/dj/deck/deck-panel.test.tsx index 8d93c0d30..6018ac356 100644 --- a/apps/radio/src/components/radio/dj/deck/deck-panel.test.tsx +++ b/apps/radio/src/components/radio/dj/deck/deck-panel.test.tsx @@ -321,7 +321,7 @@ describe("DeckPanel source picker", () => { if (surface === "change loaded source") { fireEvent.click(view.getByRole("button", { name: CHANGE_SOURCE })); } - await chooseSelectOption(view.container, "Station library"); + await chooseSelectOption(view.container, "Stations"); const input = view.getByRole("searchbox", { name: "Search or paste a link", }); diff --git a/apps/radio/src/components/radio/dj/dj-console-mobile.tsx b/apps/radio/src/components/radio/dj/dj-console-mobile.tsx index df9433dcb..a53570040 100644 --- a/apps/radio/src/components/radio/dj/dj-console-mobile.tsx +++ b/apps/radio/src/components/radio/dj/dj-console-mobile.tsx @@ -129,7 +129,7 @@ export function DjConsoleMobile({ > - + } + title={radio.name} + > diff --git a/apps/radio/src/components/radio/dj/external-search/search-input.tsx b/apps/radio/src/components/radio/dj/external-search/search-input.tsx index 8869a757f..51e7cd580 100644 --- a/apps/radio/src/components/radio/dj/external-search/search-input.tsx +++ b/apps/radio/src/components/radio/dj/external-search/search-input.tsx @@ -46,7 +46,7 @@ type SearchInputProps = { const PLATFORM_HINTS: Record = { all: "Tracks, shows and stations", bandcamp: "Tracks & albums from independent artists", - local: "Curated and saved stations", + local: "Saved and unsaved stations", mixcloud: "DJ mixes, radio shows & podcasts", "radio-browser": "Worldwide radio stations", radiogarden: "40,000+ radio stations worldwide", @@ -57,7 +57,7 @@ const PLATFORM_HINTS: Record = { const PLATFORM_LABELS: Record = { all: "All sources", bandcamp: "Bandcamp", - local: "Station library", + local: "Stations", mixcloud: "Mixcloud", "radio-browser": "Radio Browser", radiogarden: "Radio Garden", diff --git a/apps/radio/src/components/radio/dj/external-search/search-results.tsx b/apps/radio/src/components/radio/dj/external-search/search-results.tsx index 1b8179d4a..a7474fe24 100644 --- a/apps/radio/src/components/radio/dj/external-search/search-results.tsx +++ b/apps/radio/src/components/radio/dj/external-search/search-results.tsx @@ -9,6 +9,7 @@ import type { Radio } from "@/lib/audio"; import { getPlatformSourceColor } from "@/lib/dj-library-sources"; import { formatPlatformDuration } from "@/lib/external-url/utils"; import { useDjTrackLoad } from "@/lib/hooks/use-dj-track-load"; +import { isSessionRadio } from "@/lib/hooks/use-session-radios"; import type { SourceSearchResult as UnifiedSearchResult } from "@/lib/source-search-workflow"; import { EmptyHint } from "../../empty-hint"; import { InlineError } from "../../inline-error"; @@ -31,7 +32,7 @@ type SearchResultsProps = { const PLATFORM_LABELS = { bandcamp: "BC", - local: "FM", + local: "Saved", mixcloud: "MC", "radio-browser": "RB", radiogarden: "RG", @@ -115,7 +116,9 @@ function ResultItem({ ? "external" : result.platform ); + const isNotSaved = Boolean(result.radio && isSessionRadio(result.radio)); const platformLabel = PLATFORM_LABELS[result.platform]; + const stationStatusLabel = isNotSaved ? "Not saved" : platformLabel; const showLoading = isPending || isLoading; return ( @@ -141,16 +144,27 @@ function ResultItem({
)} -
- {platformLabel} -
+ {result.platform === "local" ? null : ( +
+ {platformLabel} +
+ )} - + + {stationStatusLabel} + + ) : null + } + title={result.title} + > {[ result.artist, diff --git a/apps/radio/src/components/radio/dj/mixer/mixer-channel.tsx b/apps/radio/src/components/radio/dj/mixer/mixer-channel.tsx index 81d9f7921..909bb1e20 100644 --- a/apps/radio/src/components/radio/dj/mixer/mixer-channel.tsx +++ b/apps/radio/src/components/radio/dj/mixer/mixer-channel.tsx @@ -180,7 +180,7 @@ function ChannelBody({ title={ isCueActive ? `Cue ${label} in headphones (${deckId === "deck-a" ? "Q" : "W"})` - : "Set a cue output in audio settings" + : "Set a cue output in Settings › Audio" } variant={cueEnabled ? "default" : "outline"} > diff --git a/apps/radio/src/components/radio/dj/mixer/mixer-master.tsx b/apps/radio/src/components/radio/dj/mixer/mixer-master.tsx index d38de074a..89ea45af7 100644 --- a/apps/radio/src/components/radio/dj/mixer/mixer-master.tsx +++ b/apps/radio/src/components/radio/dj/mixer/mixer-master.tsx @@ -39,7 +39,7 @@ export function MixerMaster({
{formatPercent(masterVolume)} - out + Main
diff --git a/apps/radio/src/components/radio/dj/mixer/mixer-routing.tsx b/apps/radio/src/components/radio/dj/mixer/mixer-routing.tsx index 954a75555..9ab3f3722 100644 --- a/apps/radio/src/components/radio/dj/mixer/mixer-routing.tsx +++ b/apps/radio/src/components/radio/dj/mixer/mixer-routing.tsx @@ -16,7 +16,7 @@ function resolveDeviceLabel( return device?.label || "On"; } -/** Where the audio goes, in one line. Click to change it in audio settings. */ +/** Where the audio goes, in one line. Click to change it in Settings › Audio. */ export function MixerRouting() { const audioSettings = useAudioSettings(); const delaySettings = useDelaySettings(); @@ -54,7 +54,7 @@ export function MixerRouting() { trigger={ ) : null} {error?.trim() && !denied && !unplugged ? ( diff --git a/apps/radio/src/components/radio/node/device-nodes.test.tsx b/apps/radio/src/components/radio/node/device-nodes.test.tsx index e28809cb0..151a5a402 100644 --- a/apps/radio/src/components/radio/node/device-nodes.test.tsx +++ b/apps/radio/src/components/radio/node/device-nodes.test.tsx @@ -584,7 +584,7 @@ test("the embedded input inspector retains an accessible Remove action", async ( const onRemove = mock(noop); const view = render(); await flush(); - fireEvent.click(view.getByRole("button", { name: "Remove audio input" })); + fireEvent.click(view.getByRole("button", { name: "Remove from patch" })); expect(onRemove).toHaveBeenCalledTimes(1); }); @@ -600,7 +600,7 @@ for (const supported of [true, false]) { /> ); await flush(); - fireEvent.click(view.getByRole("button", { name: "Remove output device" })); + fireEvent.click(view.getByRole("button", { name: "Remove from patch" })); expect(onRemove).toHaveBeenCalledTimes(1); }); } diff --git a/apps/radio/src/components/radio/node/file-content.tsx b/apps/radio/src/components/radio/node/file-content.tsx index 8a3d99f76..f945f10c8 100644 --- a/apps/radio/src/components/radio/node/file-content.tsx +++ b/apps/radio/src/components/radio/node/file-content.tsx @@ -74,7 +74,7 @@ export function FileNodeBody({ diff --git a/apps/radio/src/components/radio/node/module-frame.tsx b/apps/radio/src/components/radio/node/module-frame.tsx index 6d8af17ac..c89a2e1e8 100644 --- a/apps/radio/src/components/radio/node/module-frame.tsx +++ b/apps/radio/src/components/radio/node/module-frame.tsx @@ -290,7 +290,7 @@ export function ModuleHeader({ {onInspect || onSwap || onReset ? : null} - Remove + Remove from patch diff --git a/apps/radio/src/components/radio/node/node-inspector.test.tsx b/apps/radio/src/components/radio/node/node-inspector.test.tsx index 8667613a6..704c20c4a 100644 --- a/apps/radio/src/components/radio/node/node-inspector.test.tsx +++ b/apps/radio/src/components/radio/node/node-inspector.test.tsx @@ -746,7 +746,7 @@ describe("NodeInspector", () => { ).toBeTruthy() ); checkSettings("Speakers", () => - expect(view.getByRole("slider", { name: "Volume all" })).toBeTruthy() + expect(view.getByRole("slider", { name: "Main volume" })).toBeTruthy() ); checkSettings("Compressor", () => expect(view.getByRole("slider", { name: "Threshold" })).toBeTruthy() diff --git a/apps/radio/src/components/radio/node/node-master.tsx b/apps/radio/src/components/radio/node/node-master.tsx index 5ad62e6a7..f7a3d2be1 100644 --- a/apps/radio/src/components/radio/node/node-master.tsx +++ b/apps/radio/src/components/radio/node/node-master.tsx @@ -32,7 +32,7 @@ function useAudioContextState(): string | null { function MasterMeter() { const level = useMasterPeakLevel(); return ( -
+
{isAnyPlaying ? : null} {needsResume ? ( diff --git a/apps/radio/src/components/radio/node/node-stage.test.tsx b/apps/radio/src/components/radio/node/node-stage.test.tsx index f41c55d16..a29104012 100644 --- a/apps/radio/src/components/radio/node/node-stage.test.tsx +++ b/apps/radio/src/components/radio/node/node-stage.test.tsx @@ -147,8 +147,8 @@ describe("NodeStage", () => { const sources = await waitFor(() => view.getByRole("list", { name: "Sources" }) ); - expect(view.getByRole("slider", { name: "Volume all" })).toBeTruthy(); - expect(view.getByRole("button", { name: "Mute all" })).toBeTruthy(); + expect(view.getByRole("slider", { name: "Main volume" })).toBeTruthy(); + expect(view.getByRole("button", { name: "Mute main volume" })).toBeTruthy(); expect(view.queryByRole("button", { name: BULK_TRANSPORT })).toBeNull(); expect(within(sources).getAllByRole("listitem")).toHaveLength(2); @@ -179,7 +179,7 @@ describe("NodeStage", () => { const pause = await waitFor(() => view.getByRole("button", { name: "Pause NTS 1" }) ); - expect(view.getByTitle("Master level")).toBeTruthy(); + expect(view.getByTitle("Main level")).toBeTruthy(); expect(view.queryByRole("button", { name: BULK_TRANSPORT })).toBeNull(); fireEvent.click(pause); expect(controls.setPlaying).toHaveBeenLastCalledWith("src-nts", false); @@ -299,7 +299,7 @@ describe("NodeStage", () => { await waitFor(() => expect(view.getByText("Search to add a station")).toBeTruthy() ); - expect(view.getByRole("slider", { name: "Volume all" })).toBeTruthy(); + expect(view.getByRole("slider", { name: "Main volume" })).toBeTruthy(); expect(view.queryByRole("button", { name: BULK_TRANSPORT })).toBeNull(); }); diff --git a/apps/radio/src/components/radio/node/output-device-content.tsx b/apps/radio/src/components/radio/node/output-device-content.tsx index 865327680..61d23ac45 100644 --- a/apps/radio/src/components/radio/node/output-device-content.tsx +++ b/apps/radio/src/components/radio/node/output-device-content.tsx @@ -202,7 +202,7 @@ export function OutputDeviceNodeBody({ - Remove + Remove from patch @@ -281,7 +281,7 @@ export function OutputDeviceNodeBody({ variant="ghost" > - Remove output device + Remove from patch ) : null}
diff --git a/apps/radio/src/components/radio/node/station-content.tsx b/apps/radio/src/components/radio/node/station-content.tsx index 6ee57f2a6..8fb9443d5 100644 --- a/apps/radio/src/components/radio/node/station-content.tsx +++ b/apps/radio/src/components/radio/node/station-content.tsx @@ -80,7 +80,7 @@ function EmptyStation({ diff --git a/apps/radio/src/components/radio/node/station-node.test.tsx b/apps/radio/src/components/radio/node/station-node.test.tsx index af8b0ec5a..acc7804c7 100644 --- a/apps/radio/src/components/radio/node/station-node.test.tsx +++ b/apps/radio/src/components/radio/node/station-node.test.tsx @@ -235,8 +235,8 @@ test("a filled Station removes its own node separately from the station library fireEvent.keyDown(view.getByRole("button", { name: "Options for KEXP" }), { key: "ArrowDown", }); - expect(view.getByRole("menuitem", { name: "Delete" })).toBeTruthy(); - fireEvent.click(view.getByRole("menuitem", { name: "Remove node" })); + expect(view.getByRole("menuitem", { name: "Delete station" })).toBeTruthy(); + fireEvent.click(view.getByRole("menuitem", { name: "Remove from patch" })); expect(onRemove).toHaveBeenCalledTimes(1); expect(onDelete).not.toHaveBeenCalled(); }); diff --git a/apps/radio/src/components/radio/node/track-content.test.tsx b/apps/radio/src/components/radio/node/track-content.test.tsx index efc598744..06de637bf 100644 --- a/apps/radio/src/components/radio/node/track-content.test.tsx +++ b/apps/radio/src/components/radio/node/track-content.test.tsx @@ -277,7 +277,7 @@ for (const provider of ["radio-browser", "radiogarden", "local"]) { renderBothViews(); const label = { - local: "Station library", + local: "Stations", radiogarden: "Radio Garden", "radio-browser": "Radio Browser", }[provider] ?? provider; diff --git a/apps/radio/src/components/radio/node/track-content.tsx b/apps/radio/src/components/radio/node/track-content.tsx index e3608f36c..8790e66a8 100644 --- a/apps/radio/src/components/radio/node/track-content.tsx +++ b/apps/radio/src/components/radio/node/track-content.tsx @@ -139,9 +139,13 @@ export function TrackCard({ } /> - + - Remove {typeName} + Remove from patch @@ -202,7 +206,7 @@ export function TrackNodeBody({ className="w-84" embedded={embedded} onRemove={onRemove} - removeLabel="Remove empty Track" + removeLabel="Remove from patch" selected={selected} title="Track" > diff --git a/apps/radio/src/components/radio/radio-item-actions.tsx b/apps/radio/src/components/radio/radio-item-actions.tsx index 16c6a0a3a..0f4299f63 100644 --- a/apps/radio/src/components/radio/radio-item-actions.tsx +++ b/apps/radio/src/components/radio/radio-item-actions.tsx @@ -145,7 +145,7 @@ export function RadioItemActions({ <> - Save + Save station @@ -201,19 +201,19 @@ export function RadioItemActions({ variant="destructive" > - Remove node + Remove from patch ) : null} {isSession ? ( <> - Remove + Remove station ) : ( <> - Delete + Delete station )} diff --git a/apps/radio/src/components/radio/radio-now-playing.test.tsx b/apps/radio/src/components/radio/radio-now-playing.test.tsx index c759fa4ee..2d018c041 100644 --- a/apps/radio/src/components/radio/radio-now-playing.test.tsx +++ b/apps/radio/src/components/radio/radio-now-playing.test.tsx @@ -495,7 +495,7 @@ describe("RadioNowPlaying", () => { expect(details.getByText("Current show description.")).toBeTruthy(); expect(details.getByText("Static station description.")).toBeTruthy(); expect(details.getByText("Berlin, Germany")).toBeTruthy(); - const stationLink = details.getByRole("link", { name: "Station website" }); + const stationLink = details.getByRole("link", { name: "Website" }); expect(stationLink.getAttribute("href")).toBe("https://radio.example/"); expect(stationLink.getAttribute("target")).toBe("_blank"); expect(stationLink.getAttribute("rel")).toBe("noopener noreferrer"); @@ -586,7 +586,7 @@ describe("RadioNowPlaying", () => { const details = within(view.getByRole("dialog")); expect(details.getAllByText("Static station description.")).toHaveLength(1); expect(details.queryByRole("heading", { name: "Description" })).toBeNull(); - expect(details.queryByRole("link", { name: "Station website" })).toBeNull(); + expect(details.queryByRole("link", { name: "Website" })).toBeNull(); }); test("recovers from a failed artwork URL when the show changes", () => { diff --git a/apps/radio/src/components/radio/radio-now-playing.tsx b/apps/radio/src/components/radio/radio-now-playing.tsx index 44ceb83fc..eeb6a0c81 100644 --- a/apps/radio/src/components/radio/radio-now-playing.tsx +++ b/apps/radio/src/components/radio/radio-now-playing.tsx @@ -22,6 +22,7 @@ import type { RadioNowPlaying as RadioNowPlayingMetadata } from "@/lib/metadata/ import { GenreBadges } from "./genre-badges"; import { RadioLogo } from "./radio-logo"; import { formatLocation } from "./station-row"; +import { StationSaveStatus } from "./station-save-status"; type RadioNowPlayingProps = { radio: Radio; @@ -299,6 +300,7 @@ export function RadioNowPlaying({ genre={metadata?.genre} limit={featured ? 3 : 1} /> +
@@ -344,7 +346,7 @@ function StationInformation({ rel="noopener noreferrer" target="_blank" > - Station website + Website