Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/radio/src/components/audio/volume-control.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,6 +38,7 @@ export function VolumeControl({
onVolumeChange,
onVolumeCommit,
target,
volumeLabel,
deviceVolume = false,
className,
}: VolumeControlProps) {
Expand All @@ -60,7 +63,7 @@ export function VolumeControl({
</span>
) : (
<Slider
aria-label={`Volume${suffix}`}
aria-label={volumeLabel ?? `Volume${suffix}`}
aria-valuetext={`${Math.round((isMuted ? 0 : volume) * 100)}%`}
className="min-w-0 flex-1"
defaultValue={[1]}
Expand Down
11 changes: 6 additions & 5 deletions apps/radio/src/components/import-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ export function ImportPage() {
return (
<div className="mx-auto w-full max-w-2xl space-y-6 p-4">
<div className="space-y-2 text-center">
<h1 className="font-semibold text-lg">Import configuration</h1>
<h1 className="font-semibold text-lg">Backup & share</h1>
<p className="text-muted-foreground">
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.
</p>
</div>

Expand Down Expand Up @@ -163,9 +163,10 @@ export function ImportPage() {
<Card className="p-6">
<div className="space-y-4">
<div>
<h3 className="mb-2 font-medium">Mode</h3>
<h3 className="mb-2 font-medium">Import as</h3>
<p className="mb-4 text-muted-foreground text-sm">
Choose how you want to import this configuration:
Choose how you want to import these stations and playback
settings:
</p>
</div>

Expand Down
6 changes: 4 additions & 2 deletions apps/radio/src/components/radio/confirm-delete-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ export function ConfirmDeleteDialog({
<Dialog onOpenChange={handleOpenChange} open={Boolean(radio)}>
<DialogContent className="sm:max-w-sm">
<DialogHeader>
<DialogTitle>Delete &ldquo;{radio?.name}&rdquo;?</DialogTitle>
<DialogTitle>
Delete &ldquo;{radio?.name}&rdquo; from My stations?
</DialogTitle>
<DialogDescription>This can&apos;t be undone.</DialogDescription>
</DialogHeader>
<DialogFooter>
<Button onClick={onCancel} size="sm" variant="outline">
Cancel
</Button>
<Button onClick={onConfirm} size="sm" variant="destructive">
Delete
Delete station
</Button>
</DialogFooter>
</DialogContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
Expand Down
2 changes: 1 addition & 1 deletion apps/radio/src/components/radio/dj/dj-console-mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function DjConsoleMobile({
>
<IconVolume className="size-3.5 shrink-0 text-muted-foreground" />
<Slider
aria-label="Master volume"
aria-label="Main volume"
className="py-2.5"
defaultMarkerValue={100}
defaultValue={[100]}
Expand Down
6 changes: 5 additions & 1 deletion apps/radio/src/components/radio/dj/dj-radio-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
stationFallbackSubtitle,
stationRowButtonOnlyClassName,
} from "../station-row";
import { StationSaveStatus } from "../station-save-status";
import { ExternalSearch } from "./external-search";

type DeckId = "deck-a" | "deck-b";
Expand Down Expand Up @@ -130,7 +131,10 @@ function StationRow({
name={radio.name}
size="md"
/>
<StationRowText title={radio.name}>
<StationRowText
indicator={<StationSaveStatus radio={radio} />}
title={radio.name}
>
<RadioListItemMetadata
fallback={
<StationRowSubtitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type SearchInputProps = {
const PLATFORM_HINTS: Record<SearchPlatform, string> = {
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",
Expand All @@ -57,7 +57,7 @@ const PLATFORM_HINTS: Record<SearchPlatform, string> = {
const PLATFORM_LABELS: Record<SearchPlatform, string> = {
all: "All sources",
bandcamp: "Bandcamp",
local: "Station library",
local: "Stations",
mixcloud: "Mixcloud",
"radio-browser": "Radio Browser",
radiogarden: "Radio Garden",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -31,7 +32,7 @@ type SearchResultsProps = {

const PLATFORM_LABELS = {
bandcamp: "BC",
local: "FM",
local: "Saved",
mixcloud: "MC",
"radio-browser": "RB",
radiogarden: "RG",
Expand Down Expand Up @@ -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 (
Expand All @@ -141,16 +144,27 @@ function ResultItem({
<IconMusic className="size-4 text-muted-foreground" />
</div>
)}
<div
className="absolute bottom-0 left-0 max-w-full truncate px-1 font-bold font-mono text-white text-xs"
style={{ backgroundColor: platformColor }}
title={platformLabel}
>
{platformLabel}
</div>
{result.platform === "local" ? null : (
<div
className="absolute bottom-0 left-0 max-w-full truncate px-1 font-bold font-mono text-white text-xs"
style={{ backgroundColor: platformColor }}
title={platformLabel}
>
{platformLabel}
</div>
)}
</div>

<StationRowText title={result.title}>
<StationRowText
indicator={
result.platform === "local" ? (
<span className="inline-flex shrink-0 border border-border/70 px-1.5 py-0.5 text-muted-foreground text-xs leading-none">
{stationStatusLabel}
</span>
) : null
}
title={result.title}
>
<StationRowSubtitle>
{[
result.artist,
Expand Down
2 changes: 1 addition & 1 deletion apps/radio/src/components/radio/dj/mixer/mixer-channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
>
Expand Down
8 changes: 4 additions & 4 deletions apps/radio/src/components/radio/dj/mixer/mixer-master.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function MixerMaster({
<Knob
defaultValue={1}
format={formatPercent}
label="cue"
label="Cue"
max={1}
min={0}
onChange={onHeadphoneVolumeChange}
Expand All @@ -56,14 +56,14 @@ export function MixerMaster({
<div
className="flex h-full min-h-0 items-stretch gap-2"
style={{ touchAction: "none" }}
title="Master volume. Double-click the handle for 100%."
title="Main volume. Double-click the handle for 100%."
>
<div className="flex h-full min-h-0 flex-col items-center gap-1">
<span className="w-8 shrink-0 text-center font-mono text-xs tabular-nums">
{formatPercent(masterVolume)}
</span>
<Slider
aria-label="Master volume"
aria-label="Main volume"
className="min-h-0 flex-1"
defaultMarkerValue={100}
defaultValue={[100]}
Expand All @@ -76,7 +76,7 @@ export function MixerMaster({
variant="fader"
/>
<span className="font-mono text-muted-foreground text-xs uppercase tracking-wider">
out
Main
</span>
</div>
<div className="flex w-4 py-5">
Expand Down
4 changes: 2 additions & 2 deletions apps/radio/src/components/radio/dj/mixer/mixer-routing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -54,7 +54,7 @@ export function MixerRouting() {
trigger={
<button
className="flex w-full items-center gap-3 text-muted-foreground text-xs hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
title={`${delays}. Click to change outputs.`}
title={`${delays}. Click to open Settings › Audio.`}
type="button"
>
<span className="flex min-w-0 flex-1 items-center gap-1">
Expand Down
4 changes: 2 additions & 2 deletions apps/radio/src/components/radio/node/audio-input-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export function AudioInputNodeBody({
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={onRemove} variant="destructive">
<IconTrash />
Remove
Remove from patch
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand Down Expand Up @@ -334,7 +334,7 @@ export function AudioInputNodeBody({
variant="ghost"
>
<IconTrash />
Remove audio input
Remove from patch
</Button>
) : null}
{error?.trim() && !denied && !unplugged ? (
Expand Down
4 changes: 2 additions & 2 deletions apps/radio/src/components/radio/node/device-nodes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ test("the embedded input inspector retains an accessible Remove action", async (
const onRemove = mock(noop);
const view = render(<InputHarness embedded onRemove={onRemove} />);
await flush();
fireEvent.click(view.getByRole("button", { name: "Remove audio input" }));
fireEvent.click(view.getByRole("button", { name: "Remove from patch" }));
expect(onRemove).toHaveBeenCalledTimes(1);
});

Expand All @@ -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);
});
}
2 changes: 1 addition & 1 deletion apps/radio/src/components/radio/node/file-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function FileNodeBody({
<EmptySourceFrame
embedded={embedded}
onRemove={onRemove}
removeLabel={radio ? `Remove ${radio.name}` : "Remove empty File"}
removeLabel="Remove from patch"
selected={selected}
title={radio?.name ?? "File"}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/radio/src/components/radio/node/module-frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export function ModuleHeader({
{onInspect || onSwap || onReset ? <DropdownMenuSeparator /> : null}
<DropdownMenuItem onClick={onRemove} variant="destructive">
<IconTrash />
Remove
Remove from patch
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions apps/radio/src/components/radio/node/node-master.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function useAudioContextState(): string | null {
function MasterMeter() {
const level = useMasterPeakLevel();
return (
<div title="Master level">
<div title="Main level">
<PeakMeter
compact
left={level.left}
Expand Down Expand Up @@ -73,8 +73,9 @@ export function NodeMasterControls({ className }: { className?: string }) {
isMuted={masterMuted}
onToggleMute={toggleMasterMute}
onVolumeChange={setMasterVolume}
target="all"
target="main volume"
volume={masterVolume}
volumeLabel="Main volume"
/>
{isAnyPlaying ? <MasterMeter /> : null}
{needsResume ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export function OutputDeviceNodeBody({
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={onRemove} variant="destructive">
<IconTrash />
Remove
Remove from patch
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
Expand Down Expand Up @@ -281,7 +281,7 @@ export function OutputDeviceNodeBody({
variant="ghost"
>
<IconTrash />
Remove output device
Remove from patch
</Button>
) : null}
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/radio/src/components/radio/node/station-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function EmptyStation({
<EmptySourceFrame
embedded={embedded}
onRemove={onRemove}
removeLabel="Remove empty Station"
removeLabel="Remove from patch"
selected={selected}
title="Station"
>
Expand Down
4 changes: 2 additions & 2 deletions apps/radio/src/components/radio/node/station-node.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading
Loading