From cd0207b224ba278fa23ea0e6669a8dc614731f4d Mon Sep 17 00:00:00 2001 From: Molecule AI Core-UIUX Date: Sun, 10 May 2026 17:14:24 +0000 Subject: [PATCH] fix(canvas): add focus-visible rings across 6 more files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WCAG 2.4.7 — Focus Visible. PricingTable: CTA button now has focus-visible ring. MissingKeysModal: Save, Open Settings, Cancel Deploy, Deploy buttons. FilesToolbar: New, Upload, Export, Clear, Refresh buttons. FileTreeContextMenu: menuitem buttons — replaced focus:bg with focus-visible:ring-2 (proper keyboard-only visible ring). AgentCommsPanel: Restart and Open peer buttons. settings-panel.css: secret-row cancel/save, add-key-form cancel/save all gain focus-visible ring. Co-Authored-By: Claude Opus 4.7 --- canvas/src/components/MissingKeysModal.tsx | 8 ++++---- canvas/src/components/PricingTable.tsx | 2 +- .../tabs/FilesTab/FileTreeContextMenu.tsx | 4 ++-- .../components/tabs/FilesTab/FilesToolbar.tsx | 10 +++++----- .../components/tabs/chat/AgentCommsPanel.tsx | 4 ++-- canvas/src/styles/settings-panel.css | 20 +++++++++++++++++++ 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/canvas/src/components/MissingKeysModal.tsx b/canvas/src/components/MissingKeysModal.tsx index 80231043..c9dbc90d 100644 --- a/canvas/src/components/MissingKeysModal.tsx +++ b/canvas/src/components/MissingKeysModal.tsx @@ -706,7 +706,7 @@ function AllKeysModal({ type="button" onClick={() => handleSaveKey(index)} disabled={!entry.value.trim() || entry.saving} - className="px-3 py-1.5 bg-accent-strong hover:bg-accent text-[11px] rounded text-white disabled:opacity-30 transition-colors shrink-0" + className="px-3 py-1.5 bg-accent-strong hover:bg-accent text-[11px] rounded text-white disabled:opacity-30 transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1" > {entry.saving ? "..." : "Save"} @@ -730,7 +730,7 @@ function AllKeysModal({ @@ -740,7 +740,7 @@ function AllKeysModal({ @@ -748,7 +748,7 @@ function AllKeysModal({ type="button" onClick={handleAddKeysAndDeploy} disabled={!allSaved || anySaving} - className="px-3.5 py-1.5 text-[12px] bg-accent-strong hover:bg-accent text-white rounded-lg transition-colors disabled:opacity-40" + className="px-3.5 py-1.5 text-[12px] bg-accent-strong hover:bg-accent text-white rounded-lg transition-colors disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1" > {anySaving ? "Saving..." : allSaved ? "Deploy" : "Add Keys"} diff --git a/canvas/src/components/PricingTable.tsx b/canvas/src/components/PricingTable.tsx index cfcfad35..5f3bc210 100644 --- a/canvas/src/components/PricingTable.tsx +++ b/canvas/src/components/PricingTable.tsx @@ -128,7 +128,7 @@ function PlanCard({ type="button" onClick={onSelect} disabled={loading} - className={`mt-6 rounded-lg px-4 py-3 text-sm font-medium ${ + className={`mt-6 rounded-lg px-4 py-3 text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-surface ${ plan.highlighted ? "bg-accent-strong text-white hover:bg-accent disabled:bg-zinc-700 disabled:text-zinc-500" : "border border-line bg-surface-sunken text-ink hover:bg-surface-card disabled:opacity-50" diff --git a/canvas/src/components/tabs/FilesTab/FileTreeContextMenu.tsx b/canvas/src/components/tabs/FilesTab/FileTreeContextMenu.tsx index 76704959..052ac52e 100644 --- a/canvas/src/components/tabs/FilesTab/FileTreeContextMenu.tsx +++ b/canvas/src/components/tabs/FilesTab/FileTreeContextMenu.tsx @@ -128,8 +128,8 @@ export function FileTreeContextMenu({ x, y, items, onClose }: Props) { }} className={ item.destructive - ? "w-full text-left px-3 py-1 text-bad hover:bg-red-900/30 focus:bg-red-900/30 focus:outline-none disabled:opacity-40 disabled:pointer-events-none transition-colors" - : "w-full text-left px-3 py-1 text-ink-mid hover:bg-surface-card hover:text-ink focus:bg-surface-card focus:text-ink focus:outline-none disabled:opacity-40 disabled:pointer-events-none transition-colors" + ? "w-full text-left px-3 py-1 text-bad hover:bg-red-900/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-1 disabled:opacity-40 disabled:pointer-events-none transition-colors" + : "w-full text-left px-3 py-1 text-ink-mid hover:bg-surface-card hover:text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 disabled:opacity-40 disabled:pointer-events-none transition-colors" } > {item.icon && {item.icon}} diff --git a/canvas/src/components/tabs/FilesTab/FilesToolbar.tsx b/canvas/src/components/tabs/FilesTab/FilesToolbar.tsx index 492f571b..8b567e41 100644 --- a/canvas/src/components/tabs/FilesTab/FilesToolbar.tsx +++ b/canvas/src/components/tabs/FilesTab/FilesToolbar.tsx @@ -44,7 +44,7 @@ export function FilesToolbar({
{root === "/configs" && ( <> - e.target.files && onUpload(e.target.files)} /> - )} - {root === "/configs" && ( - )} -
diff --git a/canvas/src/components/tabs/chat/AgentCommsPanel.tsx b/canvas/src/components/tabs/chat/AgentCommsPanel.tsx index 2c8b2858..b44ae1c0 100644 --- a/canvas/src/components/tabs/chat/AgentCommsPanel.tsx +++ b/canvas/src/components/tabs/chat/AgentCommsPanel.tsx @@ -827,14 +827,14 @@ function ErrorMessage({ msg }: { msg: CommMessage }) { type="button" onClick={handleRestart} disabled={restarting} - className="px-2 py-0.5 rounded bg-red-900/50 hover:bg-red-800/60 border border-red-700/40 text-[10px] text-red-200 disabled:opacity-50 transition-colors" + className="px-2 py-0.5 rounded bg-red-900/50 hover:bg-red-800/60 border border-red-700/40 text-[10px] text-red-200 disabled:opacity-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-1" > {restarting ? "Restarting…" : `Restart ${msg.peerName}`} diff --git a/canvas/src/styles/settings-panel.css b/canvas/src/styles/settings-panel.css index 29838267..7a24bae2 100644 --- a/canvas/src/styles/settings-panel.css +++ b/canvas/src/styles/settings-panel.css @@ -276,6 +276,11 @@ cursor: pointer; } +.secret-row__cancel-btn:focus-visible { + outline: var(--focus-ring); + outline-offset: var(--focus-ring-offset); +} + .secret-row__save-btn { background: #2563eb; color: #ffffff; @@ -286,6 +291,11 @@ cursor: pointer; } +.secret-row__save-btn:focus-visible { + outline: var(--focus-ring); + outline-offset: var(--focus-ring-offset); +} + .secret-row__save-btn:disabled { opacity: 0.4; cursor: not-allowed; } /* ── Add key form ──────────────────────────────────── */ @@ -354,6 +364,11 @@ cursor: pointer; } +.add-key-form__cancel-btn:focus-visible { + outline: var(--focus-ring); + outline-offset: var(--focus-ring-offset); +} + .add-key-form__save-btn { background: #2563eb; color: #ffffff; @@ -364,6 +379,11 @@ cursor: pointer; } +.add-key-form__save-btn:focus-visible { + outline: var(--focus-ring); + outline-offset: var(--focus-ring-offset); +} + .add-key-form__save-btn:disabled { opacity: 0.4; cursor: not-allowed; } .secrets-tab__add-btn {