Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: give ConfirmButtonPair a success tone and unify the sprite approve/lock confirms (#3293)

[._.]/ Adam Eivy9128f620bb9b
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 101c4c411e..f04c4af6c2 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -127,3 +127,7 @@
## Media Collections
- **[issue-3311] A collection now records who created it instead of the grid guessing from its name.** The "auto-generated" ordering and badge shipped in #3283 reverse-engineered provenance on the client from four independent clues — a name prefix, an `Auto-…` description, a `uc-`/`sc-` id, or a universe/series link — so every new machine-created bucket quietly sorted as if you had made it yourself until someone remembered to extend that list. Collections are now stamped `auto` or `user` when they are created, existing ones were classified once by a migration, and the old clue-matching only runs for a record a peer on an older version has not stamped yet.
+
+## UI Consistency
+
+- **[issue-3293] Sprite approve/lock confirmations, the near-black canvases, and the final music-video player now follow the shared conventions.** The shared `ConfirmButtonPair` had no positive tone, so the "Approve this walk" and "Freeze this reference version" confirmations in the sprite workflows hand-rolled their own confirm/cancel markup and each drifted on busy text, spinner, and touch-target height; a `success` tone closes that gap and five hand-rolled pairs now share one implementation, with a 36px minimum height on every pair in the app. The four piano-roll/ambient surfaces that hardcoded a near-black hex now say why they don't follow the theme — the rolls read their background from the same `ROLL_BG` constant their canvas paints with, so the CSS fallback can never drift from the painted pixels, and Ambient mode is explicitly `bg-black` because its white-on-black layers would be unreadable under a day theme. The rendered music video also reserves its 16:9 box like the scene thumbnails already do, so the Download row above it stops jumping when the video's dimensions resolve.
diff --git a/client/src/components/songs/MidiPianoRoll.jsx b/client/src/components/songs/MidiPianoRoll.jsx
index c3864bbd92..3dbc06593e 100644
--- a/client/src/components/songs/MidiPianoRoll.jsx
+++ b/client/src/components/songs/MidiPianoRoll.jsx
@@ -1,7 +1,7 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { midiNoteName, isBlackKey } from '../../lib/pianoKeyboard';
import { chordNoteNames } from '../../lib/midiChords';
-import { roundRect, layerColor } from '../../lib/canvasRoll.js';
+import { roundRect, layerColor, ROLL_BG } from '../../lib/canvasRoll.js';
import { formatTimecode, formatDurationSec } from '../../utils/formatters';
import useCanvasDprSize from '../../hooks/useCanvasDprSize.js';
import useCanvasRollPalette from '../../hooks/useCanvasRollPalette.js';
@@ -718,9 +718,11 @@ export default function MidiPianoRoll({
return (
<div ref={wrapRef} className="relative w-full">
+ {/* Background comes from ROLL_BG, not a theme token — see canvasRoll.js. */}
<canvas
ref={canvasRef}
- className="block w-full rounded-lg bg-[#0c0c0e] touch-none cursor-crosshair focus:outline-none focus:ring-1 focus:ring-port-accent"
+ style={{ backgroundColor: ROLL_BG }}
+ className="block w-full rounded-lg touch-none cursor-crosshair focus:outline-none focus:ring-1 focus:ring-port-accent"
tabIndex={0}
role="img"
aria-label={`MIDI piano roll: ${data?.notes?.length || 0} notes, ${midiNoteName(data?.minMidi ?? 60)} to ${midiNoteName(data?.maxMidi ?? 71)}, ${formatTimecode(duration)} long. Use plus and minus to zoom, arrow keys to move the playhead, shift plus arrows to pan${onTogglePlay ? ', space to play or pause' : ''}.`}
diff --git a/client/src/components/songs/MidiVisualization.jsx b/client/src/components/songs/MidiVisualization.jsx
index a72a07911b..d8878f143e 100644
--- a/client/src/components/songs/MidiVisualization.jsx
+++ b/client/src/components/songs/MidiVisualization.jsx
@@ -4,7 +4,7 @@ import useMidiNotes from '../../hooks/useMidiNotes';
import useMidiPlayer from '../../hooks/useMidiPlayer';
import { detectChordWindows } from '../../lib/midiChords';
import { midiNoteName } from '../../lib/pianoKeyboard';
-import { layerColor } from '../../lib/canvasRoll.js';
+import { layerColor, ROLL_BG } from '../../lib/canvasRoll.js';
import { formatTimecode } from '../../utils/formatters';
import MidiPianoRoll, { MIN_ZOOM, ZOOM_STEP, clampZoom } from './MidiPianoRoll.jsx';
@@ -121,9 +121,12 @@ export default function MidiVisualization({ url, filename, model }) {
{open && (
<div className="px-2 pb-2">
{(status === 'loading' || status === 'error') && (
+ // Placeholder for the roll that is about to mount here, so it
+ // carries the roll's own ROLL_BG rather than a theme token —
+ // otherwise the panel changes color as the canvas swaps in.
<div
- className={`flex items-center justify-center gap-2 rounded-lg bg-[#0c0c0e] text-xs ${status === 'error' ? 'text-port-error' : 'text-gray-400'}`}
- style={{ height: COMPACT_H }}
+ className={`flex items-center justify-center gap-2 rounded-lg text-xs ${status === 'error' ? 'text-port-error' : 'text-gray-400'}`}
+ style={{ height: COMPACT_H, backgroundColor: ROLL_BG }}
>
{status === 'loading' ? (
<><Loader2 size={14} className="animate-spin" /> Parsing MIDI…</>
diff --git a/client/src/components/songs/PianoRoll.jsx b/client/src/components/songs/PianoRoll.jsx
index 638971a132..b048c8003c 100644
--- a/client/src/components/songs/PianoRoll.jsx
+++ b/client/src/components/songs/PianoRoll.jsx
@@ -7,7 +7,7 @@ import {
midiNoteName,
BLACK_KEY_HEIGHT_RATIO,
} from '../../lib/pianoKeyboard';
-import { roundRect } from '../../lib/canvasRoll.js';
+import { roundRect, ROLL_BG } from '../../lib/canvasRoll.js';
import useCanvasDprSize from '../../hooks/useCanvasDprSize.js';
import useCanvasRollPalette from '../../hooks/useCanvasRollPalette.js';
@@ -185,7 +185,8 @@ export default function PianoRoll({ parts, tempo, getPosition, playing, height =
return (
<div ref={wrapRef} className="w-full">
- <canvas ref={canvasRef} className="block w-full rounded-lg bg-[#0c0c0e]" aria-hidden="true" />
+ {/* Background comes from ROLL_BG, not a theme token — see canvasRoll.js. */}
+ <canvas ref={canvasRef} className="block w-full rounded-lg" style={{ backgroundColor: ROLL_BG }} aria-hidden="true" />
<p className="sr-only">
Piano-roll visualization of the selected song layers falling onto a piano keyboard.
</p>
diff --git a/client/src/components/sprites/ReferenceWorkflow.jsx b/client/src/components/sprites/ReferenceWorkflow.jsx
index 64ac7e191a..e6e3b32868 100644
--- a/client/src/components/sprites/ReferenceWorkflow.jsx
+++ b/client/src/components/sprites/ReferenceWorkflow.jsx
@@ -16,6 +16,7 @@ import ForkSpriteModal from './ForkSpriteModal.jsx';
import CorrectionNote, {
CorrectionNoteToggle, correctionPromptPayload, anchorCorrectionKey, MAIN_CORRECTION_KEY,
} from './CorrectionNote.jsx';
+import ConfirmButtonPair from '../ui/ConfirmButtonPair.jsx';
import FilePickerButton from '../ui/FilePickerButton';
import { IMAGE_ACCEPT } from '../../utils/fileUpload';
import RecordRenderPinRow from '../imageGen/RecordRenderPinRow.jsx';
@@ -94,11 +95,18 @@ function CandidateTile({ recordId, candidate, locking, onLock, clipRisk, correct
</button>
</div>
) : confirming ? (
- <div className="mt-auto flex flex-wrap items-center gap-1 text-xs">
- <span className="text-port-warning">Freeze this version?</span>
- <button onClick={() => { setConfirming(false); onLock(candidate); }} disabled={locking} className="min-h-[36px] px-1.5 py-0.5 bg-port-accent text-white rounded disabled:opacity-50">Lock</button>
- <button onClick={() => setConfirming(false)} className="min-h-[36px] px-1.5 py-0.5 text-gray-400 hover:text-white">Cancel</button>
- </div>
+ <ConfirmButtonPair
+ className="mt-auto flex-wrap"
+ prompt="Freeze this version?"
+ confirmText="Lock"
+ confirmIcon={Lock}
+ tone="success"
+ busy={locking}
+ busyText="Locking…"
+ ariaLabel={`Confirm lock ${candidate.target || 'candidate'}`}
+ onConfirm={() => { setConfirming(false); onLock(candidate); }}
+ onCancel={() => setConfirming(false)}
+ />
) : (
<button
onClick={() => setConfirming(true)}
@@ -129,25 +137,17 @@ function LockedAnchor({ recordId, anchor, canUnlock, unlocking, onUnlock }) {
{canUnlock && (confirming ? (
<div className="rounded border border-port-warning/40 bg-port-warning/10 p-1.5 text-[10px]">
<p className="mb-1.5 text-port-warning">Regenerate {direction} from turnaround?</p>
- <div className="flex gap-1">
- <button
- type="button"
- aria-label={`Confirm unlock ${direction} anchor`}
- onClick={() => { setConfirming(false); onUnlock(direction); }}
- disabled={unlocking}
- className="min-h-[36px] flex-1 rounded bg-port-warning px-1.5 py-1 font-medium text-black disabled:opacity-50"
- >
- Unlock
- </button>
- <button
- type="button"
- onClick={() => setConfirming(false)}
- disabled={unlocking}
- className="min-h-[36px] rounded px-1.5 py-1 text-gray-400 hover:text-white disabled:opacity-50"
- >
- Cancel
- </button>
- </div>
+ <ConfirmButtonPair
+ className="flex-wrap"
+ confirmText="Unlock"
+ confirmIcon={Unlock}
+ tone="warning"
+ busy={unlocking}
+ busyText="Unlocking…"
+ ariaLabel={`Confirm unlock ${direction} anchor`}
+ onConfirm={() => { setConfirming(false); onUnlock(direction); }}
+ onCancel={() => setConfirming(false)}
+ />
</div>
) : (
<button
@@ -579,25 +579,17 @@ export default function ReferenceWorkflow({ record, reference, renders, correcti
<p className="text-port-warning">
Reopen the turnaround, main, all 8 anchors, and every approved {anchorSeededPhrase}? Existing versioned files stay in history.
</p>
- <div className="mt-2 flex gap-2">
- <button
- type="button"
- aria-label="Confirm unlock turnaround"
- onClick={unlockTurnaround}
- disabled={turnaroundUnlocking}
- className="flex-1 rounded bg-port-warning px-2 py-1.5 font-medium text-black disabled:opacity-50"
- >
- {turnaroundUnlocking ? 'Unlocking…' : 'Unlock for regeneration'}
- </button>
- <button
- type="button"
- onClick={() => setTurnaroundUnlockConfirming(false)}
- disabled={turnaroundUnlocking}
- className="rounded px-2 py-1.5 text-gray-400 hover:text-white disabled:opacity-50"
- >
- Cancel
- </button>
- </div>
+ <ConfirmButtonPair
+ className="mt-2 flex-wrap"
+ confirmText="Unlock for regeneration"
+ confirmIcon={Unlock}
+ tone="warning"
+ busy={turnaroundUnlocking}
+ busyText="Unlocking…"
+ ariaLabel="Confirm unlock turnaround"
+ onConfirm={unlockTurnaround}
+ onCancel={() => setTurnaroundUnlockConfirming(false)}
+ />
</div>
) : (
<button
@@ -788,25 +780,17 @@ export default function ReferenceWorkflow({ record, reference, renders, correcti
<p className="text-port-warning">
Reopen the main reference and its south {anchorSeededPhrase}? The turnaround and other directions stay locked; existing files remain in history.
</p>
- <div className="mt-2 flex gap-2">
- <button
- type="button"
- aria-label="Confirm unlock main reference"
- onClick={unlockMain}
- disabled={mainUnlocking}
- className="flex-1 rounded bg-port-warning px-2 py-1.5 font-medium text-black disabled:opacity-50"
- >
- {mainUnlocking ? 'Unlocking…' : 'Unlock for regeneration'}
- </button>
- <button
- type="button"
- onClick={() => setMainUnlockConfirming(false)}
- disabled={mainUnlocking}
- className="rounded px-2 py-1.5 text-gray-400 hover:text-white disabled:opacity-50"
- >
- Cancel
- </button>
- </div>
+ <ConfirmButtonPair
+ className="mt-2 flex-wrap"
+ confirmText="Unlock for regeneration"
+ confirmIcon={Unlock}
+ tone="warning"
+ busy={mainUnlocking}
+ busyText="Unlocking…"
+ ariaLabel="Confirm unlock main reference"
+ onConfirm={unlockMain}
+ onCancel={() => setMainUnlockConfirming(false)}
+ />
</div>
) : (
<button
diff --git a/client/src/components/sprites/ReferenceWorkflow.test.jsx b/client/src/components/sprites/ReferenceWorkflow.test.jsx
index 3aa7122237..7bff2825a3 100644
--- a/client/src/components/sprites/ReferenceWorkflow.test.jsx
+++ b/client/src/components/sprites/ReferenceWorkflow.test.jsx
@@ -118,7 +118,8 @@ describe('ReferenceWorkflow workspace', () => {
await user.click(within(anchors).getByRole('button', { name: 'Unlock north anchor' }));
expect(within(anchors).getByText('Regenerate north from turnaround?')).toBeInTheDocument();
- await user.click(within(anchors).getByRole('button', { name: 'Confirm unlock north anchor' }));
+ const anchorConfirm = within(anchors).getByRole('group', { name: 'Confirm unlock north anchor' });
+ await user.click(within(anchorConfirm).getByRole('button', { name: 'Unlock' }));
expect(unlockSpriteReferenceAnchor).toHaveBeenCalledWith(
'example-pioneer',
@@ -141,7 +142,8 @@ describe('ReferenceWorkflow workspace', () => {
await user.click(within(turnaround).getByRole('button', { name: 'Unlock turnaround' }));
expect(within(turnaround).getByText(/Reopen the turnaround, main, all 8 anchors/)).toBeInTheDocument();
- await user.click(within(turnaround).getByRole('button', { name: 'Confirm unlock turnaround' }));
+ const turnaroundConfirm = within(turnaround).getByRole('group', { name: 'Confirm unlock turnaround' });
+ await user.click(within(turnaroundConfirm).getByRole('button', { name: 'Unlock for regeneration' }));
expect(unlockSpriteTurnaround).toHaveBeenCalledWith(
'example-pioneer',
{ silent: true },
@@ -163,7 +165,8 @@ describe('ReferenceWorkflow workspace', () => {
// No definitions supplied → the generic noun, never a track name this record
// may not carry.
expect(within(main).getByText(/Reopen the main reference and its south animations\?/)).toBeInTheDocument();
- await user.click(within(main).getByRole('button', { name: 'Confirm unlock main reference' }));
+ const mainConfirm = within(main).getByRole('group', { name: 'Confirm unlock main reference' });
+ await user.click(within(mainConfirm).getByRole('button', { name: 'Unlock for regeneration' }));
expect(unlockSpriteMainReference).toHaveBeenCalledWith('example-pioneer', { silent: true });
});
diff --git a/client/src/components/sprites/WalkWorkflow.jsx b/client/src/components/sprites/WalkWorkflow.jsx
index 2807945d6d..7a22f38c36 100644
--- a/client/src/components/sprites/WalkWorkflow.jsx
+++ b/client/src/components/sprites/WalkWorkflow.jsx
@@ -421,11 +421,17 @@ function DirectionCard({
)}
{candidate && (
confirming ? (
- <div className="flex items-center gap-1 text-xs">
- <span className="text-port-warning">Approve?</span>
- <button onClick={() => { setConfirming(false); onApprove(direction, candidate.id); }} className="min-h-[36px] px-1.5 py-0.5 bg-port-accent text-white rounded">Yes</button>
- <button onClick={() => setConfirming(false)} className="min-h-[36px] px-1.5 py-0.5 text-gray-400 hover:text-white">No</button>
- </div>
+ <ConfirmButtonPair
+ className="flex-wrap"
+ prompt="Approve?"
+ confirmText="Yes"
+ cancelText="No"
+ confirmIcon={Check}
+ tone="success"
+ ariaLabel={`Confirm approve ${direction}`}
+ onConfirm={() => { setConfirming(false); onApprove(direction, candidate.id); }}
+ onCancel={() => setConfirming(false)}
+ />
) : (
// Approval is where a direction's geometry gets frozen into the
// set the atlas compiles, so a drifted candidate can't be approved
diff --git a/client/src/components/ui/ConfirmButtonPair.jsx b/client/src/components/ui/ConfirmButtonPair.jsx
index e6b0c45767..fa84e3df93 100644
--- a/client/src/components/ui/ConfirmButtonPair.jsx
+++ b/client/src/components/ui/ConfirmButtonPair.jsx
@@ -4,14 +4,19 @@ import { Loader2 } from 'lucide-react';
// live in a dense action area (a card's button row, a list-row's trailing
// controls) — the sibling of <InlineConfirmRow> for when there's no room for a
// full question row. The question, if any, is a short inline word ("Delete?").
+// Both buttons keep a 36px minimum height so the pair stays a usable touch
+// target on mobile even at this text-xs density.
//
// Tones pre-compose full Tailwind class names — the JIT scans for complete
// tokens, so `bg-port-${tone}/20` would NOT generate the utility. Spell it out.
// `error` for destructive confirms; `warning` for expensive-but-safe confirms
-// (e.g. unlocking a frozen walk set) where the action isn't destructive.
+// (e.g. unlocking a frozen walk set) where the action isn't destructive;
+// `success` for the positive commits that move a workflow forward but are still
+// worth confirming (approving a walk candidate, freezing a reference version).
const TONES = {
error: 'bg-port-error/20 text-port-error hover:bg-port-error/30',
warning: 'bg-port-warning/20 text-port-warning hover:bg-port-warning/30',
+ success: 'bg-port-success/20 text-port-success hover:bg-port-success/30',
};
export default function ConfirmButtonPair({
@@ -44,7 +49,7 @@ export default function ConfirmButtonPair({
type="button"
onClick={onConfirm}
disabled={busy}
- className={`inline-flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-50 ${confirmTone}`}
+ className={`inline-flex min-h-[36px] items-center gap-1 px-2 py-1 text-xs rounded transition-colors disabled:opacity-50 ${confirmTone}`}
>
{busy ? (
<Loader2 size={12} className="animate-spin" />
@@ -57,7 +62,7 @@ export default function ConfirmButtonPair({
type="button"
onClick={onCancel}
disabled={busy}
- className="px-2 py-1 text-xs text-gray-400 hover:text-white transition-colors disabled:opacity-50"
+ className="min-h-[36px] px-2 py-1 text-xs text-gray-400 hover:text-white transition-colors disabled:opacity-50"
>
{cancelText}
</button>
diff --git a/client/src/components/ui/ConfirmButtonPair.test.jsx b/client/src/components/ui/ConfirmButtonPair.test.jsx
index 08cf9aa1d8..7a0ebf1a00 100644
--- a/client/src/components/ui/ConfirmButtonPair.test.jsx
+++ b/client/src/components/ui/ConfirmButtonPair.test.jsx
@@ -14,6 +14,19 @@ describe('ConfirmButtonPair', () => {
expect(screen.queryByText('Delete?')).toBeNull();
});
+ it.each([
+ ['warning', 'bg-port-warning/20'],
+ ['success', 'bg-port-success/20'],
+ ])('applies the %s tone to the confirm button', (tone, expected) => {
+ render(<ConfirmButtonPair tone={tone} />);
+ expect(screen.getByRole('button', { name: 'Delete' }).className).toContain(expected);
+ });
+
+ it('falls back to the error tone for an unknown tone', () => {
+ render(<ConfirmButtonPair tone="nope" />);
+ expect(screen.getByRole('button', { name: 'Delete' }).className).toContain('bg-port-error/20');
+ });
+
it('renders a short inline prompt when supplied', () => {
render(<ConfirmButtonPair prompt="Delete?" />);
expect(screen.getByText('Delete?')).toBeTruthy();
diff --git a/client/src/lib/canvasRoll.js b/client/src/lib/canvasRoll.js
index 8a1d8c93b6..d4d2e48218 100644
--- a/client/src/lib/canvasRoll.js
+++ b/client/src/lib/canvasRoll.js
@@ -8,8 +8,11 @@ const LAYER_COLORS = ['#3b82f6', '#22c55e', '#f59e0b', '#ec4899', '#a855f7', '#0
export const layerColor = (index) => LAYER_COLORS[((index % LAYER_COLORS.length) + LAYER_COLORS.length) % LAYER_COLORS.length];
// Roll canvas background — a near-black intentionally darker than `--port-bg`
-// (#0f0f0f) so the note bars pop. Single source for the literal both rolls
-// (and their wrapper `bg-[#0c0c0e]` fallback) previously duplicated inline.
+// (#0f0f0f) so the note bars pop, and deliberately NOT theme-following: the
+// layer palette above is tuned for a near-black roll, so a day theme would wash
+// the bars out. Single source for the literal — the canvases paint it via
+// fillStyle and set the same value as their CSS background (which shows before
+// the first paint), so it must never be re-typed as a Tailwind arbitrary value.
export const ROLL_BG = '#0c0c0e';
const ACCENT_FALLBACK_RGB = '59 130 246'; // Classic Midnight --port-accent
diff --git a/client/src/pages/Ambient.jsx b/client/src/pages/Ambient.jsx
index 2fc11bdc65..865366895c 100644
--- a/client/src/pages/Ambient.jsx
+++ b/client/src/pages/Ambient.jsx
@@ -97,7 +97,10 @@ export default function Ambient() {
}, [data?.events]);
return (
- <div className={`fixed inset-0 bg-[#050505] text-white z-[9999] overflow-hidden flex flex-col ${idle ? 'cursor-none' : ''}`}>
+ // Ambient mode is a full-screen always-on display for a dim room, so it
+ // stays black rather than following the theme — every layer below is white
+ // text on black, and a day theme's light surface would leave it unreadable.
+ <div className={`fixed inset-0 bg-black text-white z-[9999] overflow-hidden flex flex-col ${idle ? 'cursor-none' : ''}`}>
<div className={`absolute top-4 left-4 right-4 flex justify-between items-center z-10 transition-opacity duration-500 ${
idle ? 'opacity-0 pointer-events-none' : 'opacity-100'
}`}>
diff --git a/client/src/pages/MusicVideo.jsx b/client/src/pages/MusicVideo.jsx
index 1e775e8ccd..78108acec9 100644
--- a/client/src/pages/MusicVideo.jsx
+++ b/client/src/pages/MusicVideo.jsx
@@ -1315,12 +1315,15 @@ export default function MusicVideo() {
</div>
{finalVideo.resolving && <p className="text-xs text-port-text-muted">Loading final video…</p>}
{finalVideo.src && (
+ // aspect-video reserves the box before the video's
+ // intrinsic dimensions resolve, so the actions above it
+ // don't jump — same as the scene thumbnails below.
<video
src={finalVideo.src}
controls
playsInline
preload="metadata"
- className="w-full max-h-[65vh] rounded bg-black border border-port-border"
+ className="w-full aspect-video max-h-[65vh] rounded bg-black border border-port-border"
aria-label="Play final music video"
/>
)}