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

address review (claude): wrap multi-segment chord diagrams in the popover, drop anchors from the Space guard

[._.]/ Adam Eivyce8b24d94ab3
diff --git a/client/src/components/songbook/ChordDiagram.jsx b/client/src/components/songbook/ChordDiagram.jsx
index 636df77567..0835ef4d72 100644
--- a/client/src/components/songbook/ChordDiagram.jsx
+++ b/client/src/components/songbook/ChordDiagram.jsx
@@ -163,7 +163,9 @@ function ChordDiagram({ name, instrument, size = 'md' }) {
return <SingleChordDiagram name={parts[0] ?? name} instrument={instrument} size={size} />;
}
return (
- <span className="inline-flex items-start gap-2">
+ // flex-wrap: multi-segment renders live inside the fixed-width popover —
+ // segments stack instead of painting past its border (or offscreen).
+ <span className="inline-flex flex-wrap items-start gap-2">
{parts.map((part, i) => (
<span key={`${part}-${i}`} className="inline-flex flex-col items-center gap-0.5">
<span className="text-[9px] text-gray-500 font-mono leading-tight">{part}</span>
diff --git a/client/src/hooks/useKeyboardShortcuts.js b/client/src/hooks/useKeyboardShortcuts.js
index 3b4fa41d59..4e0630ad8c 100644
--- a/client/src/hooks/useKeyboardShortcuts.js
+++ b/client/src/hooks/useKeyboardShortcuts.js
@@ -40,13 +40,15 @@ export default function useKeyboardShortcuts(active, bindings, { ignoreRepeat =
if (e.metaKey || e.ctrlKey || e.altKey) return;
if (ignoreRepeat && e.repeat) return;
if (isEditableTarget(e.target)) return;
- // Space on a focused button/link must ACTIVATE it (standard browser
+ // Space on a focused button must ACTIVATE it (standard browser
// behavior) — a page-level ' ' binding would preventDefault the
// activation and fire the shortcut instead (e.g. toggling autoscroll
- // when the user meant to open a chord popover). Scoped to ' ' only:
- // letter/arrow shortcuts don't collide with button activation.
+ // when the user meant to open a chord popover). Scoped to ' ' and to
+ // button-like targets only: anchors do NOT activate on Space (Enter
+ // only), so exempting them would just make Space dead on a focused
+ // link; letter/arrow shortcuts don't collide with activation at all.
if (e.key === ' ' && typeof e.target?.closest === 'function'
- && e.target.closest('button, a, [role="button"]')) return;
+ && e.target.closest('button, [role="button"]')) return;
if (!enabledInDialog && document.querySelector('[aria-modal="true"]')) return;
const handler = bindingsRef.current[e.key];
if (typeof handler !== 'function') return;
diff --git a/client/src/hooks/useKeyboardShortcuts.test.jsx b/client/src/hooks/useKeyboardShortcuts.test.jsx
index f4b3c7c4d8..d66d92c504 100644
--- a/client/src/hooks/useKeyboardShortcuts.test.jsx
+++ b/client/src/hooks/useKeyboardShortcuts.test.jsx
@@ -113,9 +113,17 @@ describe('useKeyboardShortcuts', () => {
press('g', { target: btn });
expect(g).toHaveBeenCalledTimes(1);
btn.remove();
+ // Anchors do NOT activate on Space (Enter only) — a focused link must
+ // still drive the page shortcut, not leave Space dead.
+ const link = document.createElement('a');
+ link.href = '#x';
+ document.body.appendChild(link);
+ press(' ', { target: link });
+ expect(space).toHaveBeenCalledTimes(1);
+ link.remove();
// Space from a non-interactive target still drives the page shortcut.
press(' ');
- expect(space).toHaveBeenCalledTimes(1);
+ expect(space).toHaveBeenCalledTimes(2);
});
it('suppresses shortcuts while an aria-modal dialog is open (page card stays behind it)', () => {