Skip to content

对象加颜色:从固定的一小组色板里选,图标画成彩色圆角小方块里的白色图标,菜单、标题、关联标签处处同一个样子 #35985

Closed

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #34571(专题:控制台核心业务操作体验,维护者直派)。⛔ 不是认领。优先级 p2(协调席定的,维护者未指定)。

维护者说过的(2026-11-21)

  • 「然后你开始看右侧对象图标和颜色设置,以及前端的效果」
  • 「他好像固定只能选那几个颜色」
  • 看过对照和三条建议后:「立卡」

现状(主干 09f6d457bb,读代码加本机截图)

  • 对象只有图标,没有颜色:packages/spec/src/data/object-icon.ts:16 的 icon 是一个图标名。应用有主题色(packages/spec/src/ui/app.zod.ts:1238 primaryColor),对象没有。
  • 设计器里有图标选择器(ui/packages/app-shell/src/views/metadata-admin/widgets.tsx:2229 IconPickerWidget):可搜索,网格里是灰色的线条图标,一次最多显示 120 个。
  • 前端所有对象的图标都是同一种灰色线条:左侧菜单、列表标题、记录页头部看不出区别,只能读文字。
  • 已有一套固定的颜色名(ui/packages/app-shell/src/views/metadata-admin/color-variant-field.tsx:19:蓝、青、橙、紫、绿、黄、红和默认灰),现在用在仪表盘卡片和标签上,选择器是一排色块。

现状:我们的左侧菜单,图标都是灰色线条

参照:Attio(界面实测)

参照方式:Attio 是商业产品,只参照外观和行为,⛔ 不抄代码。

  • 对象设置里点图标,弹出一个选择器:上面是搜索框,下面是图标网格,右上角是 3×3 共 9 个固定的色块(蓝、绿、灰、粉、橙、紫、红、浅蓝、黄)。没有取色器,不能输入色值。
  • 网格里的每个图标直接用当前选中的颜色画出来:彩色圆角小方块,里面是白色图标。换一个颜色,整个网格跟着变,选的时候看到的就是最终效果。
  • 前端用到的地方:左侧菜单每个对象前面、列表页标题、记录页头部、视图名前面、关联记录的小标签。同一个对象处处同一个颜色。

参照:Attio 的图标和颜色选择器

参照:Attio 前端,左侧菜单和页面标题里的彩色图标

要做的

  1. 对象加一个颜色属性,值只能是固定色板里的名字,不接受任意色值。没设颜色的对象用默认的中性色。
  2. 色板用已有的那一套颜色名并补齐到 9 个左右,深色和浅色主题下各有一组对应的色值,保证白色图标在色块上看得清。
  3. 图标的画法:彩色圆角小方块,里面是白色图标。做成一个公用的小组件,接收图标名、颜色名和尺寸。
  4. 用到对象图标的地方都换成它:左侧菜单、应用首页的菜单清单(含手机)、列表页的对象名前面、记录页头部、快捷面板里的对象和记录、关联记录的标签、设计器的对象清单。
  5. 设计器的图标选择器加上色板:色块在选择器里,网格里的图标用当前选中的颜色预览。对象的属性面板里图标和颜色一起选。
  6. AI 搭建和技能规则:新建对象时给一个颜色,同一个应用里的对象尽量不重复;技能文档里写明可用的颜色名。

不做的

  • 不开放自选色值。
  • 不给视图、字段、菜单分组加颜色。
  • 不改应用自己的主题色和应用图标。
  • 不批量给已有应用的对象补颜色:没设的就是默认中性色,样子从灰色线条变成中性色小方块。HotCRM 的对象补颜色另立卡。

验收

  • 在设计器里给「客户」选一个图标和橙色:选择器里的图标网格是橙色小方块;保存发布后,左侧菜单、列表标题、记录页头部、快捷面板、别的对象上指向客户的关联标签,都是同一个橙色小方块。
  • 没设颜色的对象:处处是同一种中性色小方块,没有哪一处还是灰色线条。
  • 规范拒绝一个不在色板里的值(例如 #ff0000),报错信息列出可用的颜色名。
  • 深色主题下每个颜色的图标都看得清,附一张九个颜色并排的截图。
  • 手机宽度下菜单清单里的图标是同一套。
  • 让 AI 新建一个三个对象的应用:三个对象各有颜色,互不相同。
  • 这是规范变更:按规范变更的流程走(升级说明、技能同步)。PR 正文列出改到的界面位置。

协调席自己加的(不是维护者原话)

  • 第 2 项「沿用已有颜色名并补齐到 9 个左右」,具体哪几个颜色由开发定并在卡上列出。
  • 第 4 项列出的位置清单、第 6 项。
  • 「不做的」四条。

没有核对的

  • 设计器里的图标选择器只读了代码,没有打开实看。
  • 第 4 项的位置清单是按之前走查的印象列的,可能有漏;请开发以「搜出所有画对象图标的地方」为准。

Reader: domain:ui 车道牵头,规范部分在 domain:spec,技能规则在 domain:skills。packages/spec/src/data/object-icon.ts、ui/packages/app-shell(菜单、标题、设计器的 widgets.tsx、color-variant-field.tsx、inspectors/ObjectDefaultInspector.tsx)、ui/packages/components。

Dedupe: 对象 颜色 图标、object color icon tile、图标 色块(objectstack,open)→ 都是 0。相关:objectui#12531(对象图标从图标库里选)。

Activity

  1. added
    enhancement
    priority:p2
    domain:ui
    on Nov 21, 2026
  2. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui (and the packages/spec object icon) · pm:queue; rationale: area:ux · Feature · objects get a colour from a small fixed palette, and the icon is drawn as a white glyph in a coloured rounded square, the same in menus, headers and related tabs; maintainer: 「立卡」 after the comparison; filed by the coordinator under its topic → p2 as set by the coordinator · size M.

  3. added
    pm:queue
    on Nov 21, 2026
  4. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Claim: card thread · 2026-11-21T05:04Z · PR 1 of three, Part of #35985
    Area: b1-CX
    Session: session_01L6bhgT9PKAmy86XfbYbZtW (the card thread, building itself under the dev-thread rule)
    Account: os-sales
    Branch: claude/project-thread-4obpun
    Seat: repo:objectstack#1
    Domain: domain:ui (spec part domain:spec)
    File surface: packages/spec/src/data/object-icon.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/ai/solution-blueprint.zod.ts, packages/spec/liveness/object.json and the regenerated outputs; ui/packages/components (new ObjectIconTile plus its colour table, index.ts export); ui/packages/app-shell views/metadata-admin/widgets.tsx, views/metadata-admin/color-variant-field.tsx, views/metadata-admin/inspectors/ObjectDefaultInspector.tsx, layout/NavigationRenderer.tsx, hooks/useNavTargetIcon.ts, layout/UnifiedSidebar.tsx, views/nav-menu-renderer.tsx; a changeset with the upgrade note; docs.
    Container & model: L, mode:thread, model: opus, effort: high
    Clause-②: yes (widening: ObjectSchema.color and BlueprintObjectSchema.color are new optional keys; @object-ui/components newly exports ObjectIconTile; nothing removed or renamed). The seat runs the L2 at CONTRACT_REVIEW_TIER (new authorable spec property).
    Metadata-protocol: added
    Premise: re-read on main 8c8ff0f2 by the card thread: holds, with two corrections. (1) packages/spec/liveness/object.json needs a live reader for every object property, so PR 1 also switches the one shared navigation path (resolveNavItemIcon / useNavTargetIcon: the left menu and the app home menu list, phone included). (2) The step that turns an AI blueprint into objects is not in this repository; see Scope.
    Basis: card #35985, a p2 child of epic #34571, which the maintainer handed to this seat on 2026-11-21 03:24:57Z (「34571 专题你也接手」).
    Palette (the card leaves it to the dev; seat accepts): nine names, gray · blue · teal · green · amber · orange · red · pink · purple. They reuse the existing colour-variant names and add gray and pink. No semantic names (success, danger …), since an object colour tells objects apart and says nothing about state. An object without a colour draws as gray. The spec accepts only these names; any other value is refused with the nine listed.
    Scope: PR 1 = the spec property (object and blueprint, one leaf), palette, ledger, upgrade note, the shared tile, the designer picker with colour preview and the object inspector, plus the navigation reader above. A menu item pointing at an object draws the tile: the glyph is the item's own icon if it sets one, and the colour is always the object's. Dashboard, page and link items keep the line icon. PR 2 (patch, Fixes #35985) switches every other place that draws an object icon; it is listed in its body, and it lands after #35918 (objectViewPageHeader.tsx). PR 3 (domain:skills) writes the colour names into the skills text. The acceptance line "AI builds a three-object app with three different colours" is verified in this repository at the blueprint schema and rule text. The end-to-end run needs the AI service, which lives outside this repository, to carry color through the way it carries icon. PR 3's body names that, and it is not a blocker for this card. (That acceptance line comes from the coordinator's own additions, not from the maintainer's words.)
    Resume-from: none
    Fold-or-serial: serial; no fold. Overlap probe: only #35918 conflicts, on a PR 2 file. #35921, #35923 and #35977 touch object.zod.ts and merge cleanly; the probe is re-run before each push. The branch is the card thread's harness push branch, a measured platform exception to claude/issue-<n>-<slug>.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 21, 2026
  6. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Claim: PM loop · 2026-11-21T09:09Z (PR 2 of #35985; PR 1 #36012 merged a23164e)
    Area: b1-CX
    Session: session_01L6bhgWCsFBKwcq7ocDfUhR (card thread, dev-thread rule)
    Account: os-sales
    Branch: claude/project-thread-9psvlr
    Seat: repo:objectstack#1
    Domain: domain:ui
    File surface: the table in /mnt/project-files/build-seat1/35985/PR2/premise.md. That covers the remaining places an object's icon draws, including the two Studio page headers. The approval page's SubmittedRecord and the metadata ResourceListPage are not changed, because they draw no object icon. Related-list blocks read the child schema they already hold, with no new prop. RecordDetailView (breadcrumb icon) and recordDrawerStack (rootIcon) are changed only after #35983 merges.
    Container & model: M/L, own card thread, model: opus, effort: high
    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
    Premise (thread, main a23164ea): holds, with the corrections above.
    Basis: card #35985 (epic #34571; listed under it by the maintainer 2026-11-21 07:59:12Z); split plan agreed with the seat.
    Readings: when a menu or interface navigation item brings its own icon, the glyph is the item's and the colour is the object's, the same as PR 1's navigation. #35980's dialog title uses PR 1's exported ObjectIconTile, and no second component is made. This PR closes PR 1's L2 N1.
    Resume-from: none
    Fold-or-serial: serial; no fold. Overlap: #35983 (record header, must conflict on two files; merge main after it lands); #36024 touches objectViewPageHeader on other lines. overlap-check.mjs runs before each push. L1 at L1-b. The PR carries Part of #35985 (PR 3: skills text and the CLI explain table).

  7. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Claim amendment · 2026-11-21T13:07Z · #35985 PR 3 (claim 7057663302 covered PR 1 of 3; PR 1 #36012 and PR 2 #36042 have merged)
    Area: b1-CX
    Session: session_01L6bhgXP8uoLm9Q7zVHhYVY (card thread for PR 3)
    Account: os-sales
    Branch: claude/project-thread-6lq78y
    Seat: repo:objectstack#1
    Domain: domain:skills
    File surface: skills/objectstack-data/SKILL.md, skills/objectstack-ui/rules/navigation.md (both governed skills/**, Tier H, approver os-zhuang), packages/cli/src/commands/explain.ts (PR 1 L2 N7), a @objectstack/cli patch changeset.
    Container & model: S, card thread, model: opus, effort: medium
    Clause-②: no (no new export)
    Metadata-protocol: none
    Scope: the 9 colour names and "give every object one, avoid repeats in one app" in the data skill; one sentence in the navigation rule that the sidebar and icon tiles take the object's colour; the CLI explain object table shows the colour. The body names PR 2 L2 N1 and the open end: this repo has no code that turns a blueprint object into an object (no reader of BlueprintObject* outside packages/spec), so the acceptance line "three new objects, three colours" depends on the AI service passing color through like icon. That is outside this repo; the seat raises it with the maintainer.
    Fold-or-serial: serial, last PR of the card. L1 at L1-b, then the Tier H hand-off. The PR carries Fixes #35985.

  8. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Progress · 2026-11-22T00:47Z · in progress (answers triage 7071767440 on #35349).

    PR 3 #36089 merged 2026-11-21T23:18Z; PRs 1 and 2 merged earlier. Every line this repository can deliver is in. One acceptance line, "ask the AI for an app with three new objects, three colours", waits on the AI service passing the blueprint color to the object as it passes icon, and that code is not in this repository. The seat has put "close now and track the AI-service step on its own card" to the maintainer; it closes or keeps this card on that answer.

  9. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: claim treated as dropped and returned to pm:queue. The progress knock (Request: progress, 2026-11-22 00:46 in the seat's mailbox) went two rounds without an answer, and the card has had no comment, commit or new PR activity for more than 3 h. The grade and area are unchanged. Any seat may claim it again; the original claimant may reclaim it with a one-line status.

  10. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 22, 2026
  11. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

    Closed as completed · 2026-11-22T07:27Z · on the maintainer's decision (Sales, 2026-11-22T07:25:48Z: 「同意 35985」, picking 「现在关卡,AI 带色另开卡」, the seat's recommended option on the decision card of 2026-11-21T23:20:12Z).

    Everything this repository can deliver has merged: PR 1 #36012 (the colour palette and tile), PR 2 #36042 (record title, drawer, search and hover hosts), PR 3 #36089 (the skills text). One acceptance line remains: "ask the AI for an app with three new objects, three colours". It waits on the AI service passing the blueprint's color to the object as it already passes icon, and that code is not in this repository. It is tracked on its own card, #36348. The CLI os explain object colour row is #36099.

  12. removed
    pm:queue
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxdomain:uienhancementpriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions