summaryrefslogtreecommitdiffhomepage
path: root/packages/app/src/components/prompt-input.tsx
diff options
context:
space:
mode:
authorNolan Darilek <[email protected]>2026-01-22 05:10:53 -0600
committerGitHub <[email protected]>2026-01-22 05:10:53 -0600
commit3435327bc074a7ba8c3fe8939c97de54bbdefd65 (patch)
treed906b07c16e8e90808e5f78b72f72e8737f53eeb /packages/app/src/components/prompt-input.tsx
parent8a043edfd5a504421301cc183eedf4ecdb4c57b0 (diff)
downloadopencode-3435327bc074a7ba8c3fe8939c97de54bbdefd65.tar.gz
opencode-3435327bc074a7ba8c3fe8939c97de54bbdefd65.zip
fix(app): session screen accessibility improvements (#9907)
Diffstat (limited to 'packages/app/src/components/prompt-input.tsx')
-rw-r--r--packages/app/src/components/prompt-input.tsx50
1 files changed, 35 insertions, 15 deletions
diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx
index 3bd7856ee..825f2b116 100644
--- a/packages/app/src/components/prompt-input.tsx
+++ b/packages/app/src/components/prompt-input.tsx
@@ -1487,6 +1487,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
variant="ghost"
class="h-6 w-6"
onClick={() => prompt.context.removeActive()}
+ aria-label="Remove active file from context"
/>
</div>
)}
@@ -1524,6 +1525,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
variant="ghost"
class="h-6 w-6"
onClick={() => prompt.context.remove(item.key)}
+ aria-label="Remove file from context"
/>
</div>
)}
@@ -1556,6 +1558,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
type="button"
onClick={() => removeImageAttachment(attachment.id)}
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"
+ aria-label="Remove attachment"
>
<Icon name="close" class="size-3 text-text-weak" />
</button>
@@ -1574,6 +1577,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
editorRef = el
props.ref?.(el)
}}
+ role="textbox"
+ aria-multiline="true"
+ aria-label={
+ store.mode === "shell"
+ ? language.t("prompt.placeholder.shell")
+ : language.t("prompt.placeholder.normal", { example: language.t(EXAMPLES[store.placeholder]) })
+ }
contenteditable="true"
onInput={handleInput}
onPaste={handlePaste}
@@ -1638,21 +1648,22 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
</TooltipKeybind>
}
>
- <ModelSelectorPopover>
- <TooltipKeybind
- placement="top"
- title={language.t("command.model.choose")}
- keybind={command.keybind("model.choose")}
+ <TooltipKeybind
+ placement="top"
+ title={language.t("command.model.choose")}
+ keybind={command.keybind("model.choose")}
+ >
+ <ModelSelectorPopover
+ triggerAs={Button}
+ triggerProps={{ variant: "ghost" }}
>
- <Button as="div" variant="ghost">
- <Show when={local.model.current()?.provider?.id}>
- <ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
- </Show>
- {local.model.current()?.name ?? language.t("dialog.model.select.title")}
- <Icon name="chevron-down" size="small" />
- </Button>
- </TooltipKeybind>
- </ModelSelectorPopover>
+ <Show when={local.model.current()?.provider?.id}>
+ <ProviderIcon id={local.model.current()!.provider.id as IconName} class="size-4 shrink-0" />
+ </Show>
+ {local.model.current()?.name ?? language.t("dialog.model.select.title")}
+ <Icon name="chevron-down" size="small" />
+ </ModelSelectorPopover>
+ </TooltipKeybind>
</Show>
<Show when={local.model.variant.list().length > 0}>
<TooltipKeybind
@@ -1683,6 +1694,8 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
"text-text-base": !permission.isAutoAccepting(params.id!, sdk.directory),
"hover:bg-surface-success-base": permission.isAutoAccepting(params.id!, sdk.directory),
}}
+ aria-label="Toggle auto-accept permissions"
+ aria-pressed={permission.isAutoAccepting(params.id!, sdk.directory)}
>
<Icon
name="chevron-double-right"
@@ -1711,7 +1724,13 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
<SessionContextUsage />
<Show when={store.mode === "normal"}>
<Tooltip placement="top" value={language.t("prompt.action.attachFile")}>
- <Button type="button" variant="ghost" class="size-6" onClick={() => fileInputRef.click()}>
+ <Button
+ type="button"
+ variant="ghost"
+ class="size-6"
+ onClick={() => fileInputRef.click()}
+ aria-label="Attach file"
+ >
<Icon name="photo" class="size-4.5" />
</Button>
</Tooltip>
@@ -1743,6 +1762,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
icon={working() ? "stop" : "arrow-up"}
variant="primary"
class="h-6 w-4.5"
+ aria-label={working() ? "Stop" : "Send message"}
/>
</Tooltip>
</div>