Skip to content

Commit 061b3a9

Browse files
fix(web): new project publish option tells screen readers whether it is on
Command palette rows had no way to carry a checked state, so the Create private repository toggle only showed its state through an aria-hidden checkbox. Action items now take an optional checked flag that the row renders as aria-checked, and the publish toggle sets it. Fixes #36082 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 92ec153 commit 061b3a9

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎apps/web/src/components/CommandPalette.logic.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ export interface CommandPaletteActionItem extends CommandPaletteItem {
213213
readonly run: () => Promise<void>;
214214
/** A pin toggle on the row, also reached with the pin shortcut while the row is highlighted. */
215215
readonly pin?: CommandPaletteItemPin;
216+
/** Set on toggle rows; exposed to assistive technology as `aria-checked`. */
217+
readonly checked?: boolean;
216218
}
217219

218220
export interface CommandPaletteItemPin {

‎apps/web/src/components/CommandPalette.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2427,6 +2427,7 @@ function OpenCommandPaletteDialog(props: {
24272427
),
24282428
...(isCreatingNewProject ? { disabled: true } : {}),
24292429
keepOpen: true,
2430+
checked: newProjectPublishes,
24302431
run: async () => {
24312432
setNewProjectPublishes((publishes) => !publishes);
24322433
},

‎apps/web/src/components/CommandPaletteResults.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ function CommandPaletteResultRow(props: {
250250
{...(props.index === undefined ? {} : { index: props.index })}
251251
value={props.item.value}
252252
active={props.isActive}
253+
{...(props.item.kind === "action" && props.item.checked !== undefined
254+
? { "aria-checked": props.item.checked }
255+
: {})}
253256
onPointerDown={(event) => {
254257
if (props.item.threadRef) {
255258
startPaletteThreadDrag(

0 commit comments

Comments
 (0)