GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(app): session screen accessibility improvements (#9907) · bewareoftheleopard/opencode@3435327

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • app/src
      • components
        • dialog-connect-provider.tsx
        • dialog-edit-project.tsx
        • dialog-select-model.tsx
        • dialog-select-server.tsx
        • prompt-input.tsx
        • session-context-usage.tsx
        • session
          • session-header.tsx
          • session-sortable-tab.tsx
          • session-sortable-terminal-tab.tsx
      • pages
        • layout.tsx
        • session.tsx
    • ui/src/components
      • dialog.tsx
      • image-preview.tsx
      • list.tsx
      • message-part.tsx
      • popover.tsx
      • session-turn.tsx
      • text-field.tsx
      • toast.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/app/src/components/dialog-connect-provider.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-connect-provider.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function DialogConnectProvider(props: { provider: string }) {
143143
}
144144

145145
return (
146-
<Dialog title={<IconButton tabIndex={-1} icon="arrow-left" variant="ghost" onClick={goBack} />}>
146+
<Dialog title={<IconButton tabIndex={-1} icon="arrow-left" variant="ghost" onClick={goBack} aria-label="Go back" />}>
147147
<div class="flex flex-col gap-6 px-2.5 pb-3">
148148
<div class="px-2.5 flex gap-4 items-center">
149149
<ProviderIcon id={props.provider as IconName} class="size-5 shrink-0 icon-strong-base" />
Collapse file

‎packages/app/src/components/dialog-edit-project.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-edit-project.tsx
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ export function DialogEditProject(props: { project: LocalProject }) {
193193
{(color) => (
194194
<button
195195
type="button"
196+
aria-label={`Select ${color} color`}
197+
aria-pressed={store.color === color}
196198
classList={{
197199
"flex items-center justify-center size-10 p-0.5 rounded-lg overflow-hidden transition-colors cursor-default": true,
198200
"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":
Collapse file

‎packages/app/src/components/dialog-select-model.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-select-model.tsx
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Popover as Kobalte } from "@kobalte/core/popover"
2-
import { Component, createMemo, createSignal, JSX, Show } from "solid-js"
2+
import { Component, ComponentProps, createMemo, createSignal, JSX, Show, ValidComponent } from "solid-js"
33
import { useLocal } from "@/context/local"
44
import { useDialog } from "@opencode-ai/ui/context/dialog"
55
import { popularProviders } from "@/hooks/use-providers"
@@ -86,10 +86,12 @@ const ModelList: Component<{
8686
)
8787
}
8888

89-
export const ModelSelectorPopover: Component<{
89+
export function ModelSelectorPopover<T extends ValidComponent = "div">(props: {
9090
provider?: string
91-
children: JSX.Element
92-
}> = (props) => {
91+
children?: JSX.Element
92+
triggerAs?: T
93+
triggerProps?: ComponentProps<T>
94+
}) {
9395
const [open, setOpen] = createSignal(false)
9496
const dialog = useDialog()
9597

@@ -101,7 +103,9 @@ export const ModelSelectorPopover: Component<{
101103

102104
return (
103105
<Kobalte open={open()} onOpenChange={setOpen} placement="top-start" gutter={8}>
104-
<Kobalte.Trigger as="div">{props.children}</Kobalte.Trigger>
106+
<Kobalte.Trigger as={props.triggerAs ?? "div"} {...(props.triggerProps as any)}>
107+
{props.children}
108+
</Kobalte.Trigger>
105109
<Kobalte.Portal>
106110
<Kobalte.Content class="w-72 h-80 flex flex-col rounded-md border border-border-base bg-surface-raised-stronger-non-alpha shadow-md z-50 outline-none overflow-hidden">
107111
<Kobalte.Title class="sr-only">{language.t("dialog.model.select.title")}</Kobalte.Title>
Collapse file

‎packages/app/src/components/dialog-select-server.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/dialog-select-server.tsx
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export function DialogSelectServer() {
158158
icon="circle-x"
159159
variant="ghost"
160160
class="bg-transparent transition-opacity shrink-0 hover:scale-110"
161+
aria-label="Remove server"
161162
onClick={(e) => {
162163
e.stopPropagation()
163164
handleRemove(i)
Collapse file

‎packages/app/src/components/prompt-input.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/prompt-input.tsx
+35-15Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
14871487
variant="ghost"
14881488
class="h-6 w-6"
14891489
onClick={() => prompt.context.removeActive()}
1490+
aria-label="Remove active file from context"
14901491
/>
14911492
</div>
14921493
)}
@@ -1524,6 +1525,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
15241525
variant="ghost"
15251526
class="h-6 w-6"
15261527
onClick={() => prompt.context.remove(item.key)}
1528+
aria-label="Remove file from context"
15271529
/>
15281530
</div>
15291531
)}
@@ -1556,6 +1558,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
15561558
type="button"
15571559
onClick={() => removeImageAttachment(attachment.id)}
15581560
class="absolute -top-1.5 -right-1.5 size-5 rounded-full bg-surface-raised-stronger-non-alpha border border-border-base flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity hover:bg-surface-raised-base-hover"
1561+
aria-label="Remove attachment"
15591562
>
15601563
<Icon name="close" class="size-3 text-text-weak" />
15611564
</button>
@@ -1574,6 +1577,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
15741577
editorRef = el
15751578
props.ref?.(el)
15761579
}}
1580+
role="textbox"
1581+
aria-multiline="true"
1582+
aria-label={
1583+
store.mode === "shell"
1584+
? language.t("prompt.placeholder.shell")
1585+
: language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) })
1586+
}
15771587
contenteditable="true"
15781588
onInput={handleInput}
15791589
onPaste={handlePaste}
@@ -1638,21 +1648,22 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
16381648
</TooltipKeybind>
16391649
}
16401650
>
1641-
<ModelSelectorPopover>
1642-
<TooltipKeybind
1643-
placement="top"
1644-
title={language.t("command.model.choose")}
1645-
keybind={command.keybind("model.choose")}
1651+
<TooltipKeybind
1652+
placement="top"
1653+
title={language.t("command.model.choose")}
1654+
keybind={command.keybind("model.choose")}
1655+
>
1656+
<ModelSelectorPopover
1657+
triggerAs={Button}
1658+
triggerProps={{ variant: "ghost" }}
16461659
>
1647-
<Button as="div" variant="ghost">
1648-
<Show when={local.model.current()?.provider?.id}>
1649-
<ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
1650-
</Show>
1651-
{local.model.current()?.name ?? language.t("dialog.model.select.title")}
1652-
<Icon name="chevron-down" size="small" />
1653-
</Button>
1654-
</TooltipKeybind>
1655-
</ModelSelectorPopover>
1660+
<Show when={local.model.current()?.provider?.id}>
1661+
<ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
1662+
</Show>
1663+
{local.model.current()?.name ?? language.t("dialog.model.select.title")}
1664+
<Icon name="chevron-down" size="small" />
1665+
</ModelSelectorPopover>
1666+
</TooltipKeybind>
16561667
</Show>
16571668
<Show when={local.model.variant.list().length > 0}>
16581669
<TooltipKeybind
@@ -1683,6 +1694,8 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
16831694
"text-text-base": !permission.isAutoAccepting(params.id!, sdk.directory),
16841695
"hover:bg-surface-success-base": permission.isAutoAccepting(params.id!, sdk.directory),
16851696
}}
1697+
aria-label="Toggle auto-accept permissions"
1698+
aria-pressed={permission.isAutoAccepting(params.id!, sdk.directory)}
16861699
>
16871700
<Icon
16881701
name="chevron-double-right"
@@ -1711,7 +1724,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
17111724
<SessionContextUsage />
17121725
<Show when={store.mode === "normal"}>
17131726
<Tooltip placement="top" value={language.t("prompt.action.attachFile")}>
1714-
<Button type="button" variant="ghost" class="size-6" onClick={() => fileInputRef.click()}>
1727+
<Button
1728+
type="button"
1729+
variant="ghost"
1730+
class="size-6"
1731+
onClick={() => fileInputRef.click()}
1732+
aria-label="Attach file"
1733+
>
17151734
<Icon name="photo" class="size-4.5" />
17161735
</Button>
17171736
</Tooltip>
@@ -1743,6 +1762,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
17431762
icon={working() ? "stop" : "arrow-up"}
17441763
variant="primary"
17451764
class="h-6 w-4.5"
1765+
aria-label={working() ? "Stop" : "Send message"}
17461766
/>
17471767
</Tooltip>
17481768
</div>
Collapse file

‎packages/app/src/components/session-context-usage.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/session-context-usage.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function SessionContextUsage(props: SessionContextUsageProps) {
9696
<Switch>
9797
<Match when={variant() === "indicator"}>{circle()}</Match>
9898
<Match when={true}>
99-
<Button type="button" variant="ghost" class="size-6" onClick={openContext}>
99+
<Button type="button" variant="ghost" class="size-6" onClick={openContext} aria-label="View context usage">
100100
{circle()}
101101
</Button>
102102
</Match>
Collapse file

‎packages/app/src/components/session/session-header.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/session/session-header.tsx
+28-27Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export function SessionHeader() {
135135
type="button"
136136
class="hidden md:flex w-[320px] p-1 pl-1.5 items-center gap-2 justify-between rounded-md border border-border-weak-base bg-surface-raised-base transition-colors cursor-default hover:bg-surface-raised-base-hover focus:bg-surface-raised-base-hover active:bg-surface-raised-base-active"
137137
onClick={() => command.trigger("file.open")}
138+
aria-label="Search files"
138139
>
139140
<div class="flex min-w-0 flex-1 items-center gap-2 overflow-visible">
140141
<Icon name="magnifying-glass" size="normal" class="icon-base shrink-0" />
@@ -184,6 +185,10 @@ export function SessionHeader() {
184185
variant="ghost"
185186
class="group/review-toggle size-6 p-0"
186187
onClick={() => view().reviewPanel.toggle()}
188+
aria-label="Toggle review panel"
189+
aria-expanded={view().reviewPanel.opened()}
190+
aria-controls="review-panel"
191+
tabIndex={showReview() ? 0 : -1}
187192
>
188193
<div class="relative flex items-center justify-center size-4 [&>*]:absolute [&>*]:inset-0">
189194
<Icon
@@ -214,6 +219,9 @@ export function SessionHeader() {
214219
variant="ghost"
215220
class="group/terminal-toggle size-6 p-0"
216221
onClick={() => view().terminal.toggle()}
222+
aria-label="Toggle terminal"
223+
aria-expanded={view().terminal.opened()}
224+
aria-controls="terminal-panel"
217225
>
218226
<div class="relative flex items-center justify-center size-4 [&>*]:absolute [&>*]:inset-0">
219227
<Icon
@@ -235,32 +243,23 @@ export function SessionHeader() {
235243
</Button>
236244
</TooltipKeybind>
237245
</div>
238-
<div
239-
class="flex items-center"
240-
classList={{
241-
"opacity-0 pointer-events-none": !showShare(),
242-
}}
243-
aria-hidden={!showShare()}
244-
>
245-
<Popover
246-
title={language.t("session.share.popover.title")}
247-
description={
248-
shareUrl()
249-
? language.t("session.share.popover.description.shared")
250-
: language.t("session.share.popover.description.unshared")
251-
}
252-
trigger={
253-
<Tooltip class="shrink-0" value={language.t("command.session.share")}>
254-
<Button
255-
variant="secondary"
256-
classList={{ "rounded-r-none": shareUrl() !== undefined }}
257-
style={{ scale: 1 }}
258-
>
259-
{language.t("session.share.action.share")}
260-
</Button>
261-
</Tooltip>
262-
}
263-
>
246+
<Show when={showShare()}>
247+
<div class="flex items-center">
248+
<Popover
249+
title={language.t("session.share.popover.title")}
250+
description={
251+
shareUrl()
252+
? language.t("session.share.popover.description.shared")
253+
: language.t("session.share.popover.description.unshared")
254+
}
255+
triggerAs={Button}
256+
triggerProps={{
257+
variant: "secondary",
258+
classList: { "rounded-r-none": shareUrl() !== undefined },
259+
style: { scale: 1 },
260+
}}
261+
trigger={language.t("session.share.action.share")}
262+
>
264263
<div class="flex flex-col gap-2">
265264
<Show
266265
when={shareUrl()}
@@ -322,10 +321,12 @@ export function SessionHeader() {
322321
class="rounded-l-none"
323322
onClick={copyLink}
324323
disabled={state.unshare}
324+
aria-label="Copy share link"
325325
/>
326326
</Tooltip>
327327
</Show>
328-
</div>
328+
</div>
329+
</Show>
329330
</div>
330331
</Portal>
331332
)}
Collapse file

‎packages/app/src/components/session/session-sortable-tab.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/session/session-sortable-tab.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function SortableTab(props: { tab: string; onTabClose: (tab: string) => v
3737
value={props.tab}
3838
closeButton={
3939
<Tooltip value={language.t("common.closeTab")} placement="bottom">
40-
<IconButton icon="close" variant="ghost" onClick={() => props.onTabClose(props.tab)} />
40+
<IconButton icon="close" variant="ghost" onClick={() => props.onTabClose(props.tab)} aria-label="Close tab" />
4141
</Tooltip>
4242
}
4343
hideCloseButton
Collapse file

‎packages/app/src/components/session/session-sortable-terminal-tab.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/session/session-sortable-terminal-tab.tsx
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export function SortableTerminalTab(props: { terminal: LocalPTY; onClose?: () =>
139139
e.stopPropagation()
140140
close()
141141
}}
142+
aria-label="Close terminal"
142143
/>
143144
}
144145
>
Collapse file

‎packages/app/src/pages/layout.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/layout.tsx
+7-4Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,7 @@ export default function Layout(props: ParentProps) {
19161916
"bg-surface-base-hover border border-border-weak-base": !selected() && open(),
19171917
}}
19181918
onClick={() => navigateToProject(props.project.worktree)}
1919+
onBlur={() => setOpen(false)}
19191920
>
19201921
<ProjectIcon project={props.project} notify />
19211922
</button>
@@ -2343,7 +2344,8 @@ export default function Layout(props: ParentProps) {
23432344
<div class="relative bg-background-base flex-1 min-h-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text">
23442345
<Titlebar />
23452346
<div class="flex-1 min-h-0 flex">
2346-
<div
2347+
<nav
2348+
aria-label="Projects and sessions"
23472349
classList={{
23482350
"hidden xl:block": true,
23492351
"relative shrink-0": true,
@@ -2364,7 +2366,7 @@ export default function Layout(props: ParentProps) {
23642366
onCollapse={layout.sidebar.close}
23652367
/>
23662368
</Show>
2367-
</div>
2369+
</nav>
23682370
<div class="xl:hidden">
23692371
<div
23702372
classList={{
@@ -2376,7 +2378,8 @@ export default function Layout(props: ParentProps) {
23762378
if (e.target === e.currentTarget) layout.mobileSidebar.hide()
23772379
}}
23782380
/>
2379-
<div
2381+
<nav
2382+
aria-label="Projects and sessions"
23802383
classList={{
23812384
"@container fixed top-10 bottom-0 left-0 z-50 w-72 bg-background-base transition-transform duration-200 ease-out": true,
23822385
"translate-x-0": layout.mobileSidebar.opened(),
@@ -2385,7 +2388,7 @@ export default function Layout(props: ParentProps) {
23852388
onClick={(e) => e.stopPropagation()}
23862389
>
23872390
<SidebarContent mobile />
2388-
</div>
2391+
</nav>
23892392
</div>
23902393

23912394
<main

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.