Show the current choice, keyboard focus, and states apart
Phase 5-5. - The current radio row shows a check mark in the icon column and no fill (UI-051, replaces the radio rule of UI-003). The list of all tabs names pinned tabs in text. - Keyboard focus adds a 2-pixel ring inside menu rows. The global focus ring is 2 pixels with a 1-pixel offset. - Active toggles get the accent color, the selection fill, and a 2-pixel accent bar. Hover gets only a neutral fill. Enabled icon buttons use --rs-text. - Disabled controls use --rs-text-dim at full opacity, not opacity. - The file tree has one Tab stop. Up and Down move, Shift extends the selection, Right opens or enters a folder, Left closes it or goes to its parent, Home and End go to the ends, and typed letters find a row. - The three workbench splitters take focus. The arrow keys move them by 16 pixels, and Home and End go to their limits. - Help names Esc, then Tab, to leave the text. - 5 new catalog rows in French, Japanese, and Simplified Chinese. - Docs: UI-051, ui-design.md, and the user guide. Tests: the new layout/keyboardFocus. backgroundImages now expects the check mark on the current radio row.
This commit is contained in:
@@ -1104,6 +1104,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
// A splitter takes keyboard focus. The arrow keys move it by 16 pixels, and Home and End go to its limits.
|
||||
function splitterKey(event: KeyboardEvent, pane: "left" | "right" | "bottom") {
|
||||
const steps: Record<string, number> = pane === "bottom" ? { ArrowUp: 16, ArrowDown: -16 } : pane === "left" ? { ArrowRight: 16, ArrowLeft: -16 } : { ArrowLeft: 16, ArrowRight: -16 };
|
||||
const [min, max] = pane === "bottom" ? [80, Math.max(80, (centerStack?.getBoundingClientRect().height ?? 400) - 80)] : [160, 480];
|
||||
const current = pane === "left" ? leftWidth : pane === "right" ? rightWidth : bottomHeight;
|
||||
const next = event.key === "Home" ? min : event.key === "End" ? max : event.key in steps ? current + steps[event.key] : null;
|
||||
if (next === null) return;
|
||||
event.preventDefault();
|
||||
const value = Math.min(max, Math.max(min, next));
|
||||
if (pane === "left") leftWidth = value; else if (pane === "right") rightWidth = value; else bottomHeight = value;
|
||||
}
|
||||
|
||||
function updateSettings(next: AppSettings) {
|
||||
const saved = saveSettings(next);
|
||||
settings = { ...next };
|
||||
@@ -1266,10 +1278,18 @@
|
||||
onStatus={(message) => { status = message; error = null; }}
|
||||
/>
|
||||
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex, a11y_no_noninteractive_element_interactions (A focusable separator is the splitter pattern.) -->
|
||||
<div
|
||||
class="gutter gutter-v"
|
||||
role="separator"
|
||||
tabindex="0"
|
||||
aria-orientation="vertical"
|
||||
aria-label={$t("Resize the side pane")}
|
||||
aria-valuenow={leftWidth}
|
||||
aria-valuemin={160}
|
||||
aria-valuemax={480}
|
||||
onpointerdown={() => (dragging = "left")}
|
||||
onkeydown={(event) => splitterKey(event, "left")}
|
||||
></div>
|
||||
{/if}
|
||||
|
||||
@@ -1310,10 +1330,17 @@
|
||||
onOpenLink={(pane, kind, target) => void openLink(kind, target, pane.buffer?.relPath ?? "", pane.id)}
|
||||
/>
|
||||
{#if terminalContribution && terminalStarted}
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex, a11y_no_noninteractive_element_interactions (A focusable separator is the splitter pattern.) -->
|
||||
<div
|
||||
class="gutter gutter-h" class:terminal-hidden={!terminalOpen}
|
||||
role="separator"
|
||||
tabindex="0"
|
||||
aria-orientation="horizontal"
|
||||
aria-label={$t("Resize the terminal")}
|
||||
aria-valuenow={bottomHeight}
|
||||
aria-valuemin={80}
|
||||
onpointerdown={() => (dragging = "bottom")}
|
||||
onkeydown={(event) => splitterKey(event, "bottom")}
|
||||
></div>
|
||||
<section class="bottom" class:terminal-hidden={!terminalOpen}>
|
||||
{#if workspace}
|
||||
@@ -1331,10 +1358,18 @@
|
||||
</div>
|
||||
|
||||
{#if rightOpen && !transferredWindow}
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex, a11y_no_noninteractive_element_interactions (A focusable separator is the splitter pattern.) -->
|
||||
<div
|
||||
class="gutter gutter-v"
|
||||
role="separator"
|
||||
tabindex="0"
|
||||
aria-orientation="vertical"
|
||||
aria-label={$t("Resize the outline")}
|
||||
aria-valuenow={rightWidth}
|
||||
aria-valuemin={160}
|
||||
aria-valuemax={480}
|
||||
onpointerdown={() => (dragging = "right")}
|
||||
onkeydown={(event) => splitterKey(event, "right")}
|
||||
></div>
|
||||
<RightPane
|
||||
{outlineItems}
|
||||
|
||||
Reference in New Issue
Block a user