Skip to content

fix(comments): Reply focuses the reply box, author avatars with initials, mention menu at the caret, delete toast - #36105

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/project-thread-jue0uh
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/project-thread-jue0uh

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgU81jVj4Jk1kQNvLJ5

Fixes #36070

What changes

Four small fixes to comments (epic #36062, phase 1), made in the shared pieces so the comment panel of #36075 carries them over:

  1. Reply puts the caret in the reply box. ThreadedReplies takes a new optional focusReplyOnOpen prop: each time its reply input opens, it expands the replies (when collapsed) and focuses the input. RecordActivityTimeline passes it behind its Reply button. Default false, so a host that always shows the input does not have every thread pull focus on mount.
  2. Author avatar, 20 px. New CommentAuthorAvatar (exported from @object-ui/plugin-detail): the author's image, or their initials on the same Avatar / AvatarFallback disc the people-field chips and PersonRow draw, with the same getPersonInitials (now exported from @object-ui/fields). It replaces the comment icon on every comment and the hand-drawn first-letter disc on every reply.
  3. Mention menu at the caret. RichTextCommentInput measures the caret with a mirror element (textareaCaret.ts) and opens the menu under the caret's line, or above it when the window has no room below (menu taller than the space under the line, and more space above). Where layout cannot be measured, it keeps its old place over the editor's top left. Candidates and notifications are unchanged.
  4. Delete toast. The record page's handleDeleteComment shows a success toast "Comment deleted" (zh 评论已删除) after the server deleted the row. A refused delete keeps its error toast. New key detail.commentDeleted in all eleven locale packs.

Not changed: where comments sit and how they are structured (#36075 / #36076).

For #36075 to reuse: CommentAuthorAvatar (avatar/initials), ThreadedReplies' focusReplyOnOpen (pass true wherever the reply input opens behind a Reply button), the mention placement inside RichTextCommentInput (comes with the component), and the delete toast in the host's handleDeleteComment (comes with the handler).

Why

Measured on main in the showcase (account record, Activity tab, 1312 wide): after Reply, focus stayed on the Reply button, so typing went nowhere; on a comment with a collapsed reply, Reply showed the input but not the reply; comments without an avatar showed a comment icon; the mention menu opened at the editor's top left; a delete showed nothing.

Verification

  • New plugin-detail/src/__tests__/commentSmallFixes-36070.test.tsx (10 tests): focus and expand on Reply, a CONTROL that the default does not pull focus, initials (Latin and CJK) on comment and reply, the menu below / above / clamped to the box / fallback when unmeasurable.
  • RecordDetailView.feedCommentEditDelete-12268.test.tsx: the delete now also asserts the success toast; Cancel and a refused delete assert none.
  • The comment row's old 14 px STREAM_ICON_CELL had no reader left once the avatar cell replaced it; it is removed, and ui/e2e/narrow-drawer-time-34614.spec.ts now reads COMMENT_AVATAR_CELL (tokens shrink-0, w-5), the cell the row draws.
  • Local: plugin-detail suite 3660 passed; i18n + fields 5050 passed; plugin-detail type-check clean; eslint on the touched files clean of new warnings.
  • Browser, showcase on a fresh console build, before = main 493ad095, after = this branch. Focus read from document.activeElement after Reply: before BUTTON Reply, after INPUT Reply…; typed text lands in the reply input. Delete: before no toast, after "Comment deleted".

Reply on a comment with no replies, then typing without clicking (before / after):

Before After
before after
before after

Reply on a comment whose reply is collapsed:

Before After
before after
before after

Author avatar (no image set: initials):

Before After
before after
before after

Mention menu, @ at the end of the second line:

Before After
before after

Delete:

Before After
before after

Phone width (375, after): Reply on the collapsed thread expands it and focuses the reply box; @ on the second line opens the menu under the caret.

Reply, light Reply, dark Mention, light Mention, dark

The evidence images live on this branch's commits 7e6998c0 and adbf13df and are each removed in the next commit, so they never reach main.

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

Widening: ThreadedRepliesProps.focusReplyOnOpen (optional), CommentAuthorAvatar + CommentAuthorAvatarProps exports, getPersonInitials export from @object-ui/fields, locale key detail.commentDeleted. Nothing removed or changed in meaning.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; eslint on the touched files passes (CI runs pnpm lint).
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5

…als, mention menu at the caret, delete toast

- Reply puts the caret in the reply input and expands collapsed replies
  first (ThreadedReplies `focusReplyOnOpen`, passed by the timeline).
- Every comment and reply leads with CommentAuthorAvatar: the 20 px image,
  or the person chips' initials disc (getPersonInitials, now exported from
  @object-ui/fields).
- The mention menu in RichTextCommentInput opens under the caret, or above
  it when the window has no room below.
- The record page's comment delete shows a "Comment deleted" toast; new
  locale key detail.commentDeleted in all eleven packs.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
…y Reply

Pressing Reply now expands a comment's replies before focusing the reply
box, so the record-page threading pins read the stored and the new reply
under their parent without a second click on the count toggle.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T14:45Z. The brief handed to the isolated declaration-face reviewer for PR #36105 (owed by the claim's Clause-②: yes (widening) line, 7063168425 on #36070). The record follows as its own comment.

Contract review brief — PR #36105 @ 9639ec57c62e6c8d8b9bc65378ad0a5f21fa9e8b (card #36070)

You review at TIER_DEFAULT. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face declaration — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #36070: its body and EVERY comment (rulings and earlier records included)
· also epic #36062 (body only) and sibling card #36075 (the desktop comment panel that reuses this PR's avatar, reply focus and delete toast): bodies only, for context
· PR #36105: its body, its file list, and the net diff against main at 9639ec57c62e6c8d8b9bc65378ad0a5f21fa9e8b
· the check-runs on 9639ec57c62e6c8d8b9bc65378ad0a5f21fa9e8b: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/3d3cbaf6-4903-5fed-92d4-c2b94a45e868/scratchpad/pr-36105/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

评论的四处小修:点「回复」后光标直接进回复框(有收起的回复会先展开);每条评论和回复前显示 20 大小的作者头像,没设头像的显示姓名首字圆块;输入 @ 时人员选单出现在光标下方(下面放不下就在上方);删除成功后提示「评论已删除」。L1 结论:接受。第一轮的红确实只是旧测试假设「点回复不会展开」,后两个提交只改了测试,没有改产品代码。还欠一项:手机 375 宽的截图(评论加回复、@ 选单各一张),落地前补上即可,不需要改代码。

席位核对 — ACCEPT (L1-c) · repo:objectstack#1 · head 9639ec57 · 2026-11-21T14:47Z

Card: Fixes #36070 (epic #36062 phase 1). All four "要做的" items and every acceptance line are delivered here, so Fixes is right. Claim 7063168425; Clause-②: yes (widening), Metadata-protocol: none. No packages/spec/src/** or docs/adr/** in the diff, so this is not a contract face; the requesting thread runs its declared L2 on this head.

Gates: CI 52 success · 10 skipped · 0 failed on 9639ec57; mergeable clean; l1-face CLEAN (changesets cover plugin-detail, fields, i18n, app-shell).

Code read (26 files):

  • ThreadedReplies: focusReplyOnOpen (default false) tracks each false→true opening of the input. It expands the replies during that render, and an effect focuses the input once it is drawn. The timeline's showReplyInput={replyOpen} starts false, so nothing takes focus on mount; a second open focuses again. The default-off case has a CONTROL test.
  • CommentAuthorAvatar: the Avatar/AvatarFallback pair with getPersonInitials from @object-ui/fields, which plugin-detail already depends on (no new edge, no cycle). Comments go from the 14 px icon cell to a 20 px cell; replies go from 24 px to 20 px. Both are 20, as the card asks.
  • RichTextCommentInput + textareaCaret.ts: the mirror-div caret measure. The textarea's offset parent is the new relative editor box, so offsetTop + caret.top - scrollTop is in box coordinates. Left is clamped into [0, box width − 224]. The menu goes above only when the space below is short of 164 px and the space above is larger. Where layout cannot be measured, it falls back to the old left-2 bottom-full. This is the well-known mirror technique, written fresh here; nothing reads as copied from Twenty.
  • RecordDetailView.handleDeleteComment: toast.success only after the server delete and the local removal; a refused delete keeps its error toast. Reply deletes go through the same handler and get the same toast, which is fine.
  • detail.commentDeleted is in all eleven packs (spot-read zh-Hans, ja, ar: real text). The docs fix of showReplyInput's default to true matches the code (showReplyInput = true).

The re-red, checked as asked: 8a8e7076 and 9639ec57 touch only test files. The first commit changes three reply pins in …authoredActivityThreading-12249 and …replyCountOnRead-12144. These pins clicked the count toggle to expand, but rootRowOf presses Reply first, which now already expands; a second click would fold the replies away. Each pin keeps its content assertion (the child or new reply is on screen under its parent), and the 12144 pin adds that the toggle still folds them away. The pins are not weakened. The second commit adds commentDeleted to that test's Pack type. Product code is the same as at 3f86e683.

Tests: new commentSmallFixes-36070 has 10 cases: focus and expand, a default-off control, Latin and CJK initials on comment and reply, and the menu below, above, clamped and on fallback. The delete pin asserts the success toast, and asserts no toast on Cancel or a refused delete.

Evidence: before and after screenshots, light and dark, of Reply-then-type, Reply on a collapsed thread, initials and delete. The mention menu is light only. document.activeElement read: before BUTTON Reply, after INPUT Reply…. The images were removed again in 4752bb30, so none reach main.

Owed before landing (evidence only, no code): there is no 375-wide reading. Comments draw on the phone record page too, so the new avatar and the mention menu reach phones. One 375 screenshot of a comment with its reply open, and one of the @ menu at 375, close this. I expect both to pass: the menu is clamped to the box width.

Verdict: ACCEPT at 9639ec57, with the 375 evidence owed. A new head gets a delta read.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 9639ec57c62e6c8d8b9bc65378ad0a5f21fa9e8b
Local-runs: none

Inputs read: card #36070 (body and both comments: the triage and the seat's Claim:), epic #36062 and sibling #36075 (bodies only), the PR #36105 body and file list, the net diff main...9639ec57c (26 files; the evidence screenshots added in 7e6998c0 are removed in 4752bb30 and are not in the net diff), and the 62 check-runs on the head: every one is success or skipped, none failed or pending. That includes Type Check UI, Lint UI / ESLint, Test UI 1-16/16, Build & E2E UI, Check Changeset, Governed Surface Queue Guard and the PR-body guards.

① Derived judgments

No accept-set change. Nothing under packages/spec, no metadata key, value or type is involved, and no governed surface is touched. Metadata-protocol: none is correct. The public-surface changes the diff implies:

  • @object-ui/plugin-detail: adds CommentAuthorAvatar (value) and CommentAuthorAvatarProps (type), both exported from src/index.tsx. This is additive and right. The props (name, optional avatarUrl, optional className) are a minimal, reusable shape for 评论(一)电脑:评论从「动态」页签拿出来,做成记录页和抽屉右侧的独立评论栏;对一条评论的操作收到一处 #36075, which the card and epic both say must carry these pieces over.
  • @object-ui/plugin-detail: adds the optional prop ThreadedRepliesProps.focusReplyOnOpen (default false). This is additive and right. With the default false, existing hosts that always show the input (showReplyInput defaults to true) keep their mount-time focus behaviour, and the CONTROL test in commentSmallFixes-36070.test.tsx pins that. Only RecordActivityTimeline passes it, behind its own Reply toggle.
  • @object-ui/plugin-detail: textareaCaret.ts / getTextareaCaretCoordinates stays internal. It is not exported from the package entry. Right: the helper is not made part of the public surface.
  • @object-ui/fields: adds the root export getPersonInitials(name: string): string. The function already exists in widgets/personDisplay.ts and is the one used by PersonRow, SelectionTray and the LookupField chips. This is additive and right: it is how item 2 of the card ("same set as the person chips") is met without a second copy. Nothing on main exports a symbol with this name, so the new export collides with nothing.
  • @object-ui/i18n: adds the key detail.commentDeleted to all eleven packs (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans 评论已删除, zh-Hant). Each pack has a real translation, not an English copy. This is additive and right. The card's 「评论已删除」 is matched exactly in zh-Hans.
  • @object-ui/app-shell: handleDeleteComment now calls toast.success after the server delete resolves. Cancel and refused-delete paths are unchanged, and both assert that no success toast appears. This is a behaviour change only, with no declaration change: right.
  • The docs table fix (showReplyInput default false changed to true in plugin-detail.mdx) corrects the docs to match the code (showReplyInput = true). Right: it changes nothing in meaning.

Nothing is removed or renamed, and no declared meaning or default changes. Clause-②: yes (widening) is accurate.

② Semver level

The changeset .changeset/36070-comment-small-fixes.md sets patch on @object-ui/plugin-detail, @object-ui/fields, @object-ui/app-shell and @object-ui/i18n. Those are exactly the four published packages the diff moves; content/docs and tests publish nothing. Under AGENTS.md (Post-Task Checklist 3), a Metadata-protocol: none change takes patch, and a non-protocol widening also ships patch, so the level is right.

Clause-②: yes (widening) and Metadata-protocol: none are line-initial in both the PR body and the changeset body. Both lines match the seat's Claim: on the card and the diff as measured above. Check Changeset is success.

③ Boundary flags

  • Dev flags / open_questions: none raised in the PR body or on the card. The card's 「没有核对的」 item ("where real keyboard typing lands after Reply cannot be tested by automation") is answered by the PR's browser evidence. That evidence reads document.activeElement after Reply (before: BUTTON Reply; after: INPUT Reply…) and confirms that typed text lands in the reply input. The two coordinator additions (20 px avatar; the menu flips above near the bottom) are implemented as written. Every acceptance line has a test or evidence. The before/after screenshots the card asks for are attached.
  • SQL push-down (Prime Directive 5): no finding. The diff adds no data read, no id materialisation and no in-app join. The delete path's single dataSource.delete call and its local list update are unchanged. Only a toast is added.
  • Finding: should-fix (not part of the declaration contract; the dev did not flag it). The PR leaves STREAM_ICON_CELL dead in ui/packages/plugin-detail/src/RecordActivityTimeline.tsx:197. Its jsdoc still says "A comment's icon cell", but the comment row now draws COMMENT_AVATAR_CELL (w-5, 20 px) instead. The only reader left is the regex at ui/e2e/narrow-drawer-time-34614.spec.ts:73 (feedIcon: grab(FEED, /const STREAM_ICON_CELL =.../, ['shrink-0','w-3.5'])). That geometry pin says it reads the comment row's real icon cell out of the source, so its 380 px fixture now draws a 14 px cell where the real row draws 20 px. Its claim is now false, and it keeps a dead constant alive. The dead constant also adds a new @typescript-eslint/no-unused-vars warning, although the PR body says the touched files are "clean of new warnings". The rule is at warn, so CI stays green. Fix: point the spec's feedIcon grab at COMMENT_AVATAR_CELL with tokens ['shrink-0','w-5'], then delete STREAM_ICON_CELL. Recommended before merge.
  • Nit: in textareaCaret.ts, when line-height computes to normal, the height falls back to marker.offsetHeight. The marker holds the whole rest of the text, so that height can span several lines. The textarea's classes (text-sm / leading-5) always set a line-height, so this branch is not reached today.
  • Nit: in RichTextCommentInput, the rows of the mention candidate list still draw their own charAt(0) initials disc rather than getPersonInitials. The card leaves candidates out of scope, so this can become a follow-up item.

Implemented-by: claude/project-thread-jue0uh
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob (isolated L2 sub-agent of the seat)

VERDICT: PASS

…2e reads the avatar cell

The comment row draws COMMENT_AVATAR_CELL since the author avatar; the
14 px STREAM_ICON_CELL had no reader left but the e2e fixture, which
therefore laid out a cell the row no longer uses.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
@github-actions github-actions Bot added the tests label Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

上一轮欠的手机 375 宽截图已补齐:回复展开、光标在回复框里,姓名首字头像正常;@ 选单出现在光标下方,右边没有超出输入框。代码增量只是删掉一个不再用的样式常量,并让一个端到端测试读新的头像格。L1 结论:接受,没有欠项了。

席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head f4425e0e · 2026-11-21T15:20Z

Delta read: 9639ec57..f4425e0e, with the prior ACCEPT 7064379413 standing for everything before it. The net diff is two files, +1/−3:

  • RecordActivityTimeline.tsx drops STREAM_ICON_CELL, which nothing has read since the avatar cell replaced it (git grep on the head: no reference left).
  • ui/e2e/narrow-drawer-time-34614.spec.ts: feedIcon now grabs COMMENT_AVATAR_CELL and expects shrink-0 and w-5, which that constant carries. This is the same pin on the cell that now draws, not a weaker one.
  • adbf13df / f4425e0e add and remove the phone screenshots, so none reach main.

Gates: CI 54 success · 12 skipped · 0 failed on f4425e0e; mergeable clean.

The owed 375 evidence is closed (after-375-reply-{light,dark}, after-375-mention-{light,dark}, and in the body):

  • Reply on the collapsed thread at 375: the reply shows under "1 reply", and the reply input has the focus ring.
  • Comments and the reply lead with "DA" initials discs.
  • @ at the end of the second line: the menu opens under the caret's line, with its right edge clamped inside the composer box. The bottom bar's Edit is unchanged.

Verdict: ACCEPT at f4425e0e; nothing owed.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Contract review

Served-tier: TIER_DEFAULT
Head-sha: f4425e0ea873ad9b94c475b503ee63862979074a
Local-runs: none

This is a delta record on top of the PASS record for 9639ec57c62e6c8d8b9bc65378ad0a5f21fa9e8b.

Inputs read:

  • Commits. Three commits sit on the earlier head: c30779d2 (the fix), then adbf13df and f4425e0e. The last two add the 375-wide evidence images and remove them again.
  • Net diff. 9639ec57..f4425e0e touches exactly two files: ui/e2e/narrow-drawer-time-34614.spec.ts (+1/−1) and ui/packages/plugin-detail/src/RecordActivityTimeline.tsx (−2). The evidence images do not appear in it.
  • Checks. The head has 66 check-runs: 54 success, 12 skipped, none failed or pending.
  • PR body. It gained a "Phone width (375, after)" evidence line and table.

① Derived judgments

The delta changes no declarations.

  • The only source change deletes the module-level constant STREAM_ICON_CELL, together with its doc comment. The constant was never exported, so no public or package surface changes.
  • The .changeset, the package entry points, the locale packs and the props interfaces are all untouched.
  • Every judgment in the PASS record for 9639ec57 still stands on this head.

The should-fix from that record is fixed correctly:

  • ui/e2e/narrow-drawer-time-34614.spec.ts:73 now reads feedIcon: grab(FEED, /const COMMENT_AVATAR_CELL =\s*'([^']+)'/, ['shrink-0', 'w-5']).
  • COMMENT_AVATAR_CELL is the class the comment row actually draws ('shrink-0 flex h-[30px] w-5 items-center justify-center').
  • So the geometry pin's fixture again holds the real 20 px cell. Its token guard would throw if the regex matched the wrong string.
  • git grep STREAM_ICON_CELL on ui/ at this head finds nothing. The dead constant and the new no-unused-vars warning it caused are both gone.

② Semver level

There is no change since 9639ec57. The delta publishes nothing new: it removes an internal constant and edits an e2e spec. The existing patch changeset on the four moved packages still covers it. Clause-②: yes (widening) and Metadata-protocol: none are still line-initial in the PR body, and the changeset is unchanged.

③ Boundary flags

  • The dev raised no new flags and no open_questions. The 375-wide evidence adds phone-width proof of Reply expand+focus and of the menu opening at the caret. It answers no open item and raises none.
  • SQL push-down: no finding. The delta has no data path.
  • Nit, not introduced by this delta: the doc comment /** The stream chips' copy (objectstack#27055) ... */ above the avatar-cell constant stays orphaned. It was already orphaned on main.
  • The two nits from the PASS record (the line-height fallback in textareaCaret.ts, and the initials in the mention candidate rows) stay as follow-ups.

Implemented-by: claude/project-thread-jue0uh
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob (isolated L2 sub-agent of the seat)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Regen-provenance: declaration-face record 7064801429 (delta PASS) · f4425e0ea → 6f47af8ab · diff <(git diff MB_OLD f4425e0ea -- . ':!.changeset') <(git diff MAINPARENT 6f47af8ab -- . ':!.changeset') → empty once index and @@ offset lines are set aside (MB_OLD 493ad095d, MAINPARENT 3c06fc53a) · 2026-11-21T15:21Z

6f47af8ab merges main because K had reached 17 at landing, with an empty --remerge-diff. The PR's own change, the changeset included, is byte-identical to the reviewed head, so the record carries over. Check-runs on 6f47af8ab are read at landing, after L1-c's merge-only re-check.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

这个 PR 合进了最新主干(主干的 17 个提交),没有冲突,PR 自己的改动和已经审过的版本逐字一致。主干同期改过的几个文件(记录页、字段包导出、语言包)跟评论小修没有交叉。L1 结论:接受合并这一步,CI 全绿后即可落地。

席位核对 — ACCEPT (L1-c, merge only) · repo:objectstack#1 · head 6f47af8a · 2026-11-21T15:22Z

What this read covers: only merge 6f47af8a, with parents f4425e0e (reviewed, ACCEPT 7064800844) and 3c06fc53 (on main, 17 commits ahead of the old base).

Readings:

Verdict: ACCEPT the merge at 6f47af8a. Landing waits for all checks on this head to be green; a red check, or any new head, comes back for a read.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T15:43Z · #36070, small comment fixes (epic #36062 phase 1). Comments show the shared CommentAuthorAvatar. A reply box opened from a thread takes focus (focusReplyOnOpen). Deleting a comment shows a confirmation toast. The @-mention menu opens at the caret. The narrow-drawer e2e now reads COMMENT_AVATAR_CELL.

Reviews:

  • Seat declaration L2: PASS 7064397712 on 9639ec57, with one should-fix: the e2e read a stale STREAM_ICON_CELL. The fix was taken, and the delta PASS is 7064801429 on f4425e0e.
  • L1-c: delta ACCEPT 7064800844.
  • K was 17, so the thread merged main to 6f47af8a. Regen-provenance 7064819377 is empty, with no remerge diff. The L1-c merge-only reading 7064832065 is final on this head.

Gates on this head:

  • Clause-②: yes (widening): one new i18n key, the new ThreadedReplies prop and the getPersonInitials export. Metadata-protocol: none.
  • check-governed-merges --pr 36105 reads NOT governed (+496/−39).
  • The seat read K by hand: 0 first-parent commits since the merge base, and no translations/ or skills/ paths on either side.
  • 52 check-runs are success, 10 skipped, none failed. Mergeable is clean.

The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #36070. #36114 (#36075) swaps in the avatar and the toast after this merges.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 15:44
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 3543b51 Nov 21, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-jue0uh branch November 21, 2026 16:04
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
… on, Approve leads the band, one time face (objectstack-ai#36095)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu5xKbCuyXQ5nYfei9GkjzN3)_

Fixes objectstack-ai#35415

repo:objectstack#1 · os-sales · session_01L6bhgW5RH2VUXjRj9dZYH2

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

The widening: `@object-ui/components` takes one optional member,
`RecordHeaderState.title`, and exports its type `RecordHeaderTitle`.
Nothing is removed or renamed.

## 维护者速读

-
审批请求页的标题从流程名(「费用报告签批」)换成审批人要看的业务记录名(「EXP-2001」),点标题就打开那条记录。只有页面自己读得到那条记录时标题才是链接;无权读、读不到、或平台标记已删除时,标题只显示名字、不能点,和同页「提交时的内容」卡片的规则一致。取不到记录名时仍显示流程名,标题里不会出现裸记录
id。
- 流程名只在标题下方高亮条的「流程」一格出现一次。卡片第 1
条写了「副标题写流程名」,这里没有加副标题:那一格已经紧贴在标题下方,再加副标题就是卡片抱怨的重复。
- 审批条里「通过」仍是实心主按钮,「驳回」改为描边加危险色文字,「通过」成为页面上最醒目的按钮。业务记录页上的审批条是同一个组件,也一起变。
- 审批动态里的时间改成和页头一样的写法(`2026/11/21 上午10:09`),不再带秒。
- 列表、搜索、最近访问和面包屑里,审批请求仍按流程名称呼,对象定义不变。只改前端显示,可以整体撤回。

## What changes

Card objectstack-ai#35415 lists four defects on the approval request page. Read
against main `fe753492`, two still held, one held in part, and one was
already fixed:

| Card item | On main | This PR |
|:---|:---|:---|
| 1. The title is the flow's name; the record cannot be opened from it |
held | the title names the record and links to it |
| 2. "As submitted" truncates text fields | fixed by objectstack-ai#34588 (the record
is drawn whole, values wrap) | nothing to do; the screenshots confirm |
| 3. Approve looks weaker than Reject | half: Approve was already
filled, Reject was filled red | Reject becomes a destructive outline |
| 4. Two time formats on one page | held | the timeline uses the page's
one face |

- **The page title (`RecordDetailView`, new
`approval-decision/approvalSubjectTitle.tsx`).** On a
`sys_approval_request` page the header names the business record by the
`record_title` the approvals get already serves for it, as a link
through the page's own record route (`RelatedRecordActionsBridge`'s
`recordHref` / `openRecord`, the route the "As submitted" card's "Open
record" link takes). A plain click opens the record the way the page
opens one, which is the record drawer one level down on a desktop record
page; a modifier or middle click keeps the anchor's new-tab behaviour.
The name is a link only once one of the page's own reads of the record
returned it, the rule the card's link follows (objectui#12557,
objectui#11878): `SubmittedRecord`'s current read and
`RecordPreviewCard`'s read report what they found through the new
`RecordReadReportContext` (`approval-decision/recordReadReport.ts`),
which `RecordDetailView` provides on a request page only. The title
makes no read of its own. A refused, unresolvable or platform-deleted
subject is named as plain text. Where the get serves no `record_title`,
or one equal to the bare `record_id`, the header keeps the request's own
title (`process_label`), so the page never names its subject by a raw
id. That is the guarantee objectstack-ai#24665 / PR objectstack-ai#24708 gave the H1, kept here.
- **`RecordHeaderState.title` (`@object-ui/components`).** The host
hands `{ text, node? }`, and `page:header` draws `node` (else `text`) in
its H1 in both faces: in the host's top bar and in its own row (phone,
and pages with no bar). Absent, or with an empty `text`, every title
rung the header had is unchanged. It sits beside the state's existing
`tags`, `group` and `stage`.
- **No subtitle.** The strip directly under the title already names the
flow in its Flow chip, so the flow is named once. The card's item 1
asked for the flow as a subtitle. Adding one would put back the
duplicate the card's first bullet complains about, so this PR does not
add it. This reading is the one the claim (comment 7060828003, scope
item 2) records.
- **The decision band (`DeclaredActionsBar`).** In the approver's band
(`foldDecisions`, drawn by the request page's panel and by the business
record page's band), a declared `danger` decision is drawn as an outline
button in the destructive text colour. That is the face the record
header's group already gives a secondary danger lever (objectstack-ai#35593), and the
two now share one condition (`secondaryDanger`). Approve keeps the
filled primary face. A bar that does not fold keeps the declared filled
danger face, and overrides keep their amber face.
- **One time face (`ApprovalActionTimeline`).** Action times render
through core's `formatDateTime(…, { style: 'compact' })`, the face every
`datetime` cell and the strip's `updated_at` chip draw, in the host's
display time zone. They used to be the browser's `toLocaleString`
(seconds, a 24-hour clock under zh-CN). The timeline on a business
record page's approvals panel is the same component, so it changes too.
- `plugin-approvals`: comments only, in `sys-approval-request.object.ts`
and `sys-approval-request.page.ts`, saying where the request page now
names its record. The object's `nameField`, `highlightFields` and the
page metadata are unchanged.

Not changed, per the card's "不做的": the structure of the progress and
timeline cards.

## Why

An approver opens a request to decide on a business record. The page was
titled by the process, which the strip repeated, and the record it is
about had no name in the header and no link from it. The reject button
outweighed approve, and the page wrote one moment in two ways.

## Verification

Tests added (each run red with its fix ablated, green with it):
- `approvalSubjectTitle.test.tsx` (new): read by the page, the title
links through the host route; not read, plain text; a host that routes
nowhere, plain text; a plain click is the host's `openRecord`, a
modifier click the browser's; no title or an id-only title keeps the
page's own. Ablating the read gate reds the not-read case.
- Served request page (console, real adapter stack):
`servedPageRecordLink-12557` gains an H1 case (the H1 reads the subject
and its plain click opens the same drawer, the page stays put) and the
readable case now counts the card's link and the H1's; its refused
CONTROL also checks the H1 is plain `INV-2020`.
`servedPageReferenceStates-12489`: readable names and links the H1;
deleted names it as plain `INV-3030`.
`ApprovalsInboxPage.opensServedPage-12484`: the served page is
recognised by the subject's title in its H1. Ablating the read gate reds
the refused CONTROL; ablating the report provider reds the two H1-link
cases.
- `RecordDetailView.harness.test.tsx`, block
`RecordDetailView.approvalSubjectTitle-35415` (real `RecordDetailView`,
real `page:header`, desktop top bar): the H1 reads the served subject
title, and with no reader of the subject on that page it links nowhere
and reads nothing; no `record_title` keeps the flow label with no link;
a `record_title` equal to the record id keeps the flow label and never
prints the id; CONTROL: another object with the same fields keeps its
own title. Ablating the host wiring reds the subject case only.
- `page-header-record-bar-35593.test.tsx`, block `the record state's
title (objectstack#35415)`: the host's node is drawn inside the H1 in
the bar and in the row; text-only; CONTROL: an empty title leaves the
record's own name. Ablating the renderer reds the three host cases.
- `DeclaredActionsBar.approverFold-34361.test.tsx`, block `…leads with a
filled Approve, Reject outlined (objectstack#35415)`: Approve
`bg-primary`, Reject outline with `text-destructive` and no
`bg-destructive`; CONTROL: a bar that does not fold keeps
`bg-destructive`.
- `RecordApprovalsPanel.displayLocale-9909.test.tsx`: the de-DE and en
pins now read the compact face (`4.3.2020 3:30 pm`, `3/4/2020 3:30 pm`),
and a new zh-CN pin equals `formatDateTime(…, { style: 'compact' })`
with no seconds. The three "is a reading of the session" pins are
unchanged and green.

Local runs on this head (`88775b7e`, main `493ad095` merged in, so
objectstack-ai#35983's two-row record header is in):
- vitest, `ui/` root, on this head: every ui test file that names an
approval request, `DeclaredActionsBar`, `ApprovalActionTimeline`,
`RecordHeaderState`, `RecordPreviewCard`, `SubmittedRecord`, the record
pointer card, `RecordDetailView`, `ApprovalDecisionPanel` or
`page:header` (490 files, console included): `Test Files 490 passed`,
`Tests 6483 passed`. The first CI run on `9097b572` was red in three
console served-page files (16 tests); this commit is the fix, above.
- `turbo run type-check` for `@object-ui/components`,
`@object-ui/app-shell` and `@object-ui/console`, on this head: 0 `error
TS`.
- `eslint` over the changed files: 0 errors.
- `overlap-check.mjs` on this head: clean against origin/main
`493ad095`, objectstack-ai#36105 and objectstack-ai#35923.

Browser (showcase `objectstack dev --seed-admin --fresh`, console
`vite`, zh-CN, the seeded pending request on `EXP-2001`, opened as its
approver through `/system/approvals?request=`), before and after at 1280
and 375, light and dark, in the project thread's evidence folder:
- before: H1 `费用报告签批`, no link; Reject `bg-destructive`; timeline
`2026/11/21 10:09:5x`.
- after (shot on `a02cb373`, where the subject reads, so the gate added
since draws the same page; with objectstack-ai#35983's two-row header: the crumb row
reads 审批请求, the title row reads the record): H1 `EXP-2001`, linked to
`/apps/com.example.showcase/showcase_expense_report/record/…`; a click
opens `EXP-2001` in the record drawer; Approve filled, Reject outlined;
timeline `2026/11/21 下午1:37`, the same face as the strip's `更新时间` chip.

## Acceptance notes

- Read first, by risk:
`ui/packages/components/src/renderers/layout/containers.tsx`
(`hostTitle` / `chipTitle`, both faces),
`ui/packages/app-shell/src/views/approval-decision/approvalSubjectTitle.tsx`
and `recordReadReport.ts` (the link's read gate),
`ui/packages/app-shell/src/views/DeclaredActionsBar.tsx`
(`secondaryDanger`).
- Two-minute check: open a pending approval from the approvals inbox.
The top bar reads the record's name, not the flow's. Click it and the
record opens. In the band, 通过 is filled and 驳回 is outlined in red. The
审批动态 time reads like the strip's 更新时间.
- The subject link follows the page's record route, so it exists exactly
where the "As submitted" card's "Open record" link does: a subject
object the console can route to. Where it cannot, the title is the
record's name as plain text.
- Breadcrumb, recent items and favourites still name a request by its
own title (the flow), as lists and search do. Only the request page's
header names the subject.
- Observed, not changed: at 375 px the strip's `更新时间` value is cut
(`上午10:…`) in a half-width cell. That is the strip's layout, outside
this card.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (Not touched.)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgW5RH2VUXjRj9dZYH2

<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgW5RH2VUXjRj9dZYH2 -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…from a header icon; 动态 keeps system entries (objectstack-ai#36075) (objectstack-ai#36114)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu7W7AujnHuifjn8Luh1TnAA)_

repo:objectstack#1 · os-sales · session_01L6bhgXXdtDHm8mLZYX8Bsb

Part of objectstack-ai#36075

Clause-②: yes (widening): `@object-ui/plugin-detail` adds exports
(`CommentsPanel`, `CommentsButton`, `CommentThread`, `CommentItem`,
`CommentComposer`, `CommentHoverActions`, `useRecordComments`,
`buildCommentThreads`, `latestRepliers`, `RecordCommentsInPanelContext`)
and their types (`CommentsPanelProps`, `CommentsButtonProps`,
`RecordCommentThreadProps`, `CommentItemProps`, `CommentItemActions`,
`CommentComposerProps`, `CommentHoverActionsProps`, `CommentThreadData`,
`RecordCommentsData`), and an optional `reservedWidth` on
`useRecordPageTier`. `RichTextCommentInput` (exported) now takes the
`Esc` that closes its @ list (`preventDefault` and `stopPropagation`),
so nothing round it acts on that key. `RecordActivityTimeline` draws no
chip group when it is handed no chips. `@object-ui/components` adds an
optional `comments` slot to `RecordTopBar` and `NavigationOverlay`, and
the drawer leaves an `Esc` pressed inside a `[data-owns-escape]` region
to that region. `@object-ui/i18n` adds five keys to every pack:
`detail.closeComments`, `detail.collapseReplies`,
`detail.commentActions`, `detail.commentsEmptyHint`,
`detail.resolveThread`. Nothing existing is removed or re-typed.
Metadata-protocol: none

## 维护者速读

- 电脑端的记录页和记录抽屉,头部(编辑按钮左边)多了一个评论图标,旁边是这条记录的评论数(顶层评论条数;objectstack-ai#36071
合并后改成未解决的线程数)。点一下打开评论栏,再点一下关上;开着还是关着,浏览器会记住,记录页和抽屉各记各的。
- 评论栏宽 380:顶上「评论」和 ✕,中间是评论线程(最早的在上),评论框固定在最下面。一条评论有回复时显示「N
条回复」和最近回复人的头像,点开在原地展开,下面有回复框;在任意一条上点「回复」会展开这个线程、光标直接进回复框。
- 鼠标移到一条评论上,右上角出现一排操作:回复、表情、更多(自己的评论才有编辑、删除)。「已解决」按钮已经做好,等 objectstack-ai#36071
合并后再接上,现在不显示。
- 窗口 1280 及以上,评论栏放在记录右边,记录内容让出 380;窗口小于 1280,评论栏盖在记录右侧。抽屉默认宽
720,评论栏盖住整个抽屉内容(✕ 或 Esc 回到记录,焦点回到评论图标;从列表打开的抽屉也一样,抽屉本身不关);抽屉宽到 760
及以上才左右并排。
- 「动态」页签只剩系统条目(活动、字段变更),没有评论框,也没有「全部 / 活动 /
讨论」这三个筛选(卡上点名去掉的三个)。「变更」筛选照旧保留:记录开着字段历史时才有,点一下只看字段变更,再点一下回到全部。动态的数字也不再算评论。
- 只在平台默认记录页和只填插槽的页面上出现(方案 C,13:24Z)。完全手写的记录页不动:showcase 的
project-detail、sys-queue、sys-audit-log
三个页面照旧在页脚放讨论区;对象关了评论(`enable.feeds: false`)就没有图标。手机端这次不改,评论还在动态页签里,等
objectstack-ai#36076。

## What changes

**The comment components** (`@object-ui/plugin-detail`, new
`src/comments/`)

- `useRecordComments()` reads the record's discussion off the host's
`DiscussionContext` (the rows and the writes every feed block already
gets) and returns the threads, the icon's count (`null` while unknown:
loading, refused or failed), the loading, refused and failed states, and
each write exactly where the host hands it. Nothing reads or writes any
other way, so the phone's comment page (objectstack-ai#36076) can reuse every piece.
- `buildCommentThreads(items)`: the `comment` rows only, threads oldest
first, replies oldest first; a reply to a reply joins its thread; a
reply whose parent is not held (deleted) stays as a thread of its own,
so a delete never hides another member's reply.
- `CommentItem` (avatar, name, time, edited mark, text, reactions with
the viewer's own marked; an inline editor where Esc cancels and
Ctrl/⌘+Enter saves, the draft kept when the save is refused),
`CommentThread` (`expand` for the panel, `summary` for the phone's list;
actions handed out per comment through `renderActions`),
`CommentComposer` (keeps the draft when the write is refused;
`focusSignal` puts the caret in it), `CommentHoverActions` (the
desktop's one action row), `CommentsPanel`, `CommentsButton`. Every face
is objectstack-ai#36070's shared `CommentAuthorAvatar`.
- `RecordCommentsInPanelContext`: while the host sets it, the default
page's `record:activity` stream (the 动态 tab and the 概览 rail's 最近动态 card)
drops comment rows, its 全部 / 活动 / 讨论 chips and its composer (the 变更 chip
stays, on objectstack-ai#30074's rule, and pressed again goes back to every entry),
ignores a refused or failed comments read, and the tab row's count probe
(`RecordTimelineCountProbe`) counts the same rows. An authored
`record:activity` is untouched.
- **Esc** (L1-c rework at `09b716c8`): an `Esc` in the panel closes it
and puts the focus back on the comments icon. The `@` list's `Esc`
closes the list only (`RichTextCommentInput` now takes the key), so the
draft is kept. The panel closes on an `Esc` whose target is in its own
DOM; its portaled menus close themselves. `defaultPrevented` no longer
decides, because the drawer marks the key to hold itself open. The
section carries `data-owns-escape`.
- `useRecordPageTier(el, { reservedWidth })`: the tier is measured on
the width left after the panel takes its 380.

**The record page and the drawer** (`@object-ui/app-shell`)

- One predicate, `commentsPanelOffered`, in `RecordDetailView`: an
object definition with `enable.feeds !== false`, a page that takes the
default columns (no assigned page, not a blocked named page: option C),
not a phone, and a record id. It is the only place the rule lives.
- While the panel is offered, the discussion rides the record's open
request (`streamDiscussion`), so the icon's count is known without
opening the 动态 tab; activity stays lazy as before (`activityFeedWanted`
is the old `feedWanted`).
- `recordCommentsPanel.tsx`: the widths and thresholds
(`COMMENTS_PANEL_WIDTH` 380, `COMMENTS_PANEL_BESIDE_MIN_WINDOW` 1280,
`COMMENTS_PANEL_DRAWER_SPLIT_MIN_WIDTH` 760), `commentsPanelPlacement`
(`beside` / `over` / `cover`), the open state kept in `localStorage`
(`os:record-comments-panel:page` and `:drawer`, every access guarded),
and `RecordCommentsAside`.
- The icon sits in `RecordTopBar`'s new `comments` slot, ahead of the
button group, on the page; the drawer portals it into the same slot
through `RecordPaneBarApi.commentsSlot` (`RecordPaneBarComments`); a
pane without the bar draws it in the page header's trailing controls.

**Drawer width chosen**: the default drawer is `md` (720), under the 760
split threshold, so the panel covers the drawer's body there; a drawer
at 760 or wider splits, leaving the record at least as wide as the
panel.

**Strings**: `detail.closeComments`, `collapseReplies`,
`commentActions`, `commentsEmptyHint`, `resolveThread` in all eleven
packs and the provider-less defaults; everything else reuses existing
keys.

**Docs**: the plugin-detail README and
`content/docs/frontend/plugins/plugin-detail.mdx` describe the panel.

## Why

Card objectstack-ai#36075 (phase 1 of epic objectstack-ai#36062): comments were buried in the 动态 tab
beside system entries, so a reader had to switch tabs to see or join a
discussion. The card asks for a standalone comment panel on the desktop
record page and drawer, reached from a header icon, and an Activity tab
of system entries only.

## Side effects reviewers should know

- **Hand-written pages keep their old discussion** (option C, seat
13:24Z): showcase `project-detail`, `sys-queue` and `sys-audit-log`
still place a footer `record:discussion`, and get no icon. `sys-user`
and `sys-organization` have feeds off; `sys-approval-request` has no
discussion block on purpose. How a hand-written page opts into the panel
is a phase 2 card.
- **The 动态 tab keeps one chip on the desktop, 变更** (seat L2, 16:44Z):
the card removes 全部 / 活动 / 讨论 only, and 变更 (objectstack#30074) is merged
behaviour, offered on the same rule (only where the record shows its
field history). With no 全部 beside it, the chip is a toggle: pressed
again, it goes back to every entry. The phone keeps all its chips.
- **The 动态 count leaves the comments out** wherever the panel is offered
(page payload total less the comments it counted).
- The panel draws every comment the read holds, oldest first, with no
20-row page: a conversation is read to its end.
- Not in this PR: the resolved UI, the filter menu and the unresolved
count (wait objectstack-ai#36071, wired in a second PR if objectstack-ai#36071 is slow); until then
this PR is `Part of objectstack-ai#36075`. The shared avatar and the delete toast from
objectstack-ai#36070 are in: main was merged after objectstack-ai#36105 landed at 16:04Z. Reactor
names on hover are not on the card.

## Verification

**New tests (all pass)**

- `plugin-detail/src/comments/commentThreads.test.ts` (6): comment rows
only, oldest first; replies and a reply to a reply nested; an orphan
reply kept; same-instant order; a parent loop loses nothing; latest
repliers.
- `plugin-detail/src/comments/CommentsPanel.test.tsx` (13): oldest
first, system rows left out; collapse and expand; Reply focuses the
reply box and answers the thread's first comment; Edit and Delete only
on the viewer's own comment; More → Delete, More → Edit saves; React;
read-only offers no actions and no box; add, and the draft kept on a
refused write; ✕ and Esc; empty; refused and failed with Retry; the
icon's count and pressed state.
-
`plugin-detail/src/__tests__/recordActivity.commentsInPanel-36075.test.tsx`
(7): no comments or composer in the stream and 变更 the one chip, with the
control; the lone 变更 chip toggles back to every entry; no chip where the
record shows no field history; a refused comment read does not replace
the system entries; the count probe counts system entries only, with the
control; an authored `record:activity` untouched.
- `app-shell/src/views/recordCommentsPanel.drawerEscape-36075.test.tsx`
(8): the REAL `NavigationOverlay` around the REAL panel, at the stack's
root (a record opened from the list) and below it. Esc in the comment
box and on ✕ closes the panel, the drawer stays at its level, and the
focus returns to the icon. Esc in the `@` list closes the list only.
CONTROL: Esc on a record control outside the panel does what the drawer
always did. With either fix removed, its pins fail (4 of 8 without the
drawer change).
- `CommentsPanel.test.tsx` +2: Esc in the `@` list keeps the panel and
the draft, and the next Esc closes the panel; Esc in the More menu
closes the menu only. Both fail with their fix removed.
- `RecordDetailView.commentsPanel-36075.test.tsx` +1: Delete in the
panel goes through the page's confirm and toasts 「Comment deleted」
(objectstack-ai#36070).
- `app-shell/src/views/recordCommentsPanel-36075.test.ts` (2): the 1280
and 760 thresholds.
- `components/src/__tests__/record-top-bar-comments-36075.test.tsx` (2):
the slot sits ahead of the button group in both bar shapes.
- `app-shell/src/views/RecordDetailView.commentsPanel-36075.test.tsx`
(8), the real `RecordDetailView`: icon and count on the default page;
open beside at 1440 and close; over at 1100; kept open for the next
record; drawer cover, remembered apart from the page; the stream draws
no comment and the panel does, once; no icon with feeds off; no icon on
a hand-written page, which keeps its discussion.

**Changed tests**: 38 cases in 11 `RecordDetailView.*` files read the
default page's comments off the 动态 stream; they now read them in the
comment panel (same rows, same reads, same grants), and the counts drop
the comments: `feedLoading`, `feedRecordScope`, `feedLoadFailure-29188`,
`harness` (feedRefusal-11195), `replyCountOnRead-12144`,
`discussionExplicitComposition-7298`, `discussionFallbackPipeline-8983`,
`recordOpenOneRequest-28470`, `recordOpenWaves-13010`,
`recordPageTiers-26678` (变更 alone, a toggle, where `trackHistory` is on
and the audit read answers; no chip without it or on a 403),
`timelineCount-28737`. Authored-page cases in those files are unchanged.
No test deleted or skipped.

**Local runs**: every `app-shell/src/views/RecordDetailView.*`,
`recordDrawer*` and `components/src/custom` test file (98 files) pass,
the 11 above after their change and three that first failed to resolve
`@objectstack/client` before its build on a re-run; every new file above
passes. The whole app-shell, plugin-detail and components suites (3,274
files) did not fit a local run and were stopped; CI is the full reading.
`type-check` (src and tests) clean for plugin-detail, components and
app-shell; ESLint on every changed file: 0 errors; `check:i18n-keys`,
`check:i18n-drift`, `check:new-line-citations` pass;
`overlap-check.mjs`: clean against main and the 6 open PRs that share a
file.

**Browser evidence** (CRM example on `objectstack dev`, console on Vite,
zh-CN, an account seeded with three threads, one with two replies):
`/mnt/project-files/build-seat1/36075/` (seat-side folder).

| Reading | Result |
|---|---|
| Page, 1440, light and dark, panel closed → open | icon 「3」, pressed
when open; panel `beside`, 380 wide at x 1060; the record columns narrow
to leave it the width |
| Page, 1100, light and dark | panel `over`, 380 wide at the right edge,
record columns keep their width |
| Drawer (list → Initech), light and dark | the icon in the drawer's
record row; panel `cover`, the drawer body's whole width (718) |
| Thread states | 「2 条回复」 with the replier's face; expanded with the
reply box and 「收起回复」; hover row (回复, 表情, 更多) with 编辑 / 删除 open |
| 动态 tab | no 全部 / 活动 / 讨论 chips, no composer, no comment rows (shot
taken before the 变更 chip was kept) |
| A record with no comments | empty state with the hint, composer at the
foot |

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English (the 维护者速读 block is the
maintainer's summary, in the maintainer's language).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

Branch name is the harness-assigned `claude/project-thread-ks7hy1`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgXXdtDHm8mLZYX8Bsb)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgXXdtDHm8mLZYX8Bsb
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgXXdtDHm8mLZYX8Bsb -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
… drawer; lookup cells draw an edit button (objectstack-ai#36015) (objectstack-ai#36128)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuLB1HMq57UcoRZFjpa8YhHZ)_

repo:objectstack#1 · os-sales · session_01L6bhgWkLah49N6UoD4CS3S

Fixes objectstack-ai#36015

The card's 11:13Z revision (maintainer: 「同意,改卡」): a single click on a
lookup chip opens that record in the side drawer, and a lookup cell has
a pencil button. objectstack-ai#36033 landed the rest of the card with `Refs objectstack-ai#36015`;
this PR is the lookup-cell part and closes the card.

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

## 维护者速读

- 列表里单击关联记录的小标签(比如联系人列表里的「客户」),右侧抽屉打开那条记录,列表不动。关掉抽屉后,滚动位置和选中的格子都还在。
- 点格子里小标签旁边的空白,只是选中这一格。一格里有几个标签,点哪个开哪个;选中后按 Ctrl+Enter / Cmd+Enter
在抽屉里开第一个;按住 Ctrl / Cmd 点,仍是新标签页整页打开。
-
关联格在鼠标移上去或已选中时,右边出现铅笔按钮,点了进入编辑(出现关联记录选择器),和双击、回车一样。没有编辑权限、字段只读、记录被锁时不出现。这个位置原来放「打开」图标,关联格不再画它。
- 人员的小标签(负责人、创建人,指向 `sys_user`
的关联)不变:单击只选中,选中后有「打开」图标,没有铅笔。邮箱、电话、网址、名称列都不变。手机上照旧整页打开。
-
抽屉的网址带上了记录和它的对象(`?recordId=…&recordObject=…`):刷新后抽屉还在,按后退关掉抽屉,和名称列「在侧边打开」一样。
-
风险:改到五个包(字段格子、表格、网格、列表、控制台抽屉);给宿主加了两个可选接口,不传时行为和以前完全一样;没有新文案键(铅笔用已有的「编辑」`table.edit`)。

## What changes

On a grid with the select-first cell model whose host opts in (today the
console's list page), a **reference cell** is a column of `lookup`,
`master_detail` or `tree` type whose `reference` is not `sys_user`.

**`@object-ui/fields`: `index.tsx`**

- `ReferencedRecordLink`'s anchor carries `data-record-object` and
`data-record-id`, the record the chip names. Nothing else changes in its
markup or its click.

**`@object-ui/components`: `context/gridCellSelection.tsx`, `index.ts`**

- `GridCellSelection` gains an optional `referenceCells?:
GridReferenceCells | null`. `GridReferenceCells` (exported as a type) is
`isReferenceColumn(columnKey)` (asked per column on every render, so it
answers from the column alone) and `openRecord(objectName, recordId)`.

**`@object-ui/components`: `renderers/complex/data-table.tsx`,
`dataTableCellSelection.ts`**

- New `recordChipAt` / `firstRecordChip`: the record a chip
(`a[data-record-link][data-record-object][data-record-id]`) at or around
the target names.
- In a reference cell, the select-first `onClickCapture` that objectstack-ai#36033
added still cancels a plain click on the chip and selects the cell, and
then calls `referenceCells.openRecord` for the chip clicked. A click
beside the chips only selects. Ctrl, Cmd, Shift and Alt clicks, a
non-primary button and a touch tap pass through to the link as before.
- A double-click on a reference chip does not also edit the cell (its
first click opened the record).
- Ctrl/Cmd+Enter on a selected reference cell opens its first chip
through `referenceCells.openRecord`; every other cell keeps objectstack-ai#36033's
behaviour.
- New `CellEditButton` in every reference cell while no editor is open:
a pencil at the cell's right edge, labelled with the existing
`table.edit` key, shown on cell hover (`group-hover/cell`) and while the
cell is selected. Its click calls `attemptEdit`, the same gate
double-click and Enter pass through. It is drawn only when
`readOnlyReasonOf(row, col)` is `null`; that is asked when the pointer
enters the cell and when the cell becomes selected, never per render
(the `describeCell` contract). It takes no focus. A reference cell does
not draw objectstack-ai#36033's `CellOpenButton`.

**`@object-ui/plugin-grid`: `ObjectGrid.tsx`**

- New runtime prop `openReferencedRecord?: (objectName, recordId) =>
void`. With `cellSelection` and this prop, the grid's
`GridCellSelection` carries `referenceCells`: `isReferenceColumn` reads
the column's field (`opensReferenceInPlace`: lookup / master_detail /
tree, reference not `sys_user`), `openRecord` is the prop.

**`@object-ui/plugin-list`: `ListView.tsx`**

- New host prop `openReferencedRecord`, handed to the grid only
(`object-grid` views), as `recordLinkAdornment` is.

**`@object-ui/app-shell`: `urlParams.ts`,
`views/objectViewRecordNavigation.ts`, `ObjectView.tsx`,
`objectViewListRenderer.tsx`, `objectViewRecordOverlay.tsx`,
`recordDrawerStack.tsx`**

- New reserved URL param `RECORD_DRAWER_OBJECT_PARAM` (`recordObject`),
listed in `RESERVED_URL_PARAMS`: the object of the drawer root's record
when it is not the listed object.
- `handleOpenReferencedRecord(objectName, recordId)`: the listed
object's record opens as the name cell's 「在侧边打开」 icon opens it
(`?recordId=` only); another object's sets `?recordId=` and
`?recordObject=` (a push, so Back closes it). A chip clicked while the
drawer is open swaps its root.
- `drawerRoot` is that record when `?recordObject=` names another object
the console knows and the server reads one record of
(`servesRecordRead`); it has no sibling set, so the drawer draws no ↑ ↓
counter. Unknown or unread object: no drawer.
- Closing the drawer, the name cell's icon and the page origin a phone
redirect builds drop `?recordObject=` with `?recordId=`.
- The drawer's ⤢ at a root of another object opens that object's page
(`expandedRecordPath`); the listed object's root keeps its list-relative
route and origin.
- On a phone a `?recordObject=` link answers with that record's own
page, as `?recordId=` does for the listed object.
- `RecordStackDrawer` takes `listObjectName`; the list marks the root's
row as active only when the root is a record of the listed object.
- `ObjectView` passes `handleOpenReferencedRecord` only when its list
has the drawer (`navOverlay.mode === 'drawer'`, not a phone), the same
condition as `openInPanel`. A list whose rows open nothing (`none`, a
list-only object) keeps objectstack-ai#36033's behaviour: the chip only selects.

**Field types this reaches:** `lookup`, `master_detail`, `tree` drawn
through `LookupCellRenderer` / `ReferencedRecordLink`, when the
referenced object is routable from the list (the chip is an anchor only
then). A `user` field (`UserCellRenderer`, avatars) draws no link and is
untouched.

**Readings (claim A–G):**

- **A.** Only grids whose host passes `openReferencedRecord` (the
console's object list). Every other host keeps objectstack-ai#36033's behaviour.
- **B.** Ctrl/Cmd+Enter on a lookup cell opens its first chip in the
drawer.
- **C.** Person cells (lookups to `sys_user`) draw no pencil and keep
objectstack-ai#36033's open button.
- **D.** A chip clicked with the drawer open swaps the drawer's root, as
the name cell's icon does.
- **E.** A lookup to the listed object itself opens the listed object's
drawer, with `?recordId=` alone.
- **F.** A chip with no link (unroutable, unread, restricted or
name-only) only selects; an editable cell still draws the pencil.
- **G.** The drawer's record and object live in the URL, as `?recordId=`
does (ui `AGENTS.md` objectstack-ai#8).

Docs: `content/docs/frontend/plugins/plugin-grid.mdx` § On an object's
list page (new bullet after the click bullet; the click bullet objectstack-ai#36033
wrote now leaves out the lookup chip a host opens in place). objectstack-ai#36033's
changeset is untouched; this PR's own changeset says it (Notes, below).

## Notes

- **objectstack-ai#36033's pending release note is left as it is**
(`.changeset/36015-list-cell-click-only-selects.md`, restored from the
base in `87d42cbd`; head `b59bf991`..`9c225b51` had added a sentence to
it as a declared correction, which kept `Check Changeset` red). This
PR's own note, `.changeset/36015-lookup-chip-opens-in-drawer.md`, now
says what it changes about that note instead: "This replaces, for lookup
chips on that page, the earlier change in this release where a plain
click on a lookup chip only selected its cell." The docs bullet in
`plugin-grid.mdx` keeps the L1-b N1 rewording.

## Tests

Added, each a top-level `describe` in the component's existing harness
file:

- `components/src/__tests__/data-table-select-first-35684.test.tsx`, "a
reference chip opens its record in place": a plain click on the chip
calls `openRecord` with the chip's record, cancels the default and
selects the cell, and a double-click on it opens no editor; a click
beside the chip only selects, Ctrl and Cmd clicks follow the link;
Ctrl+Enter opens the first chip through the host; the edit button is
hidden until the pointer enters the cell, then shown on hover and while
selected, opens the editor, and the cell draws no open button; a cell
the host says opens no editor draws no edit button; a column the host
does not name (a person) keeps the link behaviour and the open button;
control: with no `referenceCells` the chip only selects and no edit
button is drawn.
- `plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx`,
"a lookup chip opens its record in the host's place": through
`ObjectGrid` with a routing host, the account chip carries
`data-record-object` / `data-record-id` and a single click calls
`openReferencedRecord('crm_account', 'a7')` without following the link;
the lookup cell's edit button opens its editor and the `owner_id`
(lookup to `sys_user`) cell draws none; a person chip only selects;
control without the prop.
-
`app-shell/src/views/objectViewRecordNavigation.listRows-27524.test.tsx`,
"a lookup chip opens the record it names in the list's drawer": the URL
params for another object and for the listed object, `drawerRoot` for
another object (no siblings), for an unknown object (`null`) and for the
listed object (siblings kept), close drops both params, ⤢ opens the
other object's page.

- After L1-b's S1 (fixed in `9c225b51`: a double-click on a chip opened
its record twice, so the console's router pushed the same URL twice and
the first Back left the drawer open). The grid opens a chip on a click's
first press only (`e.detail > 1` opens nothing), and
`handleOpenReferencedRecord` returns when the URL already names that
record of that object, which also covers a fast repeat click. Each test
below fails without the fix:
- `data-table-select-first-35684.test.tsx`, "a double-click on the chip
opens its record once": click, click (`detail: 2`), dblclick;
`openRecord` is called once and no editor opens.
- `objectViewRecordNavigation.listRows-27524.test.tsx`, "the record the
drawer already shows is not pushed again": no `setSearchParams` for the
record already shown, of another object or of the listed one; the same
id under another object still opens.
- same file, "in a router: a chip opened twice (a double-click) leaves
one history entry, and one Back closes the drawer": a declarative
`MemoryRouter` (it pushes on every navigate, the same URL included);
after two opens the URL names the record, and one `navigate(-1)` returns
to `?view=all`.

No existing test was rewritten or dropped.

Local runs. First on main `8145424b` merged with objectstack-ai#36033's head
`cefd3e31`, a full `pnpm build`:

- `vitest run packages/components/`: 501 files passed.
`packages/fields/`: 316 passed. `packages/plugin-grid/`: 298 passed.
`packages/plugin-list/`: 181 passed.
- `packages/app-shell/` in full did not finish inside this container's
50-minute window; the parts this diff touches ran:
`src/views/ObjectView*`, `src/views/objectView*`,
`src/views/__tests__/recordDrawer*`, `src/views/__tests__/recordPane*`,
`src/urlParams*`, `src/__tests__/`: 128 files passed.
- After objectstack-ai#36033 merged, the change was replayed on main `dc10b3b4` as one
commit (conflicts only in `objectViewListRenderer.tsx`'s memo
dependencies and the two appended describes of
`ObjectGrid.cellSelection-35684.test.tsx`, both sides kept), then a full
`pnpm build` and `vitest run` of `components/src/__tests__/data-table*`,
`plugin-grid/src/__tests__/ObjectGrid.cellSelection*`,
`app-shell/src/views/objectViewRecordNavigation*`,
`app-shell/src/views/__tests__/recordDrawer*` and `fields/src/`: 348
files passed (2 skipped).
- `type-check` in `components`, `fields`, `plugin-grid`, `plugin-list`,
`app-shell`: exit 0 (on both bases).
- `eslint` on the changed files: 0 errors.
- `overlap-check` on the pushed head `b59bf991`: clean against
`origin/main` (`dc10b3b4`, objectstack-ai#36033 merged) and the four open PRs sharing
a file (objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024).
- `87d42cbd`: `main` `6c7c6db2` merged in (clean).
`check-empty-changeset` and `check-changeset-no-major`: pass.
`overlap-check`: clean against `main` and objectstack-ai#36123; objectstack-ai#36133 (draft)
conflicts only on the one-line `useMemo` dependency list in
`objectViewListRenderer.tsx`, which each PR extends by one name; the
second to land merges `main`.

## Verification (browser)

CRM and Todo examples (`--fresh`), Console via Vite on this tree,
Chromium, 1280 light and dark, 375 light and dark. Screenshots and the
journey log: project folder `build-seat1/36015/PR2/` (`after-*`,
`after-journey.log`). The before state is objectstack-ai#36033's after state
(`build-seat1/36015/after-*`): a chip only selected its cell.

| Step | After |
|:--|:--|
| Contacts, hover the Account cell | pencil at the cell's right edge |
| Click the Acme Corp chip | drawer opens Acme Corp
(`?recordId=…&recordObject=crm_account`), the list stays, the cell is
selected |
| Close the drawer | params gone, the Account cell still selected |
| Click beside the chip | cell selected, nothing opens |
| Click the pencil | the lookup editor opens in the cell |
| Ctrl+Enter on the selected Account cell | drawer opens Acme Corp |
| Click the email text | cell selected, no navigation, open button in
the cell |
| Click the name | the contact's record page |
| Todo tasks, hover the Assigned To cell (lookup to `sys_user`) | no
pencil |
| Click the Dev Admin chip | cell selected, page stays, open button on
hover |
| 375 | phone cards (no grid), unchanged |

## Acceptance notes

1. Click a lookup chip: the drawer opens that record, the list stays,
closing it keeps scroll and selection: yes (browser).
2. Click beside the chip: the cell is selected, nothing opens: yes.
3. Hover a lookup cell: a pencil; it opens the cell's editor (the lookup
picker); none on a read-only field: yes (browser for the pencil and the
editor; read-only unit-pinned).
4. Person chips (owner): single click only selects: yes (browser, Todo's
Assigned To, a lookup to `sys_user`).
5. Ctrl/Cmd-click a chip opens the record in a new tab: yes (the click
passes through to the anchor; unit-pinned).
6. Email, phone, URL, Ctrl/Cmd+Enter on them and the name column:
unchanged from objectstack-ai#36033: yes.
7. This body lists the field types reached and the tests: above (none
rewritten).

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S

<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgWkLah49N6UoD4CS3S -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…es and publishes it; layout and row colour join the list draft (objectstack-ai#35955 PR 2) (objectstack-ai#36123)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuG6LywHEovAnGuZpiKQEc2W)_

repo:objectstack#1 · os-sales · session_01L6bhgWyeXh2Keywo6oK1Nn

Part of objectstack-ai#35955 (PR 2 of three: PR 1 objectstack-ai#36026 made a list change a draft;
PR 3 retires the server-side list preference and runs in parallel. The
card stays open.)

Clause-②: yes (widening) — five new `console.objectView.draft.*` keys in
every `@object-ui/i18n` locale pack (`saveToViewConfirmTitle`,
`saveToViewConfirm`, `saveToViewConfirmButton`, `savedForEveryone`,
`pendingDraft`); `@object-ui/plugin-list` `ListView` gains the optional
host prop `onRowColorChange` and two optional `viewDefaults` members,
`viewType` and `rowColor`; nothing removed or renamed
Metadata-protocol: none

## 维护者速读

- 共享视图上,能改这个视图的人(管理员,且视图所在的包接受保存)在「保存
▾」里也看到「保存到这个视图」:先问一次「所有用这个视图的人都会看到」,确认后存并立刻发布,提示「已保存,所有人可见」。选项菜单里的「保存」同一条路。
- 这个视图已有没发布的修改(谁存的都算)时什么都不写,提示先去视图设置里发布或放弃;不替任何人发布。保存人的行高、列宽不会写进共享视图。
- 显示面板的「布局」「行颜色」现在也是草稿:点开记录再回来还在,两条「保存」都会存进去,「放弃」还原成视图自己的。

## What changes

**Save to this view on a shared view** (`ObjectView.tsx`,
`objectViewViewCrud.tsx`, `runtime-metadata-persistence.ts`)

- Offered when `canSaveToSharedView`: not an environment list, not a
personal view, and the same test the footer calculation's pick uses
(`isAdmin && !activeViewPackageRefusesSaves && isSavedViewId(savedViews,
id)`), so a read-only package's view and the fallback tab never get it.
A personal view keeps its own save. The phone / narrow `Save ▾` is the
same component; the options menu's Save calls the same handler.
- It asks once through `confirmHandler` (`saveToViewConfirmTitle` /
`saveToViewConfirm` naming the view / `saveToViewConfirmButton`, cancel
`console.objectView.cancel`).
- The body is the view's own config with the draft laid over it
(`layListStateOverView`, split out of `buildPersonalViewConfig`), then
`buildViewConfigSaveBody`, the body the view settings panel saves. The
reader's row height is left out (`rowHeight: undefined` on the laid
preference, F5); column widths never travel.
- New `saveAndPublishRuntimeMetadata(type, name, body, ctx)`: a draft
write with the first-write pin (`{ mode: 'draft', ifNoneMatch: '*' }`),
then `publish`. A `409 METADATA_CONFLICT` on the write means a draft is
already pending; it resolves `'pending-draft'` and nothing is written or
published. A publish the server refuses discards the draft this save
wrote (`reset(type, name, { state: 'draft' })`) and rethrows. Caches are
invalidated and the draft ledger announced on both paths.
- `handleViewSaveAndPublish` shows the saved body at once
(`setViewDraft`) and lets `handleDraftBarChange` drop it when the
saved-views re-read lands (objectstack-ai#36031), so the list does not flash the old
sort. On `'published'` the list draft is dropped (`handleResetView`) and
"Saved, visible to everyone" is toasted; on `'pending-draft'` the draft
stays and `pendingDraft` is toasted.
- Using the server's pin instead of a client read of the draft closes
the read-then-write window the premise read named (P4). The window left
is between this save's draft write and its publish: the view settings
panel writes its draft without the pin, so a settings save landing in
those milliseconds would overwrite this draft and be published with it.
A known edge, not closed here: card objectstack-ai#36137.

**Layout and row colour join the draft** (`objectViewListRenderer.tsx`,
`ListView.tsx`, `personalViews.ts`)

- The renderer wires the published `onViewChange` to `listDraft.patch({
viewType })` and the new `onRowColorChange` to `listDraft.patch({
rowColor })`; picking the view's own value drops the entry. The draft's
values go to `ListView` as `schema.viewType` / `schema.rowColor`, and
the view's own through `viewDefaults.viewType` /
`viewDefaults.rowColor`, so the `layout` / `rowColor` parts and the
Display count still judge against the view after a remount.
- `ListView`: `onRowColorChange` fires on a pick in the row colour panel
(the rule in force) and on Clear (`null`), never at mount or for a
reset. Each new `viewDefaults` member is read only when its key is
present; without them nothing changes.
- Both saves read them: `PersonalViewListState.display` carries
`viewType` and `rowColor`; a layout switch retypes the view and fills
the kanban / gallery mirror from the saved columns when the block lacks
one (`IN_PLACE_COLUMN_MIRRORS`). Save as my view builds from
`listDraft.draft.viewType ?? activeView.type` and passes the row colour.

**i18n**: the five keys in all ten hand-written packs; zh-Hant
regenerated (`pnpm gen:zh-hant`).

**Docs**: `ui/packages/plugin-list/README.md` (new host-props section),
`content/docs/ui/views.mdx` (§ "A user's list state never writes the
view"), `docs/qa/platform-checklist/areas/records-forms.json`
`records-forms.adhoc-filter-sort-builder` revision 14 (steps[8],
acceptance[5], negative[4]; not loosened).

## Tests

- New `ObjectView.sharedViewSave-35955.test.tsx` (8): confirm, then
`save(... { mode: 'draft', ifNoneMatch: '*' })` then `publish`, body
carries the draft sort and the view's own row height `short` while the
reader's stored one is `tall`; cancel writes nothing; pending draft (409
`METADATA_CONFLICT`) writes nothing more and toasts; refused publish
resets the draft; a read-only package's view is not offered; layout and
row colour laid into the schema and `viewDefaults` and kept across a
remount; picking the view's own value drops it; the save retypes to
kanban with its columns mirror and the row colour.
- `runtime-metadata-persistence.test.ts` (+4): published; pending-draft;
a `409` with another code (`DESTRUCTIVE_CHANGE`) rethrows; refused
publish resets and rethrows.
- `ListView.personalization-28950.test.tsx` (+4): the `rowColor` part
judged against `viewDefaults`, a control without them,
`onRowColorChange` on pick and on Clear (`null`), and no call at mount.
- `ObjectView.personalViews-29635.test.tsx` (+1): the draft row colour
reaches the personal save and Save as my view.
- L1-b S1 (`ObjectView.sharedViewSave-35955.test.tsx` +3,
`ObjectView.personalViews-29635.test.tsx` +2): the confirm and Save as
my view's default name read the view's tab label (`listLabel`,
`viewTabLabel`), with a view that has no label and one whose label is a
locale map (plus a plain-label control on the confirm). Ablated: the raw
label turns the locale-map confirm case and both copy-name cases red. In
the shared-view harness a stored view with no label already arrives
named by its name, so that case is a pin, not a discriminator.
- `ObjectView.listUrlState-11860.test.tsx` (+2, G2): a reload whose
address was rewritten before the seed applies its `uf_*` state; a reload
on a record page then Back applies the list entry's `uf_*` state. Pins
of current behaviour, no behaviour change.

## Acceptance notes

- P3 (seat 14:28Z): any pending draft refuses, the saver's own earlier
draft too; the server does not record a draft's author.
- F5: a shared save never carries the saver's row height or column
widths; a personal save still carries the row height, as on main.
- The view settings panel and the footer calculation still save a shared
view as a draft that the view settings publish (ruling 7045525672
unchanged).
- Not touched: where column widths, row height and the view order are
stored (PR 3).
- Landing order with objectstack-ai#36133 (PR 3): both bump
`records-forms.adhoc-filter-sort-builder` to revision 14 and edit the
same section of `content/docs/ui/views.mdx`. Whichever lands second
renumbers to 15 and merges the two history entries.
- L1-b N1 taken: the pending-draft test is `isDraftVersionConflict` from
`DraftConflictDialog.tsx`, the predicate the other draft-door callers
use.

## Verification

CI and local runs at head `da8b797b`; the S1 commit's tests and type
check at `0ada6797`.

- CI: every check green (54 passed, 10 skipped by path), mergeable
clean. The first head (`433d7c02`) went red on four pins, each fixed in
its own commit: the `rowColor` firing control in
`object-view-unmirrored-keys-7779.test.ts` now reads `const
viewOwnRowColor = viewDef.rowColor ?? listSchema.rowColor;` (the relay
reads the view's own rule once, so the draft's can lie over it); the de
quote-pair count in `de-quote-pairing-3876.test.ts` goes 120 to 121 for
`saveToViewConfirm` („{{name}}“); three `viewDefaults` equalities in
`ObjectView.userListState-12418.test.tsx` gain `viewType`; a checker
narrowing in the new test is read through a cast. No pin was loosened:
each asserts the same thing at the new spelling.
- Local (`pnpm --dir ui exec vitest run` over
`app-shell/src/views/ObjectView*`, `runtime-metadata*`,
`personalViews*`, `listDraft*`, `plugin-list/src/__tests__/ListView*`):
237 files, 2290 tests; the only 3 failures were the `viewDefaults`
equalities above, 40/40 after the fix. `packages/i18n`: 105 files, 1962
passed. `packages/types` 7779: 236/236.
- `pnpm --dir ui/packages/app-shell run type-check` exit 0; `pnpm --dir
ui/packages/plugin-list run type-check` exit 0 (both include
`tsconfig.test.json`).
- eslint on every changed `ui/` source and test: 0 errors.
`check:i18n-keys`, `check:i18n-drift`, `check:control-bytes`,
`check:vi-mock-specifiers`, `check:vi-mock-override-shape`,
`check:metadata-write-doors`, `check:changeset-claims`,
`check:pending-changeset-literals`, `check:readme-exports`,
`check:new-line-citations` exit 0; `node
scripts/check-platform-checklist.mjs` OK.
- `node scripts/pm/overlap-check.mjs --base=origin/main`: clean against
main `dc10b3b4` and open objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024.
- Clause-② measured on the built
`ui/packages/plugin-list/dist/ListView.d.ts`: `onRowColorChange` and the
two `viewDefaults` members are added, optional; no member removed or
narrowed. The seat runs the declaration L2.
- Browser, at `0ada6797` (showcase `objectstack dev`, the `ui/` HMR
console pointed at it; checklist
`records-forms.adhoc-filter-sort-builder` steps[8]), on a shared view
the admin created and published (`showcase_task.team_tasks`, package
`com.example.showcase.custom`):
- admin, sort by Priority: Save offers "Save to this view"; the confirm
reads "Everyone who uses “Team tasks” will see these changes.";
confirming sends `PUT
/api/v1/meta/view/showcase_task.team_tasks?mode=draft` with
`If-None-Match: *` (200) then `POST …/publish` (200) and toasts "Saved,
visible to everyone"; Discard and Save go.
- a second reader who is not an administrator (`phone.demo@example.com`)
opens the view sorted by Priority, and after a sort of their own is
offered only "Save as my view". Control: on the read-only package's
`showcase_task.in_progress` the admin is offered only "Save as my view"
too.
- with a draft of the view already pending, the admin's confirmed save
gets `409` on the pinned `PUT`, sends no publish, toasts the
pending-draft hint and keeps Discard and Save; the pending draft is
still there afterwards and the live view unchanged.
- Not driven in the browser: the row height (F5) and the layout and row
colour round trip, pinned in the unit tests above.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01L6bhgWyeXh2Keywo6oK1Nn

---
_Generated by [Claude Code](https://claude.ai/code)_
<!-- signed: repo:objectstack#1 · os-sales ·
session_01L6bhgWyeXh2Keywo6oK1Nn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

评论(四)小修:点「回复」后光标进回复框;没设头像的显示姓名首字;提到人的选单跟着光标;删除后给提示

2 participants