Repository navigation
Commit 04148ac
fix(app-shell): show the position's description in the Setup → Positions list (#26100)
Fixes #25909
Clause-②: no
Metadata-protocol: none
## What
Setup → Positions now has a **Description** column. The position list in
`ui/packages/app-shell/src/services/builtinComponents.tsx` declared only
Name, Label, Holders and Permission sets, so a position's `description`,
which `GET /meta/position` already serves, was never shown. The column
is `{ key: 'description', label: 'Description' }`, placed right after
Label, with no width (it takes the remaining width, like the
permission-set list's Description column) and no custom render. The
header localizes through the existing `engine.list.col.description` key
(en "Description", zh "描述"). A position with no description renders the
shared empty cell (`defaultCell` gives `EmptyValue`, an em dash).
The text is the served one. The server overlays
`positions.NAME.description` from the translation bundle onto every
served position document (`translatePosition`,
`packages/spec/src/system/i18n-resolver.ts`), so a translated
description shows translated, like the label. The console adds no lookup
of its own.
## Tests (head `7a62f956`)
`ResourceListPage.positionGrants-25333.test.tsx` gives `sales_manager` a
description and leaves `support_agent` and `auditor` without one. The
new case asserts:
- the localized Description header, with Label right before it and
Holders right after it;
- the served text in `sales_manager`'s Description cell;
- the shared empty cell (`data-slot="empty-value"`, text exactly the em
dash) for the two positions without one.
Red first: the test commit `18603827` ran against the unchanged column
list and failed with `Unable to find role="columnheader" and name
"Description"` (Tests 1 failed, 5 passed). With the fix (`7a62f956`):
Test Files 1 passed, Tests 6 passed.
- `cd ui && pnpm exec vitest run --maxWorkers=2` over the 17 app-shell
test files that import `builtinComponents` or render a ResourceListPage
with positions: Test Files 17 passed, Tests 135 passed.
- `pnpm --filter @object-ui/app-shell run type-check` (both
`tsconfig.json` and `tsconfig.test.json`, so the test file is compiled):
exit 0.
- `node scripts/check-sdui-manifest.mjs`: exit 0, manifest intact;
`scripts/sdui-manifest.record.json` untouched.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `7a62f956`: 34 commands, all exit 0;
`--ran` reconciliation: 34 derived, 34 run, 0 NOT-MEASURED (a derived
zero, every exit code recorded). `node
scripts/check-changeset-fixed.mjs` (the roster under `.changeset`): exit
0.
- The full app-shell suite (1730 test files) was not run locally; CI's
`Test Core` / UI lanes run it.
## Acceptance notes
- NOT MEASURED in a browser: the column was checked in the jsdom render
only. The translated description path is the server's overlay, read from
source, not measured end to end here.
- No width or truncation on the column, matching the permission-set
list. A very long description wraps inside the row, as it already does
on that list.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 31f9b87 commit 04148ac
3 files changed
Lines changed: 42 additions & 2 deletions
File tree
- .changeset
- ui/packages/app-shell/src
- services
- views/metadata-admin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| 223 | + | |
222 | 224 | | |
223 | 225 | | |
224 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
183 | 209 | | |
184 | 210 | | |
185 | 211 | | |
| |||
0 commit comments