Repository navigation
Commit 33d0169
feat(ui): the object's colour tile replaces its line icon in list headers, search, recents, pointers, hover cards, related lists and the studio (#36042)
repo:objectstack#1 · os-sales · session_01L6bhgWCsFBKwcq7ocDfUhR
Part of #35985
Clause-②: yes (widening): an optional prop on `ConsolePageHeader` (an
icon that brings its own frame is drawn as is), and an optional `color`
on `RecordSearchHit` and on `RecordHoverCardObjectDef`. No spec change.
The seat runs the declaration L2.
Metadata-protocol: none
## 维护者速读
-
用户在列表页标题、数据页标题、记录页和记录抽屉的记录名前、记录页的关联列表、快捷面板、搜索结果、首页「最近访问」、表格里的关联单元格、关联悬停卡,以及设计器的对象清单和导航里,看到的对象图标都从灰色线条图标变成「对象颜色的圆角小方块
+ 白色图标」,和上一步已经换好的左侧菜单一致。
- 这是对象颜色专题(控制台核心体验改进)的第 2 步:上一步给对象加了颜色并换了菜单,这一步把其余地方统一过来。
- 没设颜色的对象显示灰色方块;出问题只影响图标的样子,不动数据,撤回这个 PR 即恢复原来的线条图标。
- 无。
## What changes
PR 1 (#36012) added `ObjectSchema.color`, the nine-name palette and
`ObjectIconTile`, and switched the navigation. This PR draws the tile
everywhere else an object's icon names the object. The colour always
comes from the object definition the host already holds; no new metadata
read is added.
| Place | File | Colour from |
|---|---|---|
| List page title and the view bar's object name |
`ui/packages/app-shell/src/views/objectViewPageHeader.tsx` |
`objectDef.color` |
| URL data page title |
`ui/packages/app-shell/src/views/ObjectDataPage.tsx` | `objectDef.color`
|
| Page header takes an icon that brings its own frame |
`ui/packages/app-shell/src/layout/PageHeader.tsx` (new optional
`iconTile`) | — |
| Record row of the record page and of the record drawer, before the
record's name | `ui/packages/app-shell/src/views/RecordDetailView.tsx`,
`recordDrawerStack.tsx` | `objectDef.color` / the drawer's
`defOf(...).color` |
| Related list section heading on the record page |
`ui/packages/plugin-detail/src/RelatedList.tsx` | the child schema the
block already reads |
| Command palette: recent records, record hit groups and rows, object
navigation items | `ui/packages/app-shell/src/chrome/CommandPalette.tsx`
| object definition / `useNavTargetColor` |
| Search results page: group heading and hit cards |
`ui/packages/app-shell/src/views/SearchResultsPage.tsx` | object
definition, else the hit's `color` |
| Global search block hits |
`ui/packages/app-shell/src/views/global-search-renderer.tsx` |
`hit.color` |
| Search hit data | `ui/packages/react/src/hooks/useRecordSearch.ts`
(`RecordSearchHit.color`) | object definition, server and fan-out paths
|
| Home "Recently accessed" record rows |
`ui/packages/app-shell/src/console/home/HomeRail.tsx`, `HomePage.tsx` |
object definition |
| Grid reference (pointer) cell |
`ui/packages/plugin-grid/src/RecordPointerCell.tsx` | `def.color` |
| Reference hover card | `ui/packages/fields/src/RecordHoverCard.tsx`
(`RecordHoverCardObjectDef.color`) | `objectSchema.color` |
| Studio: data rail and header, interfaces rail and object header |
`ui/packages/app-shell/src/views/metadata-admin/studio-design/StudioDesignSurface.tsx`,
`InterfacesNavRail.tsx`, `StudioItemHeader.tsx`, `navSurface.ts` | the
package's object list, now carrying `color` |
| Tile glyph keeps its size inside hosts that size every nested `svg` |
`ui/packages/components/src/custom/object-icon-tile.tsx` | — |
- **`ConsolePageHeader.iconTile`** (new, optional). Drawn as given in
every posture (list, setup, row) in place of `icon`, with no accent chip
and no forced glyph size. Hosts that pass `icon` are unchanged.
- **Glyph size.** The command palette's `[&_svg]:size-4` (cmdk) grew the
tile's glyph to 16px inside a 20px square. The tile's glyph classes now
carry Tailwind's important suffix (`h-3! w-3!` …), so a host's
nested-`svg` rule no longer resizes it.
- **Navigation rule as PR 1.** A menu or interface navigation entry that
sets its own `icon` keeps that glyph; the colour is the object's.
- Not changed (the card's "not in scope"): action buttons, app icons,
views (favourited views included), fields, empty states, context
pickers, section icons. The approval page's `SubmittedRecord` and the
metadata `ResourceListPage` draw no object icon, so they are untouched.
- The record row's two places switched after #35983 (two-row record
header) merged; main is merged in. On a phone the record page draws no
record-row icon, before or after.
This PR closes PR 1's L2 nit N1 (the tile only in the navigation). PR 3
of #35985 (`domain:skills`) writes the colour names into the skills text
and the CLI `explain` object table.
## Tests
- New
`ui/packages/app-shell/src/layout/__tests__/PageHeader.iconTile-35985.test.tsx`:
`iconTile` is drawn in the list, setup and row postures, without the
accent chip; control: `icon` alone still draws the chip.
- `RecordHoverCard-27604.test.tsx`: a coloured object draws its tile in
that colour, an uncoloured one in gray.
- `ObjectGrid.recordPointerCell-12608.test.tsx`: the pointer cell's tile
carries the target object's colour.
- `useRecordSearch.test.ts`: hits carry the object's colour, and none
for an uncoloured object.
- `RecordDetailView.topBar-27524.test.tsx`: the page's record row and a
pane's record row each draw one tile in the object's colour. Ablation:
with the two source files reverted both cases go red; restored, they
pass.
- `HomePage.recentlyAccessed-12604.test.tsx`: the record row of a
coloured object draws its tile; other rows keep the kind icon.
- Ablation: with `HomeRail.tsx`'s tile reverted to the line icon the
home pin goes red; restored, `git diff HEAD` empty.
## Acceptance notes
- Home "Recently accessed" rows for a list visit (object type, no
record) still show the kind icon; only record rows draw the object tile.
- Search results' navigation-match rows and the Studio command palette's
object entries keep their kind icons: they name a kind of place, not an
object.
## Verification
Read first, by risk:
1. `ui/packages/app-shell/src/layout/PageHeader.tsx`: the `iconTile`
branch in all three postures (contract face, L2).
2. `ui/packages/app-shell/src/chrome/CommandPalette.tsx`: where each
group's colour comes from.
3.
`ui/packages/app-shell/src/views/metadata-admin/studio-design/StudioDesignSurface.tsx`:
the colour map threaded into both rails and headers.
Two-minute check: open the showcase app, give `account` a colour (for
example `orange`), open Accounts: the list title, the palette (⌘K, type
an account name) and the home recents all show an orange square with a
white glyph.
Browser evidence (Chromium, showcase app with seven objects coloured
locally for the shot, not committed): before and after, light and dark,
1280 and 375 wide, for the list (account, contact), the record page's
record row (light, dark, 1280, 375) and the record drawer (light, dark,
1280; files `after-record-header-*`, `after-record-drawer-*`), record
page related lists, contact hover card, home recents, palette, search,
approvals pointer cell, Studio data and interfaces. 80 files `before-*`
/ `after-*` in the project folder `build-seat1/35985/PR2/`.
<details><summary>Local gates</summary>
- `turbo run type-check` for `@object-ui/components`,
`@object-ui/react`, `@object-ui/fields`, `@object-ui/plugin-grid`,
`@object-ui/plugin-detail`, `@object-ui/app-shell`: exit 0.
- vitest over the touched packages' affected test files: 408 files, 3379
tests passed; the new and edited pins: 6 files, 58 tests passed. After
the merge of main and the record-row change: every app-shell test file
that names `RecordDetailView` or `recordDrawerStack`, 225 files, 1877
tests passed.
- `node scripts/pm/dispatch-gates.mjs --commands` derived set (39
commands): 39 of 39 exit 0 (one red on the first run,
`check:test-source-alias` on the home recents pin, fixed by its
module-top `@objectstack/lint` import)
- `node scripts/pm/overlap-check.mjs`: clean against `origin/main`
8145424 and #36024
- eslint on every changed file: 0 errors.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L6bhgWCsFBKwcq7ocDfUhR
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent fddb9cb commit 33d0169
27 files changed
Lines changed: 368 additions & 99 deletions
File tree
- .changeset
- ui/packages
- app-shell
- src
- chrome
- console/home
- __tests__
- layout
- __tests__
- views
- studio-design
- components/src/custom
- fields/src
- __tests__
- plugin-detail/src
- plugin-grid/src
- __tests__
- react/src/hooks
- __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 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
454 | 456 | | |
455 | 457 | | |
456 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
414 | | - | |
| 416 | + | |
415 | 417 | | |
416 | 418 | | |
417 | | - | |
| 419 | + | |
418 | 420 | | |
| 421 | + | |
419 | 422 | | |
420 | 423 | | |
| 424 | + | |
421 | 425 | | |
422 | 426 | | |
| 427 | + | |
| 428 | + | |
423 | 429 | | |
424 | 430 | | |
425 | 431 | | |
| |||
440 | 446 | | |
441 | 447 | | |
442 | 448 | | |
443 | | - | |
| 449 | + | |
444 | 450 | | |
445 | 451 | | |
446 | 452 | | |
| |||
449 | 455 | | |
450 | 456 | | |
451 | 457 | | |
452 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
453 | 464 | | |
454 | 465 | | |
455 | 466 | | |
| |||
503 | 514 | | |
504 | 515 | | |
505 | 516 | | |
506 | | - | |
| 517 | + | |
507 | 518 | | |
508 | 519 | | |
509 | 520 | | |
510 | 521 | | |
511 | 522 | | |
512 | 523 | | |
513 | 524 | | |
514 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
515 | 530 | | |
516 | 531 | | |
517 | 532 | | |
| |||
556 | 571 | | |
557 | 572 | | |
558 | 573 | | |
559 | | - | |
| 574 | + | |
560 | 575 | | |
561 | 576 | | |
562 | 577 | | |
| |||
574 | 589 | | |
575 | 590 | | |
576 | 591 | | |
| 592 | + | |
577 | 593 | | |
578 | 594 | | |
579 | 595 | | |
580 | 596 | | |
581 | 597 | | |
582 | 598 | | |
583 | | - | |
| 599 | + | |
584 | 600 | | |
585 | 601 | | |
586 | 602 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
618 | | - | |
| 618 | + | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
621 | 621 | | |
622 | | - | |
| 622 | + | |
623 | 623 | | |
| 624 | + | |
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
627 | 628 | | |
628 | 629 | | |
629 | 630 | | |
630 | 631 | | |
| 632 | + | |
631 | 633 | | |
632 | 634 | | |
633 | 635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
487 | 492 | | |
488 | 493 | | |
489 | 494 | | |
| |||
524 | 529 | | |
525 | 530 | | |
526 | 531 | | |
527 | | - | |
| 532 | + | |
528 | 533 | | |
529 | 534 | | |
530 | 535 | | |
| |||
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
546 | 557 | | |
547 | 558 | | |
548 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
277 | 280 | | |
278 | 281 | | |
279 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
280 | 291 | | |
281 | 292 | | |
282 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
120 | 127 | | |
121 | 128 | | |
122 | 129 | | |
| |||
208 | 215 | | |
209 | 216 | | |
210 | 217 | | |
| 218 | + | |
211 | 219 | | |
212 | 220 | | |
213 | 221 | | |
| |||
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
300 | | - | |
301 | | - | |
| 308 | + | |
| 309 | + | |
302 | 310 | | |
303 | | - | |
| 311 | + | |
304 | 312 | | |
305 | 313 | | |
306 | 314 | | |
307 | | - | |
| 315 | + | |
308 | 316 | | |
309 | 317 | | |
310 | 318 | | |
| |||
315 | 323 | | |
316 | 324 | | |
317 | 325 | | |
318 | | - | |
| 326 | + | |
319 | 327 | | |
320 | 328 | | |
321 | 329 | | |
| |||
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
350 | | - | |
| 358 | + | |
351 | 359 | | |
352 | 360 | | |
353 | 361 | | |
| |||
| 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 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments