fix(app): add aria-labels to titlebar and sidebar buttons (#9843)
This commit is contained in:
@@ -89,12 +89,12 @@ export function Titlebar() {
|
|||||||
<Show when={mac()}>
|
<Show when={mac()}>
|
||||||
<div class="w-[72px] h-full shrink-0" data-tauri-drag-region />
|
<div class="w-[72px] h-full shrink-0" data-tauri-drag-region />
|
||||||
<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">
|
<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">
|
||||||
<IconButton icon="menu" variant="ghost" class="size-8 rounded-md" onClick={layout.mobileSidebar.toggle} />
|
<IconButton icon="menu" variant="ghost" class="size-8 rounded-md" onClick={layout.mobileSidebar.toggle} aria-label="Toggle menu" />
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
<Show when={!mac()}>
|
<Show when={!mac()}>
|
||||||
<div class="xl:hidden w-[48px] shrink-0 flex items-center justify-center">
|
<div class="xl:hidden w-[48px] shrink-0 flex items-center justify-center">
|
||||||
<IconButton icon="menu" variant="ghost" class="size-8 rounded-md" onClick={layout.mobileSidebar.toggle} />
|
<IconButton icon="menu" variant="ghost" class="size-8 rounded-md" onClick={layout.mobileSidebar.toggle} aria-label="Toggle menu" />
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
<TooltipKeybind
|
<TooltipKeybind
|
||||||
@@ -103,7 +103,13 @@ export function Titlebar() {
|
|||||||
title={language.t("command.sidebar.toggle")}
|
title={language.t("command.sidebar.toggle")}
|
||||||
keybind={command.keybind("sidebar.toggle")}
|
keybind={command.keybind("sidebar.toggle")}
|
||||||
>
|
>
|
||||||
<Button variant="ghost" class="group/sidebar-toggle size-6 p-0" onClick={layout.sidebar.toggle}>
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
class="group/sidebar-toggle size-6 p-0"
|
||||||
|
onClick={layout.sidebar.toggle}
|
||||||
|
aria-label="Toggle sidebar"
|
||||||
|
aria-expanded={layout.sidebar.opened()}
|
||||||
|
>
|
||||||
<div class="relative flex items-center justify-center size-4 [&>*]:absolute [&>*]:inset-0">
|
<div class="relative flex items-center justify-center size-4 [&>*]:absolute [&>*]:inset-0">
|
||||||
<Icon
|
<Icon
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -1573,7 +1573,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
keybind={command.keybind("session.archive")}
|
keybind={command.keybind("session.archive")}
|
||||||
gutter={8}
|
gutter={8}
|
||||||
>
|
>
|
||||||
<IconButton icon="archive" variant="ghost" onClick={() => archiveSession(props.session)} />
|
<IconButton icon="archive" variant="ghost" onClick={() => archiveSession(props.session)} aria-label="Archive session" />
|
||||||
</TooltipKeybind>
|
</TooltipKeybind>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1749,7 +1749,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
>
|
>
|
||||||
<DropdownMenu open={menuOpen()} onOpenChange={setMenuOpen}>
|
<DropdownMenu open={menuOpen()} onOpenChange={setMenuOpen}>
|
||||||
<Tooltip value={language.t("common.moreOptions")} placement="top">
|
<Tooltip value={language.t("common.moreOptions")} placement="top">
|
||||||
<DropdownMenu.Trigger as={IconButton} icon="dot-grid" variant="ghost" class="size-6 rounded-md" />
|
<DropdownMenu.Trigger as={IconButton} icon="dot-grid" variant="ghost" class="size-6 rounded-md" aria-label="More options" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<DropdownMenu.Portal>
|
<DropdownMenu.Portal>
|
||||||
<DropdownMenu.Content
|
<DropdownMenu.Content
|
||||||
@@ -1797,6 +1797,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="size-6 rounded-md"
|
class="size-6 rounded-md"
|
||||||
onClick={() => navigate(`/${slug()}/session`)}
|
onClick={() => navigate(`/${slug()}/session`)}
|
||||||
|
aria-label="New session"
|
||||||
/>
|
/>
|
||||||
</TooltipKeybind>
|
</TooltipKeybind>
|
||||||
</div>
|
</div>
|
||||||
@@ -1881,9 +1882,11 @@ export default function Layout(props: ParentProps) {
|
|||||||
.slice(0, 2)
|
.slice(0, 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const projectName = () => props.project.name || getFilename(props.project.worktree)
|
||||||
const trigger = (
|
const trigger = (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
aria-label={projectName()}
|
||||||
classList={{
|
classList={{
|
||||||
"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default": true,
|
"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default": true,
|
||||||
"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover": selected(),
|
"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover": selected(),
|
||||||
@@ -2103,7 +2106,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<IconButton icon="plus" variant="ghost" size="large" onClick={chooseProject} />
|
<IconButton icon="plus" variant="ghost" size="large" onClick={chooseProject} aria-label="Open project" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<DragOverlay>
|
<DragOverlay>
|
||||||
@@ -2117,7 +2120,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
title={language.t("sidebar.settings")}
|
title={language.t("sidebar.settings")}
|
||||||
keybind={command.keybind("settings.open")}
|
keybind={command.keybind("settings.open")}
|
||||||
>
|
>
|
||||||
<IconButton icon="settings-gear" variant="ghost" size="large" onClick={openSettings} />
|
<IconButton icon="settings-gear" variant="ghost" size="large" onClick={openSettings} aria-label="Settings" />
|
||||||
</TooltipKeybind>
|
</TooltipKeybind>
|
||||||
<Tooltip placement={sidebarProps.mobile ? "bottom" : "right"} value={language.t("sidebar.help")}>
|
<Tooltip placement={sidebarProps.mobile ? "bottom" : "right"} value={language.t("sidebar.help")}>
|
||||||
<IconButton
|
<IconButton
|
||||||
@@ -2125,6 +2128,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="large"
|
size="large"
|
||||||
onClick={() => platform.openLink("https://opencode.ai/desktop-feedback")}
|
onClick={() => platform.openLink("https://opencode.ai/desktop-feedback")}
|
||||||
|
aria-label="Help"
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
@@ -2175,6 +2179,7 @@ export default function Layout(props: ParentProps) {
|
|||||||
icon="dot-grid"
|
icon="dot-grid"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="shrink-0 size-6 rounded-md opacity-0 group-hover/project:opacity-100 data-[expanded]:opacity-100 data-[expanded]:bg-surface-base-active"
|
class="shrink-0 size-6 rounded-md opacity-0 group-hover/project:opacity-100 data-[expanded]:opacity-100 data-[expanded]:bg-surface-base-active"
|
||||||
|
aria-label="Project options"
|
||||||
/>
|
/>
|
||||||
<DropdownMenu.Portal>
|
<DropdownMenu.Portal>
|
||||||
<DropdownMenu.Content class="mt-1">
|
<DropdownMenu.Content class="mt-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user