Show the view control with icons only

- Write, Source, Read, and Split show icons only, at every width.
- Each control keeps its accessible name and a tooltip with its shortcut.
- UI-056 records the rule. It replaces the names of UI-049.
This commit is contained in:
Knotty Wyvern
2026-10-29 16:28:25 -07:00
parent 8c43f598fb
commit 115c32fa92
4 changed files with 27 additions and 18 deletions
+7 -13
View File
@@ -55,13 +55,13 @@
tabindex={option.value === view ? 0 : -1}
use:tooltip={`${option.label} (${option.shortcut})`}
onclick={() => onView(option.value)} onkeydown={event => keydown(event, index)}>
<Icon icon={option.icon} /><span class="label" aria-hidden="true">{option.label}</span>
<Icon icon={option.icon} />
</button>
{/each}
</div>
{#if readable}
<button type="button" class="split" aria-pressed={split} aria-label={$t("Split")} use:tooltip={$t("Split: Read beside the editor")} onclick={() => onSplit(!split)}>
<Icon icon="split" /><span class="label" aria-hidden="true">{$t("Split")}</span>
<Icon icon="split" />
</button>
{/if}
@@ -79,16 +79,14 @@
display: inline-flex;
flex: 0 0 auto;
align-items: center;
gap: 6px;
justify-content: center;
height: 26px;
min-width: 28px;
padding: 0 8px;
width: 28px;
padding: 0;
border: 0;
border-radius: var(--rs-control-radius);
background: transparent;
color: var(--rs-text-dim);
font: 12px var(--rs-font-ui);
white-space: nowrap;
}
button :global(svg) { width: 16px; height: 16px; flex-shrink: 0; }
@@ -101,10 +99,6 @@
box-shadow: inset 0 -2px 0 var(--rs-accent);
}
.split { height: 32px; border: 1px solid var(--rs-border); }
@container (max-width: 560px) {
.label { display: none; }
button { padding: 0 6px; }
}
/* The controls show icons only (UI-056). The name and the shortcut are in the tooltip and the accessible name. */
.split { width: 32px; height: 32px; border: 1px solid var(--rs-border); }
</style>