Skip to content

fix(ui): kanban owner, history timeline, user menu and presence stack draw letters-only initials - #36484

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36346-initials-copies
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-36346-initials-copies

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #36346

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:看板卡片负责人、修改历史、右上角用户菜单和在线协作头像这四处,名字带括号或标点(如 Alice (Sales))的人,头像缩写从「A(」变成「AS」,单个英文名显示前两个字母。
  • 为什么做:人员头像缩写统一一条规则的收尾,上一轮只修了人员单元格和头像字段,这次补齐其余四处。
  • 出错会怎样:最坏是某处头像缩写字母不对,只影响显示、不碰数据,可直接撤回。
  • 要你做什么:无。

What changes

  • One rule, one home. getPersonInitials (letters only, since the people-cell fix) moves from @object-ui/fields widgets/personDisplay.ts to a new @object-ui/types module person-initials.ts, exported from the types barrel. @object-ui/fields re-exports the same function from personDisplay.ts, so its own getPersonInitials export, its callers and its rule tests are unchanged.
  • Why @object-ui/types and not @object-ui/fields (measured from each package.json): @object-ui/auth declares no @object-ui dependency at all (only @objectstack/spec and better-auth), while @object-ui/fields pulls in components, core, react, react-runtime, mobile, permissions and the markdown stack. Making the auth client depend on the field-renderer tier for one string helper inverts the tier order. @object-ui/types has no @object-ui dependency of its own, @object-ui/collaboration and @object-ui/fields already depend on it, and it is the same home, for the same reason, as the transient-HTTP-retry and in-flight-GET helpers already there. No cycle: nothing in the types closure depends on auth or collaboration.
  • The four faces:
    • kanban card owner: ownerInitials in KanbanCardOwner.ts is now a re-export of getPersonInitials from @object-ui/fields (the package already depends on it). The board file KanbanImpl.tsx is deliberately left untouched so this PR does not conflict textually with the open kanban PR that edits the same import block.
    • history timeline: HistoryTimeline.tsx drops its private initialsFromName and calls getPersonInitials from @object-ui/fields (a declared peer, already used by CommentAuthorAvatar).
    • user menu: getUserInitials in @object-ui/auth keeps its signature and its email fallback, and reads the name through getPersonInitials from @object-ui/types; @object-ui/auth gains the @object-ui/types dependency (lockfile updated). It is the function UserMenu, app-shell's AccountMenu and the Console profile page draw with.
    • presence stack: PresenceAvatars.tsx drops its private getInitials and calls getPersonInitials from @object-ui/types.
  • Behaviour change on the user menu that follows from "the same rule": a single-word name gives two letters (Admin gives AD, was A) and a three-word name gives first and last (John Michael Doe gives JD, was JM). The two auth unit tests that pinned the old outputs are updated.
  • Clause-② measured on the built declarations: after pnpm --filter @object-ui/types build, ui/packages/types/dist/index.d.ts carries export { getPersonInitials } from './person-initials.js'; and dist/person-initials.d.ts declares getPersonInitials(name: string): string; git grep getPersonInitials origin/main -- ui/packages/types/src answers exit 1 (control: git grep sharedGetJson origin/main -- ui/packages/types/src/index.ts exit 0). A new export, nothing removed: yes (widening). ownerInitials was never reachable from the @object-ui/plugin-kanban entry (index.tsx does not export KanbanCardOwner), so its change from function to re-export narrows nothing.

Tests

  • New family pin, ui/packages/app-shell/src/__tests__/personInitialsFamily-36346.test.tsx: one Alice (Sales) name, four faces, each must draw AS — the real ObjectKanban owner avatar (with ownerField), the real HistoryTimeline, getUserInitials, and the real PresenceAvatars. It lives in app-shell because that is the one package depending on all four, so no new dependency edge.
  • Ablation: one mutation of the shared rule, committed fix first, written through scripts/ablation-replace.mjs (anchor hit x1 -> x0, marker x0 -> x1, blob 0eb3e2f40c06 -> 72b58dc1b626): the rule's first line replaced by the old naive split (name.split(' ').map((p) => p[0])...). The family pin went 4 failed of 4 — kanban owner, history timeline and presence stack each drew A( where AS was expected, getUserInitials answered 'A('. Restored by the tool: blob after restore 0eb3e2f40c06 == HEAD blob, git diff HEAD empty, marker count 0. No dist/ in the path: every @object-ui/* specifier in these tests resolves to src through ui/vitest.config.mts's alias map.
Test runs

All runs through scripts/pm/os-verify-lock.sh, on head 998bb5fdd1 (after origin/main merged):

  • pnpm --dir ui exec vitest run --maxWorkers=2 --reporter=verbose packages/app-shell/src/__tests__/personInitialsFamily-36346.test.tsx packages/plugin-kanban/ packages/auth/ packages/collaboration/ packages/plugin-detail/src/__tests__/HistoryTimeline.test.tsx packages/plugin-detail/src/__tests__/HistoryTimeline.actionLabel-28894.test.tsx packages/fields/src/widgets/personDisplay.test.ts — Test Files 140 passed (140), Tests 1148 passed (1148), VERDICT command-exit 0; the four family-pin cases each listed passed.
  • Earlier, on 96825e61 (before the main merge): packages/auth/ packages/collaboration/ packages/plugin-detail/ packages/fields/src/widgets packages/types/src/__tests__ plus the pin — Test Files 1005 passed | 1 skipped (1006), Tests 16417 passed | 18 skipped, VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 scripts/ — Test Files 172 passed | 2 skipped (174), exit 0.
  • type-check, after pnpm turbo run build --concurrency=2 --filter='@object-ui/plugin-kanban^...' (53 tasks successful): pnpm --workspace-concurrency=1 --filter types, fields, auth, collaboration, plugin-detail, plugin-kanban run type-check — each package's tsc --noEmit && tsc -p tsconfig.test.json echoed, VERDICT command-exit 0.

Acceptance notes

  • content/docs/frontend/plugins/plugin-detail.mdx and ui/packages/plugin-detail/README.md name getPersonInitials of @object-ui/fields; that stays true (re-export), so no docs edit.
  • Known (L1-d note 7080533441, non-blocking): a user whose name holds no letters now shows "?" in the user menu, where it used to fall back to the email's first letter. The shared rule returns "?" for a letterless name before the email fallback is reached.
  • app-shell type-check is declared to CI (Type Check UI): its dependency closure is most of ui/; the six packages whose source changed were type-checked locally.

Verification

Local gate subset

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 60 families for this diff (tree 998bb5fdd); each ran with its exit captured before any pipe: 58 exit 0, pnpm --dir ui exec vitest run scripts/ exit 0, pnpm check:dual-build-cjs-loads exit 3 = NOT MEASURED (PREREQUISITE NOT MET: no dist/ for 35 packages, it needs a full pnpm build; CI measures it). --ran reconciliation: ✓ dispatch-gates --ran: 60 derived famil(ies) accounted for — 59 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).

node scripts/check-platform-checklist.mjs --changed-from origin/main exit 0 (0 anchored files in the change set). node scripts/pm/overlap-check.mjs VERDICT clean exit 0 (origin/main and two open PRs that share files merge cleanly).

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/__tests__/personInitialsFamily-36346.test.tsx — expect 4 passed.

Read first (by risk): ui/packages/auth/src/types.ts (the user-menu output change and the new dependency), ui/packages/types/src/person-initials.ts (the moved rule, byte-identical body), ui/packages/plugin-kanban/src/KanbanCardOwner.ts (the re-export).


Generated by Claude Code

…ared rule

Move getPersonInitials to @object-ui/types (the lowest package the user
menu in @object-ui/auth can reach); @object-ui/fields re-exports it. The
kanban card owner and history timeline call it through @object-ui/fields,
the user menu and presence stack through @object-ui/types.

Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds
Co-authored-by: Claude <noreply@anthropic.com>
…ollow the shared rule; changeset

Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds
Co-authored-by: Claude <noreply@anthropic.com>
…s to the shared rule

Claude-Session: https://claude.ai/code/session_01QsR2jUc3qp6bHKSWijbjds
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Final head (area f7-list, 2026-11-22T14:22Z): 998bb5fdd189bd86825c958cdef4b6659b7a025e. CI on it: 49 success, 10 skipped, 0 failed. Dev report 7080201160 on #36346.

Route: one initials rule, getPersonInitials, moved byte for byte into @object-ui/types (person-initials.ts). It lives there because @object-ui/auth may not depend on @object-ui/fields. fields re-exports it. Kanban owner, history timeline, user menu and presence stack all call it, and the user menu keeps its email fallback. Visible change in the user menu: 'Admin' shows 'AD' and 'John Michael Doe' shows 'JD'.

Clause-②: yes (widening): @object-ui/types dist/index.d.ts gains export { getPersonInitials }. Claim amendment is on the card. Owes L1 plus the seat's TIER_DEFAULT L2. 269 changed lines across 12 files.

L1 requested from L1-d via seat repo:objectstack#7.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jS7jCv5PH4ytECQWqf

L1 ACCEPT · head 998bb5fdd189bd86825c958cdef4b6659b7a025e · 2026-11-22T14:25Z

维护者速读

席位核对

  • 卡片关系:首行 Fixes #36346。卡上两条都交付了:

    1. 四处都改成按 getPersonInitials 计算,不再各写一份。kanban 和修改历史本来就依赖 @object-ui/fields,直接从那里取;@object-ui/auth 不能依赖字段渲染那一层,卡上要求「说明规则搬到哪个共享位置」,正文说明了搬到 @object-ui/types 的理由。
    2. 一组 Alice (Sales) 的家族测试钉住四处,并做了消融。

    合并应当关卡。

  • 规则搬家:ui/packages/types/src/person-initials.ts 里的 getPersonInitials 函数体,我和合并基点上 fields/src/widgets/personDisplay.ts 里的那份做了 cmp,逐字节相同。@object-ui/fields 改成 export { getPersonInitials } from '@object-ui/types',它的导出名和调用方都不变。@object-ui/types 的 dependencies 和 peerDependencies 里没有任何 @object-ui 包,所以 auth → types 不会形成环。@object-ui/auth 新增 @object-ui/types: workspace:*,锁文件只多了 3 行。

  • 声明:

    • Clause-②: yes (widening) 对:@object-ui/types 的包根多了一个导出 getPersonInitials。正文用构建出的 dist/index.d.ts 核过,并带了对照(sharedGetJson 在 main 上是 exit 0)。
    • ownerInitials 从函数改成转导出,不算收窄:@object-ui/plugin-kanban 的入口 index.tsx 本来就不导出 KanbanCardOwner。
    • Metadata-protocol: none 对。
    • 不欠 Skills-docs:kind 是 none,也没有 (narrowing)。我在本 head 上 git grep 过 getUserInitials,content/docs、各包 README 和 skills/ 里都没有提到它。不欠 dogfood。
  • changeset(逐句核):六个包都有 patch 条目。逐句核过的有:「四处从 A( 变成 AS」;「单个词取前两个字母(Admin → AD),三个及以上的词取首尾(John Michael Doe → JD),单个中日韩词取末尾一到两个字,没有字母给 ?」;「用户菜单没有名字时仍取邮箱首字符」;「@object-ui/types 导出、@object-ui/fields 转导出、@object-ui/auth 新增依赖」。每一句都和 diff、函数体一致。用户菜单输出的变化写进了 changeset,auth 的两条旧测试也按新规则改了(AD、JD)。

  • 文档:正文说明了 plugin-detail.mdx 和 plugin-detail 的 README 写的是 @object-ui/fields 的 getPersonInitials,有了转导出这仍然成立,所以不用改。属实。

  • 测试:家族测试放在 app-shell,因为只有它同时依赖这四个包,所以不新增依赖。四处用的都是真组件或真函数:ObjectKanban 的负责人头像、HistoryTimeline、getUserInitials、PresenceAvatars,同一个名字都要画出 AS。消融把共享规则换回旧的按空格切分,4 条全红,三处画出 A(,getUserInitials 返回 'A(';复原后 blob 等于 HEAD。

  • 小瑕疵,不阻塞:用户菜单的名字如果一个字母都没有(比如纯数字),现在返回 ?。原来返回第一个字符,也不会退回到邮箱首字符。这种名字很少见,而且就是共享规则的结果。

  • CI @ 998bb5fd:49 success、10 skipped、0 failed;不在治理面。

  • 落地:TIER_DEFAULT L2 在并行跑,通过后由区落地。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 998bb5fdd189bd86825c958cdef4b6659b7a025e
Local-runs: none

Inputs read: card #36346 (body, triage, claim, os-dev-report, claim amendment), PR #36484 (body, 12-file list, net diff against main), and the 69 check-runs on this head (all success or skipped, none failed or pending). Code outside the diff was read on origin/main d8b15b52f9, never reviewed.

① Derived judgments

  • New public export getPersonInitials on the @object-ui/types barrel (ui/packages/types/src/index.ts to ./person-initials.js): right. The body in person-initials.ts is the same as the body deleted from fields/src/widgets/personDisplay.ts (same split regex, same CJK branch, same firstLetter helper kept private). The module adds no runtime import, and @object-ui/types stays sideEffects: false.
  • @object-ui/fields getPersonInitials: same function as before, now a re-export, nothing removed or renamed. personDisplay.ts becomes export { getPersonInitials } from '@object-ui/types'. On main, the fields barrel (fields/src/index.tsx line 5461) re-exports it from ./widgets/personDisplay.js, and line 31 imports it for internal use at lines 3394 and 3447. Both still resolve to the one binding through the re-export, and personDisplay.ts has no other internal caller that a re-export without a local binding would break. fields already depends on @object-ui/types (workspace:*), so no new edge. Existing consumers keep importing from @object-ui/fields, which still exports the same function, for example plugin-detail CommentAuthorAvatar.tsx and the docs named in the PR's acceptance notes.
  • @object-ui/plugin-kanban ownerInitials: changes from a local function to export { getPersonInitials as ownerInitials } from '@object-ui/fields'. Its only importer is KanbanImpl.tsx line 37 (unchanged, same name). KanbanCardOwner is not reachable from the package entry on main, so the published surface does not move. fields is already a dependency of plugin-kanban.
  • @object-ui/plugin-detail HistoryTimeline: the private initialsFromName is dropped for getPersonInitials(entry.user_name ?? ''). A null or empty name still gives ?. fields is a declared peer that the package already imports at runtime (several files), and the vite external rule keeps every bare @object-ui/* specifier external in both the UMD and ES builds, so nothing is inlined.
  • @object-ui/auth getUserInitials: signature, null handling (?) and email fallback are unchanged, and the name branch now delegates to the shared rule. The output changes on two shapes ('Admin' gives 'AD', was 'A'; 'John Michael Doe' gives 'JD', was 'JM'). That follows from the card's "same rule as getPersonInitials" done-when. It is disclosed in the PR body and the changeset, and the two auth unit tests are updated. Its callers (UserMenu, app-shell AccountMenu, Console ProfilePage) take no type change.
  • @object-ui/collaboration PresenceAvatars: the private getInitials is dropped and the shared rule is called from @object-ui/types, an existing dependency. It was never exported, so the surface does not move.
  • New dependency edge @object-ui/auth to @object-ui/types (workspace:*, lockfile importer entry link:../types, 3 lines): right. On main, @object-ui/types depends only on @objectstack/spec and zod, and neither reaches any @object-ui/* package, so the edge creates no cycle. The auth tsconfig.json (nodenext, composite, rootDir: src) is the same as collaboration's, which already imports @object-ui/types the same way, and auth's import keeps the extension discipline because it is a bare specifier. Validate Package Dependencies, Build UI Deps, Type Check UI and every Test UI shard are success on this head. The workspace:* range matches how collaboration and fields declare the same dependency.
  • Family pin app-shell/src/__tests__/personInitialsFamily-36346.test.tsx: test-only (excluded from the published build by the app-shell tsconfig's __tests__ exclude), and it adds no dependency edge, because app-shell already depends on auth, collaboration and fields and peers plugin-kanban and plugin-detail. The ablation is reported (4 of 4 red under the old naive split, restored to the HEAD blob).
  • Accept-set: no packages/spec schema, no metadata key, no governed path in the diff. Nothing an author can write moves.

② Semver level

  • Changeset .changeset/36346-initials-one-rule.md names @object-ui/types, @object-ui/fields, @object-ui/plugin-kanban, @object-ui/plugin-detail, @object-ui/auth and @object-ui/collaboration, all at patch. That covers every package whose published surface (types: new export), dependencies (auth: new @object-ui/types), or runtime output (fields re-export, kanban, detail, auth, collaboration) moves. @object-ui/app-shell changes only a test file, and pnpm-lock.yaml publishes nothing, so neither is owed an entry.
  • Level: Metadata-protocol: none with Clause-②: yes (widening) takes patch by AGENTS.md Post-Task Checklist item 3 ("a non-protocol change, widening or breaking, ships patch"). patch is right. All six packages are in the .changeset/config.json fixed group anyway.
  • Clause-②: yes (widening): right, and stated line-initially in both the PR body and the changeset body. Nothing exported is removed or renamed, and the one new public symbol is getPersonInitials on @object-ui/types. The claim's original no was amended on the card (14:00Z) after measurement on the built declarations, so claim, PR and changeset agree. Check Changeset is success on this head.

③ Boundary flags

  • open_questions: empty. security_findings: none. out_of_scope_findings: empty.
  • Dev deviations: (1) Clause-② was amended from no to yes (widening), judged right under ②. (2) The file surface went past the claim's named files (auth package.json and lockfile, fields re-export, types home, auth tests). The card's done-when asked for "say which shared home the rule moves to", the amendment on the card names each added file, and each one is needed for the shared home, so all are accepted. KanbanImpl.tsx was left untouched to avoid a textual conflict with feat(kanban): the board's own view settings, lane header create and menu, and a lane statistic #36411, and that is sound because the re-export keeps its import working. (3) The trailer form is not a contract matter. (4) test:repo and check:dual-build-cjs-loads were not run locally. CI's Lint & Repo Gates and the build and test families are success on this head, and the auth package is ESM-only (type: module, tsc emit), the same as its new dependency.
  • Choice of home: @object-ui/types over @object-ui/fields is justified. Auth has no @object-ui dependency on main, and fields sits a tier above (components, core, react, mobile, permissions, markdown), so one rule in the lowest reachable package satisfies the card's "one rule, not a fifth copy". No copy remains in the four named files.
  • SQL push-down: not applicable. The diff is client-side string formatting with no id materialisation, query or in-app join.

No must-fix, no should-fix.

Implemented-by: claude/issue-36346-initials-copies
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jUc3qp6bHKSWijbjds

Landing (area f7-list, 2026-11-22T14:31Z): head 998bb5fdd189bd86825c958cdef4b6659b7a025e · L1 ACCEPT 7080533441 (L1-d) · L2 PASS 7080540274 (seat, TIER_DEFAULT, no findings; Clause-②: yes (widening)) · check-governed-merges --pr 36484: NOT governed, 269 changed lines ≤ 3000 · CI on the head: 51 success / 12 skipped, 0 failed (body guards re-ran after the Known note) · mergeable clean. L1-d's non-blocking note (a letterless name shows "?" in the user menu instead of the email fallback) is named in the body's Acceptance notes as known. → pr_ready + automerge_enable (merge queue).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 14:32
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit f2ef7d8 Nov 22, 2026
64 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36346-initials-copies branch November 22, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants