Repository navigation
Commit c0d6406
fix(app-shell): the inbox bell names its unread count, and the console sidebar is a navigation landmark (#32372)
<!-- claude-projects-attribution: {"github_login":"huangyiirene"} -->
_Requested by **Irene** · [project
thread](https://claude.ai/code/project/chan_01TJXtQ1tVD26ecLDZxFS67x?thread=cmsg_01TJXtQ1tVD26ecLDZxFS67xSXoaF6hSeT7sjxcA7Ccxox)_
Fixes #32159
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:控制台右上角通知铃铛的无障碍名称从固定的 "Open inbox" 改为带数量的 "Notifications, 3
unread topics"(有待审批时再加 ", 1 pending approval");侧边栏导航包进一个 `nav` 地标 "App
navigation"。界面外观不变。
- **为什么改**:读屏用户以前听不到铃铛上的未读数,也无法按地标跳到侧边栏。卡片另外两条(分组折叠按钮、手机侧栏按钮无名称)在 `main`
上实测已满足,只加保护性测试,未改代码(席位更正记录 6775284999)。
- **风险与回滚**:低。只动 `InboxPopover.tsx` 的 `aria-label` 与
`UnifiedSidebar.tsx` 的一个 `div`→`nav`;不新增翻译键(`en` 包 0 字节)。按名字 "Open
inbox" 找铃铛的外部脚本需改用 "Notifications"。回滚即 revert。
- **先看**:`ui/packages/app-shell/src/layout/InboxPopover.tsx`(`ariaLabel`
的拼法)、`ui/packages/app-shell/src/layout/UnifiedSidebar.tsx`(`nav`
包裹位置)、`ui/packages/app-shell/src/layout/__tests__/LocalizedSidebarTrigger.appBar-12429.test.tsx`(新地标与手机抽屉
pin)。
- **两分钟验证**:打开控制台任一应用页,用浏览器无障碍面板看铃铛,名称应为 "Notifications, N unread
topics…";侧栏应是一个名为 "App navigation" 的 navigation 地标。
- **需要你做的**:无,席位评审后落地。
## What changes
- **Inbox bell (`InboxPopover`).** The accessible name was
`sidebar.inboxAriaLabel` ("Open inbox") whatever the badge said. The
badge is content inside a button that has an `aria-label`, so the count
was never part of the announced name. The name is now
`sidebar.notifications` ("Notifications") followed by each non-zero
addend of the badge, in the plural forms the popover's own breakdown
line already uses (`notifications.badgeNotifications` /
`notifications.badgeApprovals`, `_one` / `_other`): "Notifications, 3
unread topics", "Notifications, 1 unread topic", "Notifications, 3
unread topics, 1 pending approval"; "Notifications" alone with nothing
waiting. The header bell and the `global:notifications` page block draw
this same control, so both change. The visible badge and the "Inbox"
tooltip are unchanged.
- **Sidebar landmark (`UnifiedSidebar`).** The `div` wrapping the
sidebar's content slot is now `nav aria-label="App navigation"`
(`console.nav.menuLabel`, the label the `nav-menu` page block already
uses). The `Sidebar` primitive is Shadcn-synced and draws a plain `div`
on desktop and a dialog on a phone, so the landmark rides inside its
content slot and reaches the drawer too. One landmark per open view: the
desktop sidebar, or the phone drawer once it opens (the closed drawer is
not drawn). Nothing nests it.
- **No new strings.** `ui/packages/i18n/src/locales/en.ts` is untouched:
+0 bytes. Every key used is already in every pack.
- **Already met on `main` (no code change, pinned):** the nav-group
disclosures are named by their group label and carry `aria-expanded`
(`ui/packages/layout` untouched), and the sidebar trigger is "Toggle
sidebar" with `aria-expanded` at every width. Premise correction
recorded on the card as comment 6775284999.
## Tests
All role-based (`getByRole('button', { name })`,
`getByRole('navigation')`), driven through real clicks where state
changes.
- `InboxPopover.badgePlural-13133.test.tsx` (real i18next + shipped `en`
pack), new `describe`: the bell's name with a count of 3 ("…, 3 unread
topics"), of 1 ("…, 1 unread topic"), with approvals beside topics, and
PRESERVATION with nothing waiting ("Notifications").
- `LocalizedSidebarTrigger.appBar-12429.test.tsx` (real `UnifiedSidebar`
+ real trigger), new `describe`: desktop has exactly one `navigation`
named "App navigation" holding the entries and no nested `nav`; at 375
px the trigger `{ name: 'Toggle sidebar', expanded: false }` is clicked,
the drawer then holds exactly one landmark, and the trigger reports
`expanded: true`.
- `UnifiedSidebar.groupDefaultOpen-13336.test.tsx`, new `describe`: a
collapsed group is `{ name: 'Advanced', expanded: false }` (its count
badge stays out of the name); clicking flips `expanded` under the same
name; both disclosures sit inside the landmark.
- Three existing files found the bell by the old name and now find it by
`/^Notifications(,|$)/`: `InboxPopover.openingTab-11698`,
`InboxPopover.phoneWidth-29076`, `global-page-blocks.render` (two
sites). No assertion was removed.
<details><summary>Ablations (each mutation landed on disk via
<code>scripts/ablation-replace.mjs</code>, run, then restored; <code>git
diff HEAD</code> empty after each)</summary>
| Mutation | Result |
|:--|:--|
| bell: drop the unread-topics addend (`...(unreadTopics > 0` →
`...(false`) | 3 count pins fail; the 3 breakdown pins and the
zero-count preservation pin stay green |
| landmark: `nav` → `nav role="presentation"` | 3 landmark pins fail
(desktop, phone drawer, group-in-landmark); 10 pass |
| group name: trigger text `{groupLabel}` → `{null}`
(`ui/packages/layout`, never committed) | all 6 tests in the group file
fail, the 3 new ones included |
| group state: `aria-expanded={undefined}` on the trigger (never
committed) | all 6 fail |
| toggle name: `const label = ''` in `LocalizedSidebarTrigger` | 5 of 7
fail, the new phone landmark pin included |
</details>
## Acceptance notes
- The bell names the badge's two addends separately rather than "3
unread": the badge sums unread topics and pending approvals, and
approvals are not "unread". The parts are joined with ", ", fixed in
code, so no new key reaches the eager `en` pack.
- The phone drawer's header (app name and "All apps") sits above the
content slot, outside the landmark. It names the app and leads out of
it; the landmark holds the app's navigation entries.
## Verification
Measured in Chromium (Playwright `ariaSnapshot` + `getByRole`) against
showcase `objectstack dev --fresh` and the console served by Vite from
this tree's `ui/` source.
| Reading | `main` `60b99f8f` | this branch |
|:--|:--|:--|
| bell | `button "Open inbox": "4"` | `button "Notifications, 1 unread
topic, 3 pending approvals": "4"` |
| `getByRole('navigation')`, desktop task list | 0 | 1, `navigation "App
navigation"` |
| phone 390 px, drawer open | 0 | 1; `nav nav` = 0; closed drawer 0 |
| group disclosures | `button "Workspace" [expanded]`, … | unchanged |
| sidebar trigger | `button "Toggle sidebar" [expanded]` | unchanged |
| buttons with an empty name (task list, app landing, drawer) | 0 | 0 |
<details><summary>Local gates on head <code>48dc405d</code> (full
record: seat project files
<code>card-32159/gates-48dc405d.txt</code>)</summary>
- `dispatch-gates --commands` derived list: 36 of 36 exit 0 (34 on the
first merge head `24389682`, plus `pnpm --dir ui exec vitest run
scripts/` and `pnpm check:type-check-debt` there). The second merge of
`origin/main` touched none of this PR's files; the 6 touched test files
were re-run on `48dc405d`: 43 / 43 pass.
- Not derived, ordered: `check-sdui-manifest` 0, `ui check:spec-symbols`
0, `ui check:new-line-citations` 0 (0 new citations).
- `@object-ui/app-shell type-check` 0.
- App-shell tests NARROWED: 284 files (all of `layout/__tests__` plus
every `ui` test importing `InboxPopover`, `UnifiedSidebar`, `AppHeader`,
`ConsoleLayout`, the `global:notifications` renderer or `useInboxBell`),
2,594 tests pass. The full 2,227-file suite did not finish in 60 min on
this container; CI Test UI runs it.
- NOT MEASURED locally: `ui check:eager-closure` (no console build).
This diff changes no locale pack: `en.ts` +0 bytes.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01J8VVAnRYaNVchvKwzetwxo)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 91d88ec commit c0d6406
9 files changed
Lines changed: 139 additions & 8 deletions
File tree
- .changeset
- ui/packages/app-shell/src
- layout
- __tests__
- views/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
601 | | - | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
602 | 609 | | |
603 | 610 | | |
604 | 611 | | |
| |||
800 | 807 | | |
801 | 808 | | |
802 | 809 | | |
803 | | - | |
| 810 | + | |
804 | 811 | | |
805 | 812 | | |
806 | 813 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
0 commit comments