| ... | ... | @@ -136,10 +136,11 @@ export function DraftHeroHeadline({ |
| 136 | 136 | <Tooltip> |
| 137 | 137 | <TooltipTrigger |
| 138 | 138 | render={ |
| 139 | | <MenuTrigger |
| 140 | | aria-label={hasResolvedProject ? "Change project" : "Choose a project"} |
| 141 | | className="pointer-events-auto inline-block max-w-64 truncate border-foreground/60 border-b border-dotted align-baseline text-foreground transition-colors hover:border-foreground/80 focus-visible:rounded-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring" |
| 142 | | /> |
| 139 | // The trigger's accessible name comes from its visible text (the |
| 140 | // project title) so the hero sentence reads naturally: an |
| 141 | // aria-label here would replace the title with an action phrase |
| 142 | // mid-sentence and baffle screen-reader users. |
| 143 | <MenuTrigger className="pointer-events-auto inline-block max-w-64 truncate border-foreground/60 border-b border-dotted align-baseline text-foreground transition-colors hover:border-foreground/80 focus-visible:rounded-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring" /> |
| 143 | 144 | } |
| 144 | 145 | > |
| 145 | 146 | {activeProjectDisplayName ?? "Choose a project"} |
| ... | ... | @@ -233,8 +234,21 @@ export function DraftHeroHeadline({ |
| 233 | 234 | </button> |
| 234 | 235 | ); |
| 235 | 236 | |
| 237 | // The composer hero is a sentence, so the heading's accessible name must be |
| 238 | // a complete sentence too. The project picker is a control rendered inline |
| 239 | // in the h1; without an explicit label its widget state bleeds into the |
| 240 | // announced phrase. |
| 241 | const headingLabel = hasResolvedProject |
| 242 | ? `What should we build in ${activeProjectDisplayName}?` |
| 243 | : canChooseProject |
| 244 | ? `${activeProjectDisplayName ?? "Choose a project"} to start` |
| 245 | : "Add a project to start"; |
| 246 | |
| 236 | 247 | return ( |
| 237 | | <h1 className="mx-auto w-full max-w-5xl text-center font-normal text-2xl text-foreground tracking-tight sm:text-3xl"> |
| 248 | <h1 |
| 249 | aria-label={headingLabel} |
| 250 | className="mx-auto w-full max-w-5xl text-center font-normal text-2xl text-foreground tracking-tight sm:text-3xl" |
| 251 | > |
| 238 | 252 | {hasResolvedProject ? ( |
| 239 | 253 | <>What should we build in {projectSelector}?</> |
| 240 | 254 | ) : canChooseProject ? ( |