Repository navigation
Commit 4128213
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuJQma3chFJMvv899DugzEi9)_
Part of #30126
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
1. **What:** the console rows of #30126 that still reproduce on `main`
and are fixed in `ui/**`: rows 4, 6, 11 and 14. Rows 5 and 10 do not
reproduce (readings below). Row 8 reproduces, but its fix is a server
object definition, outside this PR.
2. **Row 4:** an `object` nav entry with no `icon` draws the icon its
object declares, in the sidebar and in the `nav:menu` block. It reads
the object by name from metadata the console already holds, adds no
request and writes nothing to the navigation.
3. **Row 6:** a record section's field labels drop the uppercase
transform, so `REPAIR COST` no longer reads in capitals beside `负责人`.
They now use the highlights strip's label class.
4. **Row 11:** a count axis whose largest value is 1 to 3 tops out at
that value, so one record's bar is full height (362×71 → 362×282 px).
5. **Row 14:** an entry script that fails to load before mount makes the
page reload itself, backing off from 1 s and doubling (1/2/4/8/16 s), at
most 5 times per tab. Before, the splash stayed forever.
6. **Contract:** `@object-ui/layout` gains `resolveNavItemIcon`,
`NavIconTarget`, `NavTargetIconResolver` and an optional
`resolveTargetIcon` prop on `NavigationRenderer`, which mirrors
`resolveTargetLabel`. That is a widening, so `Clause-②: yes (widening)`
(the claim said `no`, and the seat corrects it). No metadata key, no
i18n key, nothing under `packages/**`.
## What changes
- `ui/packages/layout/src/NavigationRenderer.tsx`:
`resolveNavItemIcon(item, resolver)` returns the authored icon; failing
that, for an `object` entry, the resolver's answer; otherwise
`undefined` (the generic icon). The leaf row, including rows inside
groups, draws it.
- `ui/packages/app-shell/src/hooks/useNavTargetIcon.ts` (new): the
console's resolver. It reads `readObjectsByName` from the metadata
cache, the same by-name read the entry's label already makes. It is
wired into `UnifiedSidebar` (app arm) and `nav-menu-renderer`, and added
to the `openPathObjectReaders-12811` census as a `byName` reader.
- `ui/packages/plugin-detail/src/DetailSection.tsx`: the field label
class goes from `text-xs font-medium text-muted-foreground uppercase
tracking-wide` to `text-xs font-medium text-muted-foreground` (the
`HeaderHighlight` label class).
- `ui/packages/plugin-charts/src/normalizeChartSchema.ts` +
`AdvancedChartImpl.tsx`: `wholeNumberTickCount(axis, values)` gives `max
+ 1` ticks when every value is a non-negative integer, `1 ≤ max ≤ 3`,
and the axis has no authored `min`/`max`/`stepSize`. Otherwise it
returns `undefined`, and the axis is drawn as before. This is not
exported from the package index.
- `ui/apps/console/index.html`: the boot splash adds a capture `error`
listener for a failed `type=module` entry script before mount. It keeps
a per-tab retry count in `sessionStorage` (`os-boot-entry-retries`, max
5), backs off 1/2/4/8/16 s, clears the count on mount, and does not
retry where storage is blocked. The splash still ships no copy.
## Row readings (real stack, `origin/main` `c045c341`, showcase app, zh,
1440×900 unless noted)
| row | before | after |
|:--|:--|:--|
| 4 sidebar icons | all 6 Walkthrough rows `file-text`
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row4-sidebar.png?raw=true))
| `folder-kanban` / `check-square` / `building` / `receipt`, the
dashboard row stays `file-text`
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/after-row4-sidebar.png?raw=true))
|
| 5 Setup collapsed sidebar | **not reproduced**: hovering a collapsed
icon shows its tooltip, both collapsed by hand at 1440
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row5-setup-collapsed-hover.png?raw=true))
and on the auto rail at 1280
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-1280-row5-1280-rail-hover.png?raw=true),
tooltip `Users`). The Setup labels are English in zh, which belongs to
#30504. | no change |
| 6 record labels | Field Zoo: `负责人` beside `EMAIL` / `PHONE`
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row6-fieldzoo.png?raw=true));
en project record: `OWNER EMAIL`, `SPENT`, `START DATE` in capitals
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-en-row6-record.png?raw=true))
| one style, as authored
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/after-row6-fieldzoo.png?raw=true))
|
| 8 inbox topic | **reproduces**: the `sys_inbox_message` view `mine`
shows the raw topic `notify`
([list](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row8-list.png?raw=true),
[popover](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row8-popover.png?raw=true)).
The column list is in
`packages/services/service-messaging/src/objects/inbox-message.object.ts`,
outside `ui/**`, so it is left for the server lane. | no change |
| 10 toast over assignee | **not reproduced**: 1440 page: toast y53–107,
assignee y249–291
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row10-toast.png?raw=true));
1440 drawer: toast x340, drawer from x720
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row10-toast-drawer.png?raw=true));
1024 drawer: toast y136–190, assignee y249
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-1024-row10-toast-drawer.png?raw=true))
| no change |
| 11 one-bar count | axis 0–4, bar 362×71 in a 510×350 plot
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row11-one-bar.png?raw=true))
| axis 0–1, bar 362×282
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/after-row11-one-bar.png?raw=true))
|
| 14 entry fails | backend down after the HTML loads already reads
"无法连接到服务器" + 重试
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row14-backend-down.png?raw=true));
an entry module that fails to load left the splash forever
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/before-row14-entry-failed.png?raw=true))
| 2 aborted entry loads: recovered on load 3, about 15 s
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/after-row14-recovered.png?raw=true));
every load aborted: gives up after 6 loads, splash stays
([shot](https://github.com/objectstack-ai/objectstack/blob/a0ade7b68805c95f9a86334eea71f905f3578e12/evidence/30126/after-row14-gave-up.png?raw=true))
|
Row 14 was emulated with a Playwright route abort on the entry chunk,
not with a real `os dev` restart.
## Tests
-
`ui/packages/layout/src/__tests__/NavigationRenderer.iconInheritsObject-30126.test.tsx`
(5): the resolver's precedence and controls, plus rows at the top level
and in a group.
-
`ui/packages/app-shell/src/views/__tests__/nav-icon-inherits-object-30126.render.test.tsx`
(3): both surfaces against one `MetadataCtx`. It checks that an authored
icon stays, an object with no icon and a dashboard entry keep the
generic glyph, and a changed object icon shows on rerender with the
navigation unchanged.
-
`ui/packages/plugin-detail/src/__tests__/DetailSection.labelStyle-30126.test.tsx`
(2): Latin and CJK labels share one class with no `uppercase`, and match
the highlights strip.
- `ChartRenderer.integerMeasureTicks-11681.test.tsx`: plus 6 tests for
the small-count axis and its controls (fractional, count ≥ 4, authored
max).
- `apps/console/src/__tests__/bootSplash.test.ts`: plus 5 tests for the
retry, back-off, cap, reset on mount, and storage blocked.
- Ablations, each reverted with the restore diff at 0 lines, and each
turned its tests red: the sidebar leaf back to `item.icon`, the
`nav:menu` row back to `item.icon`, `uppercase` restored on the section
label, the axis `tickCount` spread dropped, the splash's
`location.reload()` removed, and the reset of the retry count on mount
removed.
## Verification
- Type-check exit 0: `@object-ui/layout`, `plugin-detail`,
`plugin-charts`, `app-shell` (re-run after the `main` merge), `console`.
- eslint on the 14 changed source/test files: 0 errors (warnings
pre-existing; the one new `any` warning in `bootSplash.test.ts` fixed).
- `node scripts/pm/dispatch-gates.mjs --commands`: 36 derived families
plus `pnpm --dir ui run check:new-line-citations`, all exit 0. `pnpm
--dir ui exec vitest run scripts/` was OOM-killed beside the loop and
passed run alone: 170 files passed (2 skipped), 4985 tests.
- After merging `origin/main` (`f33b094f`): `vitest run packages/layout/
packages/plugin-detail/ packages/plugin-charts/
apps/console/src/__tests__/ packages/app-shell/src/layout/
packages/app-shell/src/views/__tests__/ packages/app-shell/src/hooks/` +
the `openPathObjectReaders-12811` census: 923 files passed (1 skipped),
8557 tests passed (27 skipped).
- Evidence: shots at `a0ade7b6` (`evidence/30126/`, removed from the
tree by the next commit).
## Acceptance notes
- Open question for the seat (row 11): the one bar is still 362 px wide.
Capping `maxBarSize` would change every bar chart, so it was left alone.
- Row 8's fix (`columns` of view `mine`) and rows 9, 12, 13, 15, 16 stay
on the card.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgVUJuSB1qgbeFwydba
<!-- signed: domain:ui#4 · os-sales · session_01L6bhgVfPeFZkN1FP93imKU
-->
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent b55d6ab commit 4128213
15 files changed
Lines changed: 736 additions & 10 deletions
File tree
- .changeset
- ui
- apps/console
- src/__tests__
- packages
- app-shell/src
- console/__tests__
- hooks
- layout
- views
- __tests__
- layout/src
- __tests__
- plugin-charts/src
- plugin-detail/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
409 | 419 | | |
410 | 420 | | |
411 | 421 | | |
| |||
422 | 432 | | |
423 | 433 | | |
424 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
425 | 472 | | |
426 | 473 | | |
427 | | - | |
428 | | - | |
| 474 | + | |
| 475 | + | |
429 | 476 | | |
430 | 477 | | |
431 | 478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
663 | 665 | | |
664 | 666 | | |
665 | 667 | | |
| 668 | + | |
666 | 669 | | |
667 | 670 | | |
668 | 671 | | |
| |||
0 commit comments