Skip to content

feat(record-page): the comment panel resolves, reopens and filters threads and counts the unresolved ones; ✓ and Edit on others' comments appear only where the server admits them (#36075) - #36178

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-5vdwwn
Nov 21, 2026

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_01L6bhgT8AtWDue4oTFNAE6H

Fixes #36075

Clause-②: yes (widening): @object-ui/react's DiscussionContextValue adds three optional members, onResolveComment(itemId, resolved), moderatesComments and updatesOthersComments. @object-ui/types' FeedItem adds five optional members: resolved, resolvedById, resolvedByName, resolvedAt, mentionsViewer. @object-ui/plugin-detail adds exports useRecordVerdict (three-state; a definite allow is allowed with record.visible; useRecordEditable reads as before except that allowed: false beside a visible record now reads not editable), threadResolvable, threadResolved, threadInvolvesViewer, filterCommentThreads, unresolvedThreadCount, DEFAULT_COMMENT_THREAD_FILTER and the type CommentThreadFilter; RecordCommentsData adds resolvable, onResolveComment, moderates and updatesOthers, and its count is now the unresolved threads; CommentItemActions adds onResolve and resolved; CommentHoverActionsProps adds resolved; RecordCommentThreadProps['comments'] may carry onResolveComment, moderates and updatesOthers. @object-ui/i18n adds ten detail.* keys to every pack. Nothing existing is removed or re-typed.
Metadata-protocol: none

维护者速读

  • 评论栏里,每串评论的第一条在鼠标移上去时多了一个对勾。点一下这一串就标成「已解决」,从列表里消失,头部评论图标上的数字减一。再点一次可以恢复成未解决。
  • 谁能点对勾:自己发起的串,谁都能点。别人发起的串,只在服务器会接受时才显示对勾。现在只有管理员能点别人发起的串。原因是平台有一条底线规则:普通成员只能改自己创建的行,评论也算,而且这条规则在评论自己的规则之前执行。实测在开发环境里,普通成员标别人的串返回 403,标自己的返回 200。你 13:25Z 的裁定 A(能看记录的人都能标)要等后端单独一个 PR 才能真正生效,这个 PR 不改服务端。
  • 评论栏右上角多了一个筛选按钮,里面两个勾选:「显示已解决」打开后,已解决的串也显示出来,上面一行灰字「已由 某某 解决」,再点它的对勾就恢复。「只看我参与的」只留我发起的、我回复过的、提到我的串。筛选不记在浏览器里。全部都已解决时,评论栏说「没有未解决的评论」,并给一个「显示全部评论」的按钮。
  • 往已解决的串里再回复,这一串自动变回未解决。图标上的数字现在是未解决的串数。
  • 「更多」里的编辑和删除:
    • 自己的评论照旧(普通成员默认只有编辑:平台默认不给成员删评论的权限,这是另一张决定卡)。
    • 别人的评论:删除给能编辑这条记录、并且有评论删除权限的人。编辑还要服务器同意改别人写的行,现在也只有管理员。
    • 判断都问服务器,只有明确说「可以」才显示,没回来或出错就不显示。所以普通成员不会看到点了会被拒的按钮。
  • 服务端权限一行没改。老部署(评论表里没有「已解决」这一列)不显示对勾和筛选,数字数全部串,和以前一样。手写的记录页和手机端不变。

What changes

Resolved threads (@object-ui/plugin-detail src/comments/, the backend is #36071 / #36104)

  • commentThreads.ts: threadResolvable (a real top-level comment, and the host set resolved: a reply whose parent is gone cannot be resolved, the server refuses it), threadResolved, threadInvolvesViewer (the viewer started the thread, replied in it, or is mentioned in it: 评论(二)后端:一串评论可以标记「已解决」,可恢复,可按已解决和「我参与的」筛选 #36071's threadsInvolvingUser rule, read off the host's viewer-relative marks), filterCommentThreads with DEFAULT_COMMENT_THREAD_FILTER (showResolved: false, onlyMine: false), unresolvedThreadCount.
  • useRecordComments: count is the unresolved threads; resolvable says some thread here can be resolved; hands onResolveComment and moderates on from the context.
  • CommentThread: ✓ on the thread's first comment only (onResolve, reading 「恢复」 and pressed when resolved), on a thread the viewer started, and on anyone's only with updatesOthers (see the row floor below). A resolved thread carries data-comment-thread-resolved and a 「已由 X 解决」 line (data-comment-resolved-mark) above its first comment, the comment muted while collapsed. The resolver's name is the host's (resolvedByName), else the entry in a mention list the composer already loaded (never read for this), else plain 「已解决」. A refused resolve is swallowed here (the host has said so).
  • CommentsPanel: the filter menu (ListFilter, left of ✕) with two checkbox items, offered only while resolvable; held in state while the panel is open, never stored. With every thread filtered out it says 「没有未解决的评论」 (or 「没有你参与的评论」) and offers 「显示全部评论」.
  • CommentHoverActions: resolved turns the ✓ into the reopen control (aria-pressed). Its test hook changes value with it: data-comment-action="resolve" on an open thread, "reopen" on a resolved one. The panel's other new hooks are data-comments-filter, data-comments-filter-option="show-resolved" | "only-mine", data-comments-empty="filtered" and data-comment-thread-resolved; they are test hooks and carry no contract.

Edit and Delete on other people's comments (card item 6)

  • The comment hook (plugin-audit comment-access-hooks.ts, "Parent EDIT") lets a comment's author, or a caller whose by-id update of the parent record the explain engine admits, edit or delete a comment. The page asks the same question: useRecordVerdict(object, id, 'update'), a three-state reading of the verdict useRecordEditable fails open on (same cache, same in-flight sharing, same staling; useRecordEditable is now useRecordVerdict(...) ?? true). A definite allow is allowed === true together with record.visible === true, as the server admits a by-id write (L2 S3); an answer with allowed: false beside a visible record (an on-behalf-of session whose delegator is gone) now reads not editable for useRecordEditable too, which is the server's answer. moderatesComments is true only on a definite allow, and is asked once the panel is open, so a record whose object sets userActions.edit: false still sends no explain on open (chore(spec): re-classify the action.execute liveness entry dead (#13036) #13045). The page's own edit gates (approval lock, userActions.edit, predicates) are not the server's comment rule and do not join.
  • CommentThread offers Delete on a comment that is the viewer's own or, with moderates, anyone's; Edit on the viewer's own or, with moderates AND updatesOthers, anyone's; still only where the host hands onEditComment / onDeleteComment (the sys_comment grants).

The row floor (measured; the interim this PR ships)

  • The platform's wildcard floor owner_only_writes (default-permission-sets.ts, update, positions: ['org_member'], created_by == current_user.id) runs before the comment hook. sys_comment widens it for delete only (sys_comment_moderation); update is left under the floor on purpose. So the hook's resolve rule (feat(plugin-audit): a comment thread can be marked resolved and reopened #36104, ruling 7063285032) and its parent-editor rule are never reached for a rank-and-file member on someone else's row.
  • Readings on the CRM example with the security service on (one org, two org_member members; scripts and JSON in the evidence folder floor/):
    • a member who reads the record PATCHes { is_resolved: true } on the admin's thread: 403 PERMISSION_DENIED; on another member's thread: 403; on their own: 200;
    • a member who may edit the record PATCHes { body } on another member's comment: 403;
    • explain sys_comment update by id answers record.visible: false for a member on another person's comment, true on their own and for the admin.
  • The interim: RecordDetailView asks ONE explain, update of the first top-level comment the viewer did not write (updatesOthersComments), when the reader first reaches into the open panel (pointer or focus), so opening the record and opening the panel still read nothing more (Record page open: the discussion, the activity feed, the attachment count and the related rows' reference names arrive in the record's page payload, so one open is one request plus the shell's own reads #28470). The floor answers the same for every such row. ✓ and Edit on others' rows need its definite allow; pending, a refusal, an error, no explain service and a stale answer offer them on the viewer's own rows alone. Delete keeps its own gates (feedCommentDelete and moderatesComments), which the floor's delete widening already matches.
  • Not here: making ruling 7063285032 true for members is a server change (a resolve-only path past the floor), a separate backend PR after Sales answers the decision on editing others' comments. Delete was verified with a principal holding the sys_comment delete bit (the admin); member_default grants members none, so a member's More holds Edit only (a second decision card).

The record page (@object-ui/app-shell RecordDetailView)

  • The comment read already returns every column (no select, on both the record-page payload and the fallback find), so the rows' is_resolved, resolved_by, resolved_at map onto the feed item (commentResolutionOf), only where the row carries is_resolved. The resolver is named from the viewer or an author of the same discussion; any other resolver is named by ONE sys_user read of exactly those ids ($filter: { id: { $in } }, $select: ['id', 'name']), sent after the discussion is drawn and never twice for an id (L2 S2: the record-page payload has no expand for it, and the 50-user mention roster missed resolvers past it). A refused read leaves 「已解决」. mentionsViewer comes from the row's stored mentions (rowMentionsUser: a JSON id list, ids or { id } objects).
  • handleResolveComment: dataSource.update('sys_comment', id, { is_resolved }) and nothing else (the one update ruling 7063285032 admits for any reader), offered under the sys_comment update grant; the row changes from the stored record the server answers with, a refusal toasts detail.commentResolveFailed and changes nothing.
  • A reply into a resolved thread shows its first comment reopened (threadRootIdOf), as the platform stores it; a new comment is unresolved where the deployment stores resolution.
  • The icon's count is unresolvedThreadCount over the rows the page already holds from its one open request (Record page open: the discussion, the activity feed, the attachment count and the related rows' reference names arrive in the record's page payload, so one open is one request plus the shell's own reads #28470), not feat(plugin-audit): a comment thread can be marked resolved and reopened #36104's COUNT read: that would be a second request for an answer already on the page.

Strings: detail.reopenThread, threadResolved, threadResolvedBy, filterComments, showResolvedComments, commentsInvolvingMe, noUnresolvedComments, noCommentsInvolvingMe, showAllComments, commentResolveFailed in all eleven packs (zh-Hant regenerated) and the provider-less defaults.

Docs: the plugin-detail README and content/docs/frontend/plugins/plugin-detail.mdx describe resolved threads, the filter, the count, and Edit / Delete for record editors.

Why

Card #36075 items 3, 6, 7 and 8, owed by this second PR after #36114 (the panel, Part of #36075) and #36104 (the resolved backend, #36071) merged: resolve and reopen a thread, the 「显示已解决」 / 「只看我参与的」 filter, the icon counting unresolved threads, and Edit / Delete 「只对自己的评论,或有权限的人」.

Side effects reviewers should know

  • No server change and no permission change. Resolving rides the backend feat(plugin-audit): a comment thread can be marked resolved and reopened #36104 shipped, and moderating uses the server's existing parent-editor rule, each offered only where the server's row floor admits it today (above).
  • A deployment without the explain service shows ✓ and Edit on the viewer's own rows only, administrators included.
  • The moderation verdict fails CLOSED where useRecordEditable fails open: a deployment whose explain engine does not answer (501, network) shows Edit / Delete on the viewer's own comments only, though its degraded server mode might admit more. A permitted moderator there loses an affordance, never sees a refused one.
  • The old RecordActivityTimeline (hand-written pages, the phone) is unchanged: own Edit / Delete only, no resolve.
  • Overlap: overlap-check.mjs against main and 5 open PRs that share a file: clean, except feat(record-page): on a wide full page the details are pinned left beside the record's tabs; the right summary rail is retired (#35890) #36136, which already conflicts with main on RecordDetailView.tsx's @object-ui/plugin-detail import line; this PR adds its two names on a separate import so it adds nothing to that conflict.
  • Not in this PR: 「复制链接」 in the More menu (in the mock, not in the card's items), and reactor names on hover.

Verification

New tests (all pass)

  • plugin-detail/src/comments/CommentsPanel.resolved-36075.test.tsx (16): resolved threads hidden by default; ✓ on a top-level comment only; 「显示已解决」 with 「Resolved by Ada」 and the reopen control; 「只看我参与的」 keeps started / replied / mentioned; without updatesOthersComments, ✓ only on the viewer's own threads; the resolver named from a mention list already loaded, never read for it; all resolved → the note and 「Show all comments」; no ✓ and no filter where rows carry no resolved; no ✓ without the write; a moderator's Edit / Delete on another's comment; a moderator whose update of others' rows is refused gets Delete, not Edit; updatesOthersComments alone is not moderating; the CONTROL without moderation; none without the host's writes; the count is unresolved threads, and every thread with no resolution stored.
  • plugin-detail/src/useRecordVerdict-36075.test.tsx (6): true / false; allowed: false beside a visible record reads false, a visible record with no allowed reads undefined; undefined, never true, while pending, on non-OK, offline, and no record verdict; nothing asked when disabled; CONTROL useRecordEditable still fails open; one shared question.
  • app-shell/src/views/RecordDetailView.commentsResolved-36075.test.tsx (15), the real RecordDetailView: the icon counts 1 of 2 threads and the resolved one appears under 「显示已解决」 named; a resolver the page cannot name read by id, once, and named; no user read when every resolver is named; ✓ writes exactly { is_resolved: true } on the top-level row, the thread leaves, the count goes; a refused ✓ toasts and changes nothing; reopen writes { is_resolved: false } and the count returns; a reply into a resolved thread reopens it; another member's comment offers Edit / Delete on an explain allow, not on a refusal, not on an answer with no record verdict; ✓ on another member's thread beside a moderation refusal (N3); the row floor: ONE sys_comment explain, only once the reader reaches into the open panel; refused → no ✓ and no Edit on others' rows, Delete still, own rows unchanged; admitted → ✓ and Edit; no answer → own threads alone.
  • Reverse checks: with the moderation gate made fail-open (!== false), 「not offered on a guess」 fails; with the row-floor gate made fail-open, 「not on a guess: no answer offers ✓ on the viewer's own threads alone」 fails; with the old record.visible-only reading, the allowed: false case fails.
  • RecordDetailView.recordOpenOneRequest-28470 pins that opening the panel reads nothing more; the probe waits for the reader to reach into the panel for that reason.

Local runs (at c268e113, base main 6aacad95): every app-shell/src/views/RecordDetailView.*, recordDrawer*, recordCommentsPanel* file and the whole plugin-detail/src (504 files, 4,517 tests): all pass but one at the first reading, hiddenAffordanceVerdicts-13045 (the moderation verdict was asked on open where userActions.edit: false asks none); fixed by asking it once the panel opens, then that file and the comment files re-run green (7 files, 65 tests). type-check (src and tests) clean for types, react, plugin-detail and app-shell; ESLint on every changed file: 0 errors; check:i18n-keys, check:i18n-drift, check:i18n-stale-fill, check:new-line-citations pass; check:i18n / check:i18n-coverage answer exit 3 locally (they need a full pnpm build), CI reads them.

Local runs at the new head: plugin-detail/src and every app-shell/src/views/RecordDetailView.*, recordDrawer*, recordCommentsPanel* file: 504 files, 4,509 passed; the one failure (recordOpenOneRequest-28470, the probe on panel open) is fixed by asking on engagement, and those files plus plugin-detail/src/comments re-ran green (104 files, 837 tests). type-check clean for react, plugin-detail and app-shell; ESLint 0 errors on the changed files.

Browser evidence (seat-side folder /mnt/project-files/build-seat1/36075/pr2/):

  • the first set (README.md, light and dark: the panel, the filter, the count, 「已由 林晓 解决」, admin's Edit / Delete on a member's comment);
  • floor/: the row-floor readings above;
  • interim/ (README.md, light and dark), on the CRM example with the security service on:
    • a reading member on another member's thread: Reply and emoji only; on their own: ✓, and More → 编辑;
    • a record-editing member on another member's thread: Reply and emoji only;
    • the admin: ✓, and More → 编辑 / 删除;
    • E1: a member resolves their own thread, count 2 → 1, after reload 1, 「已由 林晓 解决」, reopen → 2;
    • S2: 「已由 Dev Admin 解决」 from one sys_user?filter=["id","in",[…]]&select=id,name&top=1 read.

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; pnpm lint passes.
  • 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: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the maintainer's summary, in the maintainer's language).
  • The Before Submitting list in CONTRIBUTING.md is done.

Branch name is the harness-assigned claude/project-thread-5vdwwn.


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgT8AtWDue4oTFNAE6H

…reads, counts the unresolved ones, and offers Edit and Delete on others' comments to a record editor (#36075)

- Rows' is_resolved / resolved_by / resolved_at (#36071) reach FeedItem;
  the check on a thread's first comment writes { is_resolved } alone.
- Filter menu: show resolved (resolver named) and only threads I'm in.
- Icon count is the unresolved threads; a reply reopens its thread.
- Edit and Delete on other members' comments only on the explain
  engine's definite allow of a by-id update of the record
  (useRecordVerdict, three-state; useRecordEditable unchanged).
- Ten i18n keys in every pack; README, docs page and changeset.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgT8AtWDue4oTFNAE6H
@github-actions github-actions Bot added size/xl 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
… census (#36075)

Resolve / reopen is a by-id update of the root sys_comment row, offered
behind the same feedCommentEdit row as Edit.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-21T19:20Z. The brief handed to the isolated declaration-face reviewer for PR #36178 (owed by Clause-②: yes (widening) in the claim amendment 7066923119 on #36075: new DiscussionContext members, feed item fields, an exported hook, new i18n keys). The record follows as its own comment.

Contract review brief — PR #36178 @ 9d503c614ec17c293a42dac946e3b781c348b9bf (card #36075)

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 #36075: its body and EVERY comment (rulings and earlier records included)
· also epic #36062 (body), ruling 7063285032 on #36071 (whoever can read the record may resolve and unresolve a thread), the PR 2 claim amendment 7066923119 on #36075, PR #36114 (merged, PR 1 of this card, and its L2 records: S2 = card item 6) and PR #36104 (merged, the resolved backend), bodies only, for context; ruling A on changeset levels (level follows the Metadata-protocol line; a Clause-② widening alone ships patch). Check in particular: the resolve write is registered in the permission census under the comment-edit row and said to be gated by the comment-edit gate. Is that consistent with ruling 7063285032 (read = can resolve), and does the server accept it from a reader? Also check that edit and delete on others comments are offered only when the server rule answers yes, and never on an error.
· PR #36178: its body, its file list, and the net diff against main at 9d503c614ec17c293a42dac946e3b781c348b9bf
· the check-runs on 9d503c614ec17c293a42dac946e3b781c348b9bf: 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-36178/ 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

维护者速读

评论栏的「已解决」和筛选界面做得完整:点对勾这一串收起、图标数字减一,「显示已解决」「只看我参与的」都有,截图里核对过。卡住的是权限,不是界面:
① 裁决是「能看记录的人就能标记已解决」。但平台对普通成员有一条底线规则:普通成员只能改自己创建的记录,评论也算。去掉别人发起的一串评论的「已解决」状态,就是在改别人的评论,这条规则很可能直接拒绝。这样普通成员点别人那串评论的对勾,会弹出「没有更新成功」。截图里的读者只标了自己发起的那一串,管理员不受这条规则约束,所以截图没有暴露问题。
② 同一条规则也管「有权改记录的人可以编辑别人的评论」:普通成员即使能改这条记录,编辑别人的评论也会被拒。删除另有一条放行规则,编辑没有。截图里演示编辑的是管理员。
先用开发环境实测两次就能确认。如果确实被拒,要不要给评论放开这条规则,需要你决定(卡上写的是「不改评论的权限」)。
L1 结论:暂停,等实测结果。

席位核对 — HOLD (L1-c) · repo:objectstack#1 · head 9d503c61 · 2026-11-21T19:26Z

Card: Fixes #36075. PR 1 #36114 merged as Part of, so this PR closes the card. It delivers the rest of items 6, 7 and 8. Declarations: Clause-②: yes (widening), Metadata-protocol: none, Skills-docs: none.

Gates:

  • CI is 52 success · 10 expected skip on 9d503c61, and mergeable is clean.
  • The branch is 5 commits behind main. A trial merge with origin/main is textually clean.
  • l1-face FLAGGED changeset for @object-ui/plugin-form. The only file it touches there is affordanceGrantMap-12082.test.tsx, a test that does not ship, so no changeset is owed. Accepted.

Hold: the two cross-author writes have not been proven against the platform row floor

The resolve and moderator controls ask the server for writes. By reading, the server's stock security refuses those writes to every rank-and-file member when the comment is someone else's. Nothing in the evidence or in #36104's tests exercises that path.

1. Resolving another member's thread.

  • The panel offers ✓ under feedGates.commentEdit, which is the sys_comment update grant (RecordDetailView.tsx:5979, census row handleResolveComment :: update → feedCommentEdit). The stock member set grants it (default-permission-sets.ts:887: allowEdit: true), so in practice every member who can comment sees ✓. That matches ruling 7063285032 at the grant level.
  • feat(plugin-audit): a comment thread can be marked resolved and reopened #36104's hook admits a resolution-only update under the read rule (comment-access-hooks.ts:1174, isResolutionOnlyUpdate → authorizeResolution). But the platform's wildcard row floor runs before the hook. owner_only_writes (default-permission-sets.ts:971) uses created_by == current_user.id on update with positions: ['org_member'], and the security middleware enforces it as a pre-image check on a by-id update.
  • sys_comment has a widening policy for delete only (sys_comment_moderation, :1338). The note above it (:1332-1336) says: "update is the other half … deliberately left under the floor."
  • So an org_member who sends PATCH sys_comment/<id> { is_resolved: true } on a thread started by someone else should get PERMISSION_DENIED (row-level security). The hook is never reached.
  • What the tests and evidence cover:
    • feat(plugin-audit): a comment thread can be marked resolved and reopened #36104's integration rig composes no security service (comment-resolution.integration.test.ts:11-14), and its access test uses a sharing double.
    • This PR's evidence (build-seat1/36075/pr2/shots2.cjs:76) has the reader resolve m2, a thread the reader created. That passes the floor trivially.
    • Admin is outside the floor's domain.
  • This is the same shape commit c25b2d5 measured for delete: a parent-gated comment rule, "dead in EVERY org-bound deployment", hidden by a rig with no org_member.

2. A moderator editing another member's comment (item 6).

  • moderatesComments is the record's three-state update verdict. That is the right reading of the hook's parent-EDIT limb.
  • The same owner_only_writes floor refuses an org_member editor's update of someone else's comment before that limb is asked. The evidence's moderator is admin@objectos.ai, who is outside the floor's domain.
  • So the body's sentence "a member is never offered a write the server refuses" does not hold for a rank-and-file record editor.
  • Delete is different: it passes sys_comment_moderation and is offered only under feedCommentDelete. That limb looks sound.

Readings that settle it. The rig in shots2.cjs already has crm_reader_local and an org-bound session (organization_id on the rows). Two calls, each pinned to 9d503c61, with the status and envelope recorded:

  • (a) The reader member sends PATCH /api/v1/data/sys_comment/<a1> { is_resolved: true }, where a1 is the admin's top-level comment.
  • (b) A second non-admin member who can update crm_account sends PATCH /api/v1/data/sys_comment/<m1> { body: … }, where m1 is the reader's comment.

What the outcomes mean:

  • Both 200: this hold lifts, and I'm wrong about the floor's reach. Add (a) to the evidence as the ruling's proof.
  • Either is 403: it is a premise gap in 评论(二)后端:一串评论可以标记「已解决」,可恢复,可按已解决和「我参与的」筛选 #36071 / feat(plugin-audit): a comment thread can be marked resolved and reopened #36104 (resolve) or in the census (moderator edit), not a code bug here.
    • The fix that makes the ruling true is a widening of the sys_comment update floor for org_member, the update twin of sys_comment_moderation. That is a permission change, the card says 「不改评论的权限」, and the note at :1332-1336 reserves it as "a separate decision". So it goes to the maintainer as a decision; neither the seat nor the dev thread rules it.
    • Until it is ruled, this PR should not offer what the server refuses. Two options, the seat's choice:
      • (i) Offer ✓ and moderator Edit only on the viewer's own rows, plus for principals the floor does not bind. The client cannot see positions, so this is likely impractical.
      • (ii) Park the PR on the ruling.

Read and found sound

  • useRecordVerdict / useRecordEditable. The two-state wrapper is ?? true over the three-state verdict, and every former setAllowed(true) path now yields undefined, which maps to true. Existing callers read byte-for-byte as before.
  • Resolve write.
    • It sends { is_resolved } only, on a root row only (row.parentId != null returns early).
    • The row changes only after the server answers, and it prefers the stored record's resolution.
    • A refusal shows a localized toast and re-throws. CommentThread swallows the error, so no unhandled rejection reaches the console.
  • Reopen on reply. threadRootIdOf walks to the held root (cycle-guarded) and clears the resolution locally, mirroring installCommentReplyReopens.
  • Gating on deployments that do not store resolution.
    • resolved is set only where the row carries is_resolved, and threadResolvable requires a boolean, so no ✓ and no filter appear there and the icon counts every thread (item 8's fallback).
    • A new top-level comment becomes resolvable at once where the stored row or the discussion shows the column.
  • Filter. The default hides resolved threads, the state is not stored, and an empty filtered list explains why and offers 「显示全部」. threadInvolvesViewer uses the author, reply and mention marks from 评论(二)后端:一串评论可以标记「已解决」,可恢复,可按已解决和「我参与的」筛选 #36071's rule. rowMentionsUser reads both stored shapes and fails closed.
  • i18n. Ten keys in all 11 packs.
  • content/docs/frontend/plugins/plugin-detail.mdx and the changeset: read sentence by sentence, and accurate apart from the sentence named in hold item 2.
  • No Twenty-shaped code. The phone is untouched by design (card: 「不做手机」).

L1 never replaces L2. This face is Clause-② widening on four published packages, so the seat decides whether a Fable L2 is 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: 9d503c614ec17c293a42dac946e3b781c348b9bf
Local-runs: none

Read: card #36075 (body, triage 7062843433, claim 7063212437, seat notes 7064072626 and 7065872338, claim amendment 7066923119), epic #36062 (body), ruling 7063285032 on #36071, PR #36114 (body and its two L2 records: S2 is card item 6) and PR #36104 (body), all for context. Also the PR body and file list (30 files), and the net diff 6aacad95..9d503c61 (1363 additions, 53 deletions; the merge base is the PR's stated base 6aacad95). Read for context only, never reviewed: plugin-audit comment-access-hooks.ts (the resolution limb and "Parent EDIT"), plugin-security explain-engine.ts (how allowed and record.visible are composed), and the unchanged parts of useRecordEditable.ts and RecordDetailView.tsx.

Gates. All 62 check-runs on 9d503c61 have concluded: 0 failed, 0 pending, 10 skipped (opt-in, path-gated or matrix rows), the rest success. These include Check Changeset, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Type Check UI, Test UI 1 to 16, Lint UI, Lint · ESLint, Build & E2E UI, Live E2E UI and Dogfood Regression Gate. The combined commit status reads pending only because it has no legacy statuses. No packages/spec/**, governed path or skills/** file is in the diff, so this is the declaration face, owed by the Clause-②: yes line.

① Derived judgments

Accept-set: who may resolve, and does the server take it from a reader. Right.

  • The census. affordanceGrantMap-12082 registers handleResolveComment :: update under feedCommentEdit, which is the sys_comment object-level update grant. The page offers the handler under the same row: onResolveComment needs feedsEnabled && feedGates.commentEdit.
  • The row is not the author-or-editor rule. feedCommentEdit stands for the update bit on sys_comment alone. The per-row author-or-record-editor rule lives on the server, in beforeUpdate.
  • The server takes it from a reader. In beforeUpdate, an update for which isResolutionOnlyUpdate(data) holds goes to authorizeResolution. That check passes the comment's author, or any caller who can read the record the thread is on. It never asks the parent-edit question.
  • The object-level update bit is still needed. The data path's CRUD check runs before the hook, and feat(plugin-audit): a comment thread can be marked resolved and reopened #36104's acceptance notes say so: "a custom permission set that grants create but not edit on sys_comment can post but not resolve … member_default grants edit".
  • So the gate matches what the server accepts.
    • A member who can read the record and holds the stock grants gets ✓ on anyone's thread. That is ruling 7063285032 as feat(plugin-audit): a comment thread can be marked resolved and reopened #36104 built it.
    • A member whose permission sets grant comment create but not update gets no ✓. The server would refuse that member.
    • Gating on feedComment (create) would follow the ruling's wording more closely, but would offer those members a write the server refuses.
  • The gates do not leak into each other. The ✓ is independent of the moderation verdict: it is offered with moderatesComments false, and the page's reopen case runs on another member's thread with no explain verdict.
  • The write itself is right. handleResolveComment sends exactly { is_resolved } by id on the top-level row, which is what isResolutionOnlyUpdate admits, and the page test pins it.
    • A reply is never sent: the handler returns on parentId, and threadResolvable requires the root to have no parentId, so an orphaned reply that stands as its own thread gets no ✓.
    • A refusal toasts and changes nothing.
  • The prose does not say what the code does (S1). Four texts call the resolve gate "whoever may comment on the record": the changeset, plugin-detail.mdx, the DiscussionContextValue.onResolveComment jsdoc, and the inline comment at the onResolveComment= call site ("resolve and reopen ride the comment grant"). The code gates on the update grant, and the census comment says so.

Accept-set: Edit and Delete on other people's comments (card item 6). Right, with one narrow gap (S3).

  • The question asked is the server's own. moderatesComments is useRecordVerdict(objectDef?.name, pureRecordId, 'update', commentsOpen) === true. That is the explain engine's record verdict for a by-id update of the parent, the same question the server's "Parent EDIT" limb asks.

  • It is three-state, and every uncertainty is undefined.

    • not asked: disabled, no object, or no record;
    • pending;
    • a non-OK answer: 401, 403 or 501;
    • an answer with no record.visible;
    • a network or parse failure;
    • an answer staled by a data change during the round trip.

    Only === true moderates, so an error never offers Edit or Delete. The pins: useRecordVerdict-36075 (pending, non-OK, offline, no record verdict), the page cases (allow, refusal, an answer with no record verdict) and the reverse check named in the body.

  • The handlers are unchanged. handleEditComment and handleDeleteComment carry no own-comment-only guard. editableComment adds the moderator limb, and both actions still need the host's onEditComment / onDeleteComment (the sys_comment update and delete grants).

  • The narrow gap (S3). startVerdict reads decision.record.visible alone, while the server's parentUpdateAdmits admits only when decision.allowed === true too.

    • In explain-engine.ts, record.visible is already false on capsDeny and on !crudAllowed.
    • But allowed also folds in !denyAll && !delegatorMissing, so an on-behalf-of session whose delegator is missing can read visible: true beside allowed: false.
    • There the panel would offer an Edit or Delete the server refuses. The refusal toasts, and no data is at risk.
    • Under the fail-open useRecordEditable this never mattered. A "definite allow" reading should match the server's conjunction.
  • Degraded deployments. Where explain is not served, the verdict fails closed, as the body's side-effects section states. That is the safe direction.

useRecordEditable (public), right: identical behaviour. It becomes useRecordVerdict(...) ?? true.

  • The old initial state was the cached value or true. The new one is the cached value or undefined, read as true.
  • Every old setAllowed(true) is now setVerdict(undefined), which also reads as true.
  • The answer path and its cache are unchanged.
  • The control case in useRecordVerdict-36075 pins the fail-open path.

hiddenAffordanceVerdicts-13045, right. The moderation question is asked only while commentsOpen, so opening a record whose userActions.edit: false keeps the page from asking still sends no explain. The body reports this fix.

Public surface. Each item is additive and named in both Clause-② lines. Right.

  • @object-ui/react DiscussionContextValue: adds onResolveComment? and moderatesComments?, both optional. The provider's memo depends on both.

  • @object-ui/types FeedItem: adds resolved?, resolvedById?, resolvedByName?, resolvedAt? and mentionsViewer?. All are optional and set only by the host.

  • @object-ui/plugin-detail adds these exports:

    • useRecordVerdict;
    • the five thread functions: threadResolvable, threadResolved, threadInvolvesViewer, filterCommentThreads and unresolvedThreadCount;
    • DEFAULT_COMMENT_THREAD_FILTER;
    • the type CommentThreadFilter.

    All go through both the comments/index.ts barrel and src/index.tsx.

  • RecordCommentsData: adds resolvable, onResolveComment? and moderates?. count now means the unresolved threads, which is declared.

  • CommentItemActions: adds onResolve? and resolved?. CommentHoverActionsProps adds resolved?. The Pick in RecordCommentThreadProps['comments'] gains two optional keys.

  • @object-ui/i18n: ten detail.* keys in all 11 packs and in DETAIL_DEFAULT_TRANSLATIONS. They are translated, not English copies. The name placeholder in threadResolvedBy is in every pack, and zh-Hant was regenerated.

  • @object-ui/app-shell: no new export. The changeset prose names its console behaviour:

    • the comment row's is_resolved, resolved_by and resolved_at mapped onto the feed item, only where the row carries is_resolved;
    • mentionsViewer read from the row's stored mentions;
    • a reply into a resolved thread drawn reopened;
    • a new comment unresolved where the deployment stores resolution;
    • the icon counting unresolved threads.

Old deployments, right. commentResolutionOf returns nothing unless the row has its own is_resolved. resolvable is then false, so there is no ✓, no filter menu, and unresolvedThreadCount counts every thread, which is card item 8's interim rule. The panel test pins it.

Tests, right. There are 26 new cases in three new files, and the census gains one entry. No test is skipped, deleted or loosened.

② Semver level

  • The level is right. Five published packages change: @object-ui/app-shell, plugin-detail, react, types and i18n. Each is listed as patch.
    • plugin-form changes only a test file, and publishes nothing.
    • content/docs/** is not a package.
    • Check Changeset is green.
  • Ruling A gives patch. Metadata-protocol: none is right: no spec, no metadata key, and no authorable property. A Clause-② widening alone ships patch.
  • Clause-②: yes (widening) is right, and the body and the changeset match word for word on what they enumerate. Nothing published is removed or re-typed. Every new member is optional, except RecordCommentsData.resolvable, and that type is a hook's return value.
  • The changeset prose is the CHANGELOG entry of all five packages. Its sentence "Anyone who may comment on the record may resolve" carries S1.

③ Boundary flags

The PR body has no open_questions entry. The dev's flags, the brief's two checks, and the card's items, in turn:

  • Resolve gate against ruling 7063285032 (brief), answered.
    • The server admits a reader, the update bit on sys_comment given.
    • The UI offers ✓ on exactly that bit, under the census's feedCommentEdit row.
    • The "same gate as posting" wording of the ruling is narrower in the server feat(plugin-audit): a comment thread can be marked resolved and reopened #36104 merged, where it is named. This PR follows the server, which is the right side to follow.
    • Only the prose is off: S1.
  • Edit and Delete only on a yes, never on an error (brief), answered. See ①: === true on a three-state verdict, pinned both ways. The narrow allowed gap is S3.
  • Fail-closed moderation where explain is not served (dev flag), answered. It is the safe direction and stated in the body. A permitted moderator there loses an affordance and never sees a refused one.
  • PR feat(record-page): a desktop comment panel beside the record, opened from a header icon; 动态 keeps system entries (#36075) #36114's carried S2 (card item 6, "或有权限的人"), resolved by this PR.
  • Card items 3, 7 and 8, answered.
    • The filter offers two checkboxes, 「显示已解决」 and 「只看我参与的」, and is not stored.
    • A resolved thread is hidden by default, marked with its resolver, and its ✓ reopens it.
    • The icon counts unresolved threads.
    • The all-filtered state shows its own note and a way back.
  • The browser acceptance for resolved threads, open for the seat (E1). The card's acceptance line (「点对勾,这一串消失…再点对勾恢复」) and its screenshot line are browser checks. The body points to a seat-side folder, "added as it is taken". Landing should wait until that evidence exists. This is not a contract item.
  • Not in this PR (「复制链接」, reactor names): answered. Neither is among the card's items. The old RecordActivityTimeline and the phone are unchanged, as stated.
  • SQL push-down.

Should-fix, non-blocking:

  • S1. Make the prose say the resolve gate the code uses. The changeset (this text becomes the CHANGELOG), plugin-detail.mdx, the DiscussionContextValue.onResolveComment jsdoc, and the inline comment at the onResolveComment= call site in RecordDetailView.tsx all say "whoever may comment on the record". They should say: the update grant on sys_comment, then any reader of the record (ruling 7063285032 as feat(plugin-audit): a comment thread can be marked resolved and reopened #36104 built it).
  • S2. The resolver's name joins against a roster capped at 50. Push it down ($expand resolved_by, or a by-id read of only the unnamed ids), or state the reason it is not.
  • S3. Match the server's conjunction on the moderation verdict. The "definite allow" reading should require decision.allowed === true beside record.visible === true, as parentUpdateAdmits does. One line in startVerdict; it is harmless to the fail-open caller.

Nits:

  • N1. One body line saying the icon counts held rows instead of feat(plugin-audit): a comment thread can be marked resolved and reopened #36104's COUNT, and why.
  • N2. data-comment-action changes value on a resolved thread's control, from resolve to reopen. The new data-comments-* and data-comment-thread-resolved hooks are not named. They are test hooks, with no effect on the contract.
  • N3. No page case pins ✓ on another member's thread beside an explicit explain refusal (stubExplain(false)). The reopen case covers it with no verdict. A refusal case would pin that the two gates stay apart.

Escalated: E1 (the browser evidence for the resolved-thread acceptance, before landing).

Must-fix: none.

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

VERDICT: PASS

… server admits them (#36075)

The platform's row floor lets a rank-and-file member update only the rows
they created, before the comment rules run, so a member's ✓ on a
colleague's thread and a record editor's Edit of a colleague's comment
were refused (measured 403 on the dev rig). The panel now asks the explain
engine once, on the first top-level comment the viewer did not write, when
the reader first reaches into the open panel; ✓ and Edit on others' rows
need its definite allow (new DiscussionContext.updatesOthersComments).
Delete keeps its own gate.

Also from the declaration review: the moderation verdict needs `allowed`
beside `record.visible` (S3); a resolver the page cannot name is read by id
from sys_user instead of the capped mention list (S2); prose says the gate
the code uses (S1); a page case pins the gates apart (N3).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgT8AtWDue4oTFNAE6H
@objectstack-fleet objectstack-fleet Bot changed the title feat(record-page): the comment panel resolves, reopens and filters threads, counts the unresolved ones, and offers Edit and Delete on others' comments to a record editor (#36075) feat(record-page): the comment panel resolves, reopens and filters threads and counts the unresolved ones; ✓ and Edit on others' comments appear only where the server admits them (#36075) Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

上次暂停的原因已经处理,处理方式是界面先按平台今天的真实规则给按钮。普通成员现在只在自己发起的那串评论上看到对勾,在自己的评论上看到「编辑」;别人的评论上不再出现点了会被拒的按钮。管理员照常都能看到。界面会先问一次服务端「这个人能不能改别人的评论」,后端将来放开以后,按钮会自动出现,不用再改界面。「能看记录的人都能标记已解决」这条裁决,要等后端单独的改动来兑现。那两项权限问题已经单独请你决定。另外,解决人的名字现在能正确显示。
L1 结论:通过。Fable 复核在并行进行,合并由席位安排。

席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head 59833c2b · 2026-11-21T20:34Z

Delta from: 9d503c61 (HOLD 7068026256). One commit, 59833c2b, 12 files. It implements the interim the seat adopted from the Fable review (build-seat1/36075/pr2/fable-decisions.md, 问题四). The server fix for ruling 7063285032, and the two permission questions, go to Sales separately. This PR makes no server change.

Gates:

  • CI is 55 success · 14 expected skip on 59833c2b. The Check Changeset re-run after the body edit completed success at 20:32Z.
  • The branch is 7 behind main, and a trial merge is textually clean.
  • l1-face flags changeset for @object-ui/plugin-form again. It is the same test-only file as at r1, so I accept it again.

The hold, resolved

  • Live readings (build-seat1/36075/pr2/floor/, security service on, plain org_member principals):
    • (a) Resolving another person's thread is 403, and resolving one's own is 200.
    • (b) A record editor editing another member's comment is 403.
    • explain on sys_comment update reads record.visible: false for a member on another person's row, and true on their own row and for an admin.
  • The gate (RecordDetailView.tsx, updatesOthersComments): one three-state probe, useRecordVerdict(COMMENT_OBJECT, <first top-level comment the viewer did not write>, 'update'), with === true required.
  • What each row offers (CommentThread.tsx):
    • ✓ appears on a root the viewer wrote, or on anyone's root where updatesOthers holds.
    • Edit appears on the viewer's own comment, or where moderates && updatesOthers.
    • Delete appears on the viewer's own comment, or where moderates. It is still behind feedCommentDelete, which matches sys_comment_moderation, the delete-only widening.
    • A pending answer, a refusal, an error or a missing explain service all fail closed to own rows only.
  • Evidence (interim/): reader, editor and admin, each on others' rows and their own, in light and dark.
    • shots3-report.json shows the four faces as stated: reader-others has no ✓ and no More; editor-others has Reply and emoji only; admin has ✓, Edit and Delete.
    • E1 shows a member resolving their own thread, with the count going 2 → 1 → reload 1 → reopen 2.
  • Tests: a describe pins the floor on others' rows with one probe, refused, admitted and no-answer cases, plus panel-level cases for each gate's split.

The rest of the delta, read

  • S3 (useRecordEditable.ts startVerdict): a definite verdict is now record.visible && allowed === true. A visible record with no boolean allowed returns undefined, which keeps the fail-open path, as before.
    • This touches every useRecordEditable caller. The only new outcome is visible: true, allowed: false, which now reads not editable.
    • That answer is the one where the server refuses the write: object-level allowed decides it, per explain-enforce-parity.test.ts and the D10 delegator case in explain-dependency-fault.test.ts. So it removes a button the server would refuse and never adds one.
    • It is declared in the changeset's Clause-② sentence and pinned in useRecordVerdict-36075.test.tsx.
  • S2 (resolver names):
    • When the page cannot name a resolver, it sends one sys_user read of exactly those ids ($select id,name, $top = count). The read goes out after the discussion is drawn.
    • Asked ids are remembered, and the names are reused on re-reads. A refused or failed read leaves the mark at 「已解决」.
    • The panel no longer triggers the mention-list read for this; it uses that list only if it is already loaded.
  • S1 (prose): the changeset, plugin-detail.mdx, the README and the DiscussionContext jsdoc now state today's truth. A member resolves only the threads they started until the server carries 7063285032 past the floor.

Nit (does not block)

  • plugin-detail.mdx says "Edit and Delete are on your own comments" and "Delete for a member who may edit the record". Under member_default, a member holds no sys_comment delete bit, so a stock member sees no Delete at all, not even on their own comments (owndelete-report.json). The panel already hides it correctly. The sentence could say Delete needs a delete grant. It is open as Sales's question 3, so it can ride that card.

L1 never replaces L2. This is a Clause-② widening face, and the seat's Fable L2 delta runs in parallel.

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: 59833c2b83fd2ff199d38040cdc9be377e33795c
Local-runs: none

This is a DELTA record over the PASS record on 9d503c61. It covers one commit, 59833c2b ("offer ✓ and Edit on others' comments only where the server admits them"): 12 files, 362 additions, 61 deletions, with no merge from main. Everything outside these 12 files stands as judged on 9d503c61.

Read for this delta:

  • the diff 9d503c61..59833c2b, and the new PR body and title;
  • L1-c HOLD 7068026256;
  • the dev-rig readings in the seat's floor/ folder (floor-report.json and explain2-report.json with their scripts);
  • for context only, never reviewed: default-permission-sets.ts (owner_only_writes, owner_only_deletes, sys_comment_moderation), recordPagePayload.ts (how the explain verdict is seeded) and record-page-routes.ts.

Gates. All 70 check-runs on 59833c2b have concluded: 56 success, 14 skipped, 0 failed, 0 pending, read at 20:34Z. Check Changeset was the last to finish, green.

Correction to the 9d503c61 record. That record said in ① and ③ that "the server takes it from a reader". That was wrong for every rank-and-file member resolving a thread someone else started.

  • The wildcard RLS floor owner_only_writes binds org_member on update (created_by == current_user.id).
  • The security middleware enforces it as a pre-image check, before feat(plugin-audit): a comment thread can be marked resolved and reopened #36104's beforeUpdate hook is reached.
  • sys_comment_moderation widens delete only, and the note above it says update "is deliberately left under the floor".
  • The rig confirms it. The reader resolving the admin's thread, and resolving a member's thread, each get 403 PERMISSION_DENIED (a_readerResolvesAdminThread, a2_readerResolvesMemberThread). The reader resolving their own thread gets 200 (a0). The editor editing the reader's comment gets 403 (b).
  • The 9d503c61 record read the hook and the CRUD grant, but not the row floor. On that head, the ✓ on others' threads and the moderator's Edit offered members writes the server refuses. The L1-c HOLD caught this.
  • That record's verdict on the resolve gate is withdrawn. The judgment below replaces it.

① Derived judgments

The floor probe (updatesOthersComments). Right: it cannot admit a button the stock floor refuses.

  • What it asks. useRecordVerdict(COMMENT_OBJECT, foreignRootCommentId, 'update', …) is one record-grained explain of update on the first top-level comment the viewer did not write. The explain record path folds the pre-image floor into record.visible; its Layer 1 is the floor decision, by security-plugin-explain-access.ts's own account.

  • The rig agrees. explain2-report.json asks update on m1 as the editor, a row the editor did not create. It answers with decidedBy: rls and business_rls:excludes, matching the 403 on the write.

  • Fail closed. Only === true admits. Pending, a refusal, an error, no explain service and a stale answer all read as not admitted. Combined with the S3 fix below, "admitted" now needs both allowed and record.visible.

  • Representative. Under the stock floor, the one row stands for every foreign row. The predicate is created_by == me, and every foreign row fails it the same way for an org_member. Every principal outside the floor's domain passes it the same way.

  • Gated per action, matching the server's layers:

    • ✓ on another's thread needs updatesOthers. Past the floor, the hook's resolve limb admits any reader.
    • Edit on another's comment needs moderates && updatesOthers. Past the floor, the hook's parent-EDIT limb applies.
    • Delete keeps feedCommentDelete && moderates. For delete the floor is owner_only_deletes, which sys_comment_moderation widens for org_member, and then parent-EDIT applies. So Delete correctly does not read the update probe.
    • Own rows are unchanged: created_by is the viewer, so the floor admits them.
  • Pins. CommentsPanel.resolved-36075 has 16 cases and the page file has 15, including:

    • refused: no ✓ and no Edit on others' rows, Delete still, own rows unchanged;
    • admitted: ✓ and Edit;
    • no answer: own threads only;
    • updatesOthers alone is not moderating.

    The body names a reverse check: with the floor gate made fail-open, the no-answer case turns red.

  • One narrow edge (N-D1). The probe picks its row by authoredByViewer, that is author_id. The floor reads created_by.

    • The create hook stamps both from the session, so they agree on every row a client posts.
    • An imported row, or an app-authored per-row write policy on sys_comment (the ADR-0105 deferral), could make the one probed row unrepresentative.
    • The failure mode is a refusal toast. No data is at risk.

No read on record open or panel open. Right.

  • The probe is enabled only by commentsOpen && commentsEngaged && foreignRootCommentId != null.
  • commentsEngaged is set by RecordCommentsAside's onPointerEnter and onFocusCapture. Neither CommentsPanel nor CommentComposer moves focus into the panel when it opens (focusSignal fires only on a reply).
  • The page case pins it: no sys_comment explain after mount, none after opening the panel, exactly one after engaging twice.
  • recordOpenOneRequest-28470 is untouched by the delta and green in Test UI.
  • Engagement is keyed to feedRecordKey, so another record asks again.
  • One cost (N-D2). Where the data-change bus reports a write to the probed row, useDataInvalidation stales the key: a ✓ or Edit on that very row. Others' ✓ and Edit then vanish until one more explain answers. This is the existing staling rule, and it is harmless.

S3 and the useRecordEditable behaviour change. Right, safe, and declared.

  • The new rule in startVerdict:
    • visible not a boolean: undefined, as before;
    • visible: false: false, as before;
    • visible: true with allowed not a boolean: undefined, which useRecordEditable reads as true;
    • otherwise the verdict is visible && allowed === true.
  • The one changed outcome is allowed: false beside visible: true. It now reads false for useRecordEditable too.
  • Safe. explain-engine.ts composes allowed = !capsDeny && crudAllowed && !denyAll && !delegatorMissing. In every such case the by-id write is refused, so a hidden affordance hides only a write that would fail.
  • No regression for seeded verdicts. record-page-routes.ts hands security.explain's whole decision, allowed included, to seedRecordVerdict. A seeded verdict cannot fall into the undefined arm and silently stop moderating.
  • Declared in the PR body and in the changeset's Clause-② line, with the on-behalf-of example, and pinned in useRecordVerdict-36075: the allowed: false case and the missing-allowed case.

S2, resolver names. Right.

  • The mention-roster lookup is gone (CommentThread no longer asks onMentionSuggestionsWanted).
  • In its place is one sys_user read per discussion load: id $in exactly the unnamed resolver ids, $select: ['id', 'name'], $top the id count.
    • It is sent after the rows are set, so the panel never waits on it.
    • Ids already asked are never asked again (resolverIdsAskedRef), and the names it learns seed later re-reads (resolverNamesRef).
    • A refused read leaves 「已解决」.
  • The reason for not pushing the join further down is given: the record-page payload has no expand for it. A by-id $in of known ids is the pushed-down form.
  • Pinned: the read is sent once and the resolver named; no read when every resolver is already named.

Public surface. Additive, and named in both Clause-② lines. Right.

  • DiscussionContextValue.updatesOthersComments?, with the provider memo updated.
  • RecordCommentsData.updatesOthers?, and updatesOthers in the Pick of RecordCommentThreadProps['comments'].
  • RecordCommentsAside's onEngage? is internal to app-shell.
  • No i18n key is added, and nothing is removed or re-typed.

S1, the prose. Mostly right, with one residue (S-D1).

  • These now say the sys_comment update grant, plus the floor's interim:
    • the changeset;
    • plugin-detail.mdx;
    • the README;
    • the onResolveComment jsdoc;
    • the call-site comment in RecordDetailView.tsx.
  • The residue. The jsdoc on handleResolveComment itself, RecordDetailView.tsx at about line 4234, still reads "the one update whoever may comment on the record is admitted to (maintainer ruling record 7063285032)".

N1, N2, N3: answered.

② Semver level

  • Unchanged and right: five packages at patch, Metadata-protocol: none, ruling A.
  • Clause-②: yes (widening) still holds. The new members are optional.
  • The useRecordEditable change is a refusal made real at the consumer, not a capability removed. It hides only an affordance whose write the server refuses. It is declared in both lines. A patch-level fix is right.
  • The changeset prose now says what ships:
    • members resolve only threads they started, until the server carries ruling 7063285032 past the floor;
    • Edit on others' comments is administrators' today.

③ Boundary flags

  • The ruling and the card's promise, escalated (E-D1, to the seat; not blocking).
    • With this head, ruling 7063285032 ("anyone who can see the record may mark a thread resolved") holds for administrators only. For an org_member on a thread someone else started, the floor refuses it.
    • Card item 6's 「或有权限的人」 for Edit is likewise administrators only.
    • The PR is honest about both: the body's "Not here" line and the changeset.
    • But it carries Fixes #36075. Before the card closes, the seat should make sure the floor decision (a resolve-only path past owner_only_writes, and whether a record editor may edit others' comments) is a filed card the maintainer can answer. The card's 不改评论的权限 makes it the maintainer's decision.
    • Two items for that follow-up:
  • E1 from the 9d503c61 record: answered. The body lists browser evidence, and the HOLD reads the screenshots as checked.
  • SQL push-down: no finding.
    • The resolver read is a by-id $in of known ids, with the reason for not using an expand given.
    • The floor probe is one explain, not a read of rows.
    • The delta adds no in-app join.

Must-fix: none. The HOLD's defect, offering writes the floor refuses, is closed on this head: ✓ and Edit on others' rows need the floor probe's definite allow.

Should-fix, non-blocking:

  • S-D1. Bring the handleResolveComment jsdoc in RecordDetailView.tsx level with the other five texts.

Nits:

  • N-D1. Pick the probe's row by created_by != viewer, the floor's own predicate, rather than by authoredByViewer. Or say in the body why the two never differ.
  • N-D2. A write to the probed row re-asks the probe, and others' ✓ and Edit hide until it answers.

Escalated: E-D1 (the floor decision as a filed, maintainer-answerable card before Fixes #36075 closes the card, plus #36104's changeset wording).

Implemented-by: claude/project-thread-5vdwwn
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

Seat landing · 2026-11-21T20:37Z · #36075 PR 2, the desktop comment panel: threads resolve and reopen, the filter shows resolved threads or only the ones involving me, the icon counts unresolved threads, and Edit and Delete on others' comments follow what the server admits. PR 1 was #36114.

Premise found in review: the owner_only_writes row floor refuses an ordinary member's update of another member's sys_comment row, so ruling 7063285032 (any reader may resolve) and card item 6's "or people with permission" hold today for administrators only. The dev-rig readings are in the PR body. Per the seat-requested Fable review, this PR ships the interim: one explain probe on a foreign root comment, fail closed, so no button the server refuses is ever offered. The server-side fix is carded as #36186 and waits for the maintainer's answer on whether record editors may edit others' comments; whether members may delete their own comments is a second open maintainer question.

Reviews:

Gates on this head:

  • Clause-②: yes (widening), all new members optional; Metadata-protocol: none; patch.
  • check-governed-merges --pr 36178 reads NOT governed (1725 changed lines).
  • The seat read K by hand: 7 first-parent commits since the merge base. The PR touches no translations/ or skills/ path.
  • 56 check-runs are success, 14 skipped. Mergeable is clean.

The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #36075; the remainder is #36186.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 20:37
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 4ab2c82 Nov 21, 2026
71 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-5vdwwn branch November 21, 2026 20:58
os-sales pushed a commit that referenced this pull request Nov 21, 2026
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…s their own comments, through two server doors (objectstack-ai#36186, objectstack-ai#36191) (objectstack-ai#36200)

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

repo:objectstack#1 · os-sales · session_01L6bhgUH1jEKbDzYRc4nghq

Fixes objectstack-ai#36186
Fixes objectstack-ai#36191

Clause-②: yes (widening) — `@objectstack/plugin-audit`'s `AuditPlugin`
mounts two new HTTP routes, `PUT /api/v1/comments/:id/resolution` and
`DELETE /api/v1/comments/:id`, and the resolution stamp reads a system
write's `provenance.attributedUserId`. `@objectstack/core`'s
`OwnRowDeleteDoor` adds the optional `refuseRemoval(row, engine,
context)` (step 7, after the owner check). `@object-ui/react`'s
`DiscussionContextValue` adds the optional `ownCommentDeletesOnly`;
`@object-ui/plugin-detail`'s `RecordCommentsData` adds the optional
`ownDeletesOnly`, which `RecordCommentThreadProps['comments']` may
carry; `@object-ui/core`'s affordance-to-grant map adds the row
`feedCommentDeleteOwn`. Nothing existing is removed or re-typed.
Metadata-protocol: none

## 维护者速读

-
普通成员现在能给**任何**自己看得到、也能在上面发评论的评论串点对勾(标成已解决),也能恢复。以前只能点自己发起的串,别人发起的只有管理员能点。点了以后「已由
某某 解决」写的是点的人。这就是你 13:25Z 的裁定 A(能看记录就能解决,门槛和发评论一样)真正生效。
- 普通成员现在能**删自己的评论**。以前成员的「更多」里只有编辑。删别人的评论还是不行,能编辑记录也不行;管理员照旧。
-
**自己的评论下面已经有回复(不管是谁回的,自己回的也算),就不能删**(可以改文字)。原因:平台删一条顶层评论时会把下面的回复各自变成独立的串,等于改动了别人的评论,这不符合你
21:59Z 的裁定(别人的评论删不了)。座位核过,认为这是裁定本身的结论,不再单独问你。管理员有删除权限,删法和以前一样。
-
评论的文字照旧只有作者能改。平台的底线规则、删除权限一行没动:两个新的服务端入口各只做一件事(一个只改「已解决」,一个只删自己的那一行)。走原来的数据接口,成员改别人评论、改别人的「已解决」、删任何评论,仍然是
403。
- 只能看评论、不能发评论的人(比如只给了只读权限的外部成员),**点不了对勾**,控制台也不显示对勾。审核指出裁定 A
里同时写了「能看记录的人」和「和发评论同一道门槛」,座位定了按后者,较窄。普通成员都能发评论,所以对他们没有区别;能发评论的外部成员照样能点。
-
已知限制:删评论时「下面有没有回复」的检查和真正删除是两步。如果恰好在这一瞬间有人发了回复,这条回复会变成独立的串,和今天管理员用数据接口删评论时一样。平台的数据引擎没有「条件删除」可以把两步并成一步,套一层事务在默认隔离级别下也挡不住别的请求插进来的回复,所以先写明,不在这次改。

## What changes

**The resolution door** (`plugin-audit` `comment-routes.ts`, objectstack-ai#36186)

- `PUT /api/v1/comments/:id/resolution`, body exactly `{ "resolved":
boolean }`. Order: caller (the own-row doors' one composition,
`ownRowDeleteCallerResolver`), anonymous `401`, held sign-in `403`, any
query parameter or other body `400 VALIDATION_ERROR`, the comment read
AS THE CALLER (object grant + organization wall + the comment read gate;
unreadable and unknown both `404 RECORD_NOT_FOUND`), the posting gate
(the security service's `canWriteObject('sys_comment', 'insert',
caller)`: a caller who reads comments but may not post one is `403
PERMISSION_DENIED`, a check that throws refuses, and a deployment with
no security service has no posting gate either; ruling 7063285032 names
"the same gate as posting a comment", contract review F1), a reply `400`
(`refuseResolutionOnReply`, the data door's sentence), then a system
write of `{ is_resolved }` alone by id, `attributedUserId` = caller, the
caller's organization kept. Answers `200 { id, is_resolved, resolved_by,
resolved_at }` read back as stored.
- `stampCommentResolution` (`comment-resolution.ts`): on a system write
the resolver is `provenance.attributedUserId` (the audit writer's own
read of the attribution), so `resolved_by` names the door's caller. A
non-system write still stamps its session user; a system write with no
attribution still stamps `null`.
- Untouched: `owner_only_writes`, `sys_comment_moderation`,
`member_default`, the data door's resolve limb (objectstack-ai#36104). No
`sys_comment` update twin: a row policy cannot scope a column, so one
would also admit a member's edit of a colleague's words, which ruling
7069889899 keeps author-only.

**The own-comment delete door** (same file, objectstack-ai#36191)

- `DELETE /api/v1/comments/:id` on `@objectstack/core`'s shared own-row
delete door; owner column `author_id`. Another member's comment `403
PERMISSION_DENIED`, even for a record editor (the moderator's delete
stays the data door's, behind the delete grant).
- Step 7, new in the kit: `OwnRowDeleteDoor.refuseRemoval`, asked after
the owner check. The comment door's refuses a comment with any reply
under it (a system read of `parent_id = id`), `409 DELETE_RESTRICTED`:
`parent_id` is a lookup that clears on delete, so the removal would turn
each reply into a thread of its own, a rewrite of other members' rows.
The other three doors on the kit declare none and are unchanged. Known
limit (contract review F2): the reply check and the removal are two
engine calls and the data engine offers no conditional delete to join
them (wrapping both in a transaction would not close it either: at the
stores' default isolation another request's reply insert still lands
between the probe and the delete), so a reply posted within that one
request is promoted to a thread of its own, the same result as an
administrator's data-door delete today; stated in the module doc.
- Both doors mount beside the unreact door (`mountCommentDoors`, renamed
from `mountUnreactDoor`); one `warn` names all three routes when no HTTP
server is registered. Ledger rows in `comment-route-ledger.ts` (`gap`:
the console is the consumer, the SDK has no method), with their
conformance test; `scripts/check-route-envelope.mjs` declares the
module.

**Console** (`RecordDetailView`, `plugin-detail`, `react`, `core`)

- ✓ calls the resolution door and is offered on every thread, the
viewer's and anyone else's, under the `sys_comment` create grant (the
door's posting gate), wherever the rows store resolution; it no longer
depends on `updatesOthersComments`. The explain probe of a foreign
`sys_comment` update stays, and gates Edit on someone else's comment
alone.
- Delete: with the `sys_comment` delete grant, the data door as before
(others' comments included where the viewer moderates). Without it, the
new affordance row `feedCommentDeleteOwn` (`grant: 'create'`, as
`feedReactionRemove`) hands Delete over, it calls the own-comment door,
and the host sets `ownCommentDeletesOnly`: `CommentThread` and the
legacy `CommentBody` then offer Delete on the viewer's own comments with
no reply and on nobody else's, whatever `moderatesComments` says. So the
panel offers exactly what the doors admit.
- `handleResolveComment`'s jsdoc says what the write is now (L2 S-D1 on
objectstack-ai#36178). `affordanceGrantMap-12082`: `handleResolveComment` is no longer
a data-source write site (its row is gone); `feedCommentDeleteOwn` is in
the grant table.

**Prose**: `plugin-detail.mdx` (Delete wording; ✓ on every thread; the
own-comment door). The two unreleased notes of objectstack-ai#36104
(`36071-comment-threads-resolved.md`) and objectstack-ai#36178
(`36075-comments-resolved.md`) stay as written; the new changeset
`36186-36191-comment-doors.md` ends with one sentence for each, naming
the line it replaces.

## Why

Ruling 7063285032 (any reader may resolve) never reached a rank-and-file
member: the row floor runs before the comment hook (L1-c HOLD
7068026256, readings in objectstack-ai#36178). Ruling 7069889899 kept comment text
author-only, which rules out loosening the floor for `update`, and added
the own-comment delete (`member_default` may carry no delete bit,
ADR-0090 D5). Shape agreed in the premise read and the seat's claims
7069978538 / 7069989751.

## Verification

- `plugin-security` `comment-doors.integration.test.ts` (16 cases, real
kernel + `SecurityPlugin` with the shipped sets + `AuditPlugin` + the
real caller resolution, SQLite, two plain `org_member` principals, an
`org_admin` and two `org_external` principals with explicit grants):
member resolves and reopens a colleague's thread (200, `resolved_by` =
member, cleared on reopen); data door unchanged (member's `body`,
`is_resolved`, `{ is_resolved, body }` on a colleague's comment all
403); reply 400; unreadable = unknown 404; anonymous 401, query and
every malformed body 400; own delete 200; colleague's 403 and stays; own
comment with a reply 409, root and reply unchanged; own reply 200; own
comment on an unreadable record 404; an external who reads the thread
but may not post is 403 on resolve and still reads the comment, an
external who may post resolves (200); member's data-door delete of their
own still 403; admin resolves through the data door (floor does not
bind) and the comment rule still decides edits.
- `plugin-audit`: `comment-routes.test.ts` (mount, pre-engine answers,
the write's exact shape and context; +4 for the posting gate: refused
403 with no write, a throwing check refuses, an unreadable comment still
404 before the gate, a poster resolves), `comment-resolution.test.ts`
(+2: attribution stamps a system write; never outranks a session user),
`comment-route-ledger.conformance.test.ts`; unreact ledger unchanged.
`core`: `own-row-delete-routes.test.ts` (+3: step 7 refuses before any
removal, runs only after the owner check, resolving admits).
- UI: `RecordDetailView.commentsResolved-36075` also pins no ✓ for a
viewer without the `sys_comment` create grant.
`CommentsPanel.resolved-36075` (✓ on others' threads without the floor
verdict; own-door Delete matrix),
`RecordDetailView.commentsResolved-36075` (✓ → door URL and body, no
data-source update; refused ✓; member without delete grant deletes
through the door, none on others', none on own-with-reply; refused door
delete), `RecordDetailView.feedCommentEditDelete-12268` (the
no-delete-grant pin now asserts the door, plus own-with-reply). Local:
app-shell comment/feed/discussion/reaction/explain RecordDetailView
files + all of `plugin-detail` + `react` context: 437 files, 4067
passed.
- Typecheck: `plugin-audit`, `core`, `plugin-security` clean.
`check-route-envelope`, `check-single-authz-resolver` green.
`check-governed-merges --test` on the file list: not governed.
- Rig readings, CRM dev server (`objectstack dev --fresh`). Before: the
objectstack-ai#36178 hold readings at `a2dc85896` (reader and a record editor, both
plain org members). After: this branch at `dd9f5571`; a fresh rig is
`invite_only` now, so the admin creates both members through `POST
/api/v1/auth/admin/create-user`, the reader with `viewer_readonly` and
the record editor with `crm_sales_user`.

  | Reading | Before | After |
  |---|---|---|
| Member resolves the admin's thread | data API `403 PERMISSION_DENIED`
| door `200`, `resolved_by` = the member |
| Member resolves a colleague's thread / reopens it | data API `403` |
door `200` / `200`, `resolved_by` and `resolved_at` cleared |
  | Member resolves a reply | n/a | door `400 VALIDATION_ERROR` |
| Member's data-API `is_resolved` on the admin's thread | `403` | `403`
(unchanged) |
| Record editor edits a member's comment (data API) | `403` | `403`
(unchanged) |
  | Member edits the admin's comment | `403` | `403` (unchanged) |
  | Member deletes own comment, data API | `403` | `403` (unchanged) |
  | Member deletes own comment, door | n/a | `200 { deleted: true }` |
| Member deletes a colleague's comment, door | n/a | `403
PERMISSION_DENIED` |
| Member deletes own comment with a reply, door | n/a | `409
DELETE_RESTRICTED`, root and reply kept |
| Colleague deletes that reply, door; member then deletes the root | n/a
| `200`, then `200` |
| Admin edits / resolves / deletes a member's comment (data API) | `200`
| `200` / `200` / `200` (unchanged) |

Rows left on the record afterwards: the admin's thread (resolved by the
member), the record editor's thread (reopened); nothing else. Script and
report: `build-seat1/36186-36191/rig/doors.cjs`, `doors-report.json` in
the project files.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No `packages/spec` change.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (eslint on the touched
files: 0 errors.)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (Two folded cards, one `Fixes` line each.)
- [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. (The 维护者速读 section is
the maintainer's Chinese summary, as on this seat's other PRs.)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

## Follow-ups

- None filed. A "comment deleted" placeholder that would let an author
remove a comment that has replies is a product question of its own
(needs a stored marker), not in scope. Contract review F3 (the console
asks the create grant for own-comment Delete while the door asks none)
is left as is, consistent with `feedReactionRemove`.

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

https://claude.ai/code/session_01L6bhgUH1jEKbDzYRc4nghq

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…side the record's tabs; the right summary rail is retired (objectstack-ai#35890) (objectstack-ai#36136)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
Fixes objectstack-ai#35890

_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuSuWjKV41568rAPVdLLNa2U)_

repo:objectstack#1 · os-sales · session_01L6bhgUZTwDqtEFzNFCVTri

Part of epic objectstack-ai#35590 (record page redo). One PR for the card.

Clause-②: yes (widening): `RecordPageColumns` (exported from
`@object-ui/plugin-detail`) gains the optional props `fullPage`,
`detailsWidth`, `onDetailsWidthChange` and `onShownTabChange`, and
`onEnlargeRelated` an optional second argument `{ replace?: boolean }`.
`rightColumn` and `rail` stay on the props as `@deprecated` no-ops, so
no caller breaks. New exports: `RECORD_PAGE_DETAILS_WIDTH`,
`RECORD_PAGE_PIN_MIN_WIDTH`, `recordPagePinsDetails`;
`recordPageTierHasRightColumn` stays exported and is now `@deprecated`.
`@object-ui/i18n`: two new keys in every pack
(`detail.approvalPendingStep`, `detail.detailsColumnResize`), and
`detail.recordTabOverview` changes its text (概览 / Overview → 详情 /
Details); every key the retired rail read stays in every pack, unread.
The `RecordSummaryRail` module was internal (never exported from the
package entry) and is deleted.
Metadata-protocol: none

## 维护者速读

- 记录整页够宽时(放得下左 320 + 间隔 24 + 右
400),字段固定在左栏,其他页签(子表、附件、审批、动态)在右边,默认打开第一个;左栏默认 400,空间紧时自动让到
320,可以拖动,宽度按对象记在浏览器里。
- 右侧摘要栏(审批 / 附件 / 最近动态 / 其他相关卡片)在所有宽度都去掉了,⊟ 按钮和 ⌘⇧, 快捷键一起去掉;第一个页签改名「详情」。
- 「审批中」标签在有当前步骤时显示「审批中 · 当前步骤」(审批人自己仍是「待你审批」)。
-
抽屉、手机、窄窗口不分栏,照旧是一栏页签;它们也会看到两处变化:右侧摘要栏没了,第一个页签叫「详情」。手写的记录页不受影响;字段里放了子表的页面(objectstack-ai#35889)不分栏。
- 隐藏了的子表仍能从「更多」或带 `?related=` 的链接打开。
- 实测:1440 宽、左侧导航展开、评论栏打开时,内容只有 708,不够 744,页面退回一栏页签(打开的页签保持不变)。1280 和
1366 评论栏打开仍分栏。Sales 已接受这个代价,收起导航即恢复三栏(objectstack-ai#35890 note 7069882604)。等 objectstack-ai#36112
改成 1280 起默认展开导航后,1280 和 1366 展开导航再打开评论栏也会退回页签,收起导航即恢复三栏。

## What changes

**When the page pins.** Ruling on the card ([comment
7064066204](objectstack-ai#35890 (comment)),
option 0 of the reviewed decision card): a full page pins its details
when its content fits **left 320 + gap 24 + right 400** (744 content
px). The left column is 400 px (or the reader's dragged width) and
narrows by itself to 320 px to leave the tabs 400 px; narrower than
that, the page falls back to the tab row. This replaces the card's line
「沿用出现右栏的宽度」. Pinning is measured on the page content's own width
(`clientWidth`, ResizeObserver), never on the window, so the comment
panel of objectstack-ai#36075, which gives way at window widths of 1280 and up,
narrows the page and the page re-decides by itself.

What that means on common windows, **measured** in the console against
the CRM example (`measure-l1c.json`; the page frame is the window minus
the nav minus the host's 48 px margin, and the content is the frame
minus its 48 px padding; at 1280 and 1366 the nav is collapsed, at 1440
it is open at 256 px; comment panel 380 px, `beside`):

| Window | Frame, panel closed | Panel closed | Frame, panel open |
Panel open |
|---|---|---|---|---|
| 1280 | 1232 | pinned, details 400 / tabs 760 | 852 | pinned, details
380 / tabs 400 |
| 1366 | 1318 | pinned, details 400 / tabs 846 | 938 | pinned, details
400 / tabs 466 |
| 1440 | 1136 | pinned, details 400 / tabs 664 | 756 (content 708) |
**not pinned**: the tab row, with 「详情」 first and the shown list kept |

The earlier 1440 row (record area 1184, tabs 412) assumed no host
margin; the measured frame is 48 px narrower, so with the nav open and
the panel open the content is 708, under 744, and the page uses the tab
row. Windows of about 1416 to 1475 with the nav open and the panel open
land here. This follows the ruled threshold as written, and Sales
accepted it: with the sidebar expanded, opening the comment panel can
return the fields to the tab row, and collapsing the sidebar restores
three columns ([note
7069882604](objectstack-ai#35890 (comment)),
with objectstack-ai#36112 F1). These windows hold for today's sidebar threshold
(expanded from 1416). Once objectstack-ai#36112 PR B makes the sidebar start expanded
from 1280 (ruling 7069868269), the band with the sidebar expanded
becomes about 1280 to 1475, so 1280 and 1366 also go to the tab row when
the panel opens; collapsing the sidebar still restores three columns.
The 1416 comment in `recordPageColumns.ts` is updated by objectstack-ai#36112 PR B.

**Layout, pinned.** `[details 320–400+ px] [24 px separator] [tabs
minmax(0,1fr)]`. The details render at one field column
(`DetailsColumnCapContext` = 1). The tab row moves into the right column
and drops 「详情」; the open tab is the address's `?related=` when it names
one, otherwise the first tab (implied, never written). Each column
scrolls on its own when the page has a scroll parent with room
(`usePinnedHeight`). Esc does not close a tab while pinned (there is no
"back to details" to go to).

**The separator.** `role="separator"`, `aria-orientation="vertical"`,
`aria-valuenow/min/max`; pointer drag previews and commits on release;
←/→ move 16 px, Home/End go to the ends. The width is the
`record.columns.details-width` workspace preference (per object, `{
width, v: 1 }`), which replaces the retired `record.columns.related` (⊟)
preference.

**Narrowing out.** When a pinned page narrows below the threshold on the
same record and the address names no tab, the implied tab is written to
the address with `replace`, so the reader stays on what they were
looking at and Back history does not grow.

**Not pinned.** A page with no other tab draws the details alone, with
no tab row. A page whose details hold a related table among the fields
(objectstack-ai#35889) does not pin. Drawer, split pane and phone (`fullPage` false or
too narrow) keep the one-column tab row and never pin. What reaches
them: the rail is gone there too, and the first tab reads 「详情」.
Measured: drawer at 1440 (details 622 across, 「详情」 shown) and phone at
375 (details 327 across, 「详情」 shown), both with no rail.

**Rail retired.** `RecordSummaryRail` is deleted with the ⊟ panel
toggle, its `⌘⇧,` shortcut and the `record.columns.related` preference;
the attachment-count hook and approval-pending test move to
`recordTabBadges.ts`. The `PanelToggles` plumbing stays (empty) for
objectstack-ai#36075. The hidden-list foot line under the rail goes too; hidden lists
and the reset are in the tab row's 「更多」 menu. The "default order
changed" hint stays, under the tab row. A hidden list still opens, from
its 「更多」 item or from `?related=` naming it (`requested` accepts ids in
`resolved.hidden`; test red without the fix).

**Other card items.** The overview tab is labelled 「详情」 in every locale
(`detail.recordTabOverview` takes the `detail.details` word). The
in-approval tag reads `In approval · {{step}}`
(`detail.approvalPendingStep`, 11 locales) for non-approvers when the
request names a step, using the approvals panel's own `stepDisplayText`.

**Host.** `RecordDetailView` passes `fullPage={!embedded}`, the width
preference and `onShownTabChange`. When the shown tab is the 动态 timeline
(implied or chosen), the full activity window is read, as it was when
the tab was chosen. Feed reads at open are unchanged (the page payload
still asks discussion + activity top 5 for the tab's count), to stay out
of objectstack-ai#36075's way. Merged with `main` after objectstack-ai#36114 and objectstack-ai#36178 (the comment
panel, PRs 1 and 2), keeping both sides: the rail's 最近动态 card that
objectstack-ai#36114's `RecordCommentsInPanelContext` note spoke of no longer exists.
`overlap-check.mjs` at push (`241f4b21`): clean against `main`, objectstack-ai#36187,
objectstack-ai#36123 and objectstack-ai#35923; it conflicts with objectstack-ai#36183 (objectstack-ai#36047 slice 2, the
text-size sweep) in `RecordSummaryRail.tsx` (deleted here), the e2e spec
(renamed here) and two plugin-detail tests. Whichever lands second
resolves it; objectstack-ai#36183 re-runs its mapping script on `main`.

**Docs.** `content/docs/ui/pages.mdx` (Record pages › The synthesized
default) now describes the tab row, the pinned layout and when related
rows are read, instead of the right column.

## Acceptance notes (card checklist)

- Wide full page: fields left, other tabs right, first of them open. ✔
(`RecordPageColumns.test.tsx` pinned block; `recordPageTiers-26678` at
1440 / 1100 / 800 px)
- No other tab: fields fill the page, no tab row. ✔
- Right summary cards removed at all widths. ✔ (every tier asserts no
`[data-record-summary-card]`)
- Left column 400, draggable, remembered per person per object. ✔
(keyboard + pointer tests; host test writes and re-reads the
preference). Kept in the browser's workspace preference store, like the
other record-page preferences.
- First tab 「详情」. ✔
- 「审批中 · 当前步骤」. ✔ (`approvalDeclaredActions` test, machine name and
label)
- Body-table page does not pin. ✔
- Narrowing keeps the tab (URL replace). ✔ (measured: 1440 with the
panel opened wrote `?related=crm_activity.account`)
- A hidden list opens from 「更多」 and from `?related=`. ✔
(`readerArrangement-35595`, red without the fix)
- Drawer / phone never pin and keep the one-column tab row; what reaches
them is the rail's removal and the 「详情」 name. Hand-written pages
untouched. ✔
- Deliberate drops: the ⊟ control and `⌘⇧,`; the hidden-list foot line
(its job is in 「更多」); the rail's three-row previews of each related list
(a list now reads its rows when its tab opens).

## Why

Sales asked for the record page they remembered: on a wide full page,
the main form on the left and the child tables in tabs on the right
(objectstack-ai#35890, under epic objectstack-ai#35590). The width rule was put to Sales after a
decision review because the card's 760 px reading and the 1120 px
reading both broke the comment panel layout on common laptops; option 0
keeps three columns (fields | tabs | comments) on every common laptop,
which is the figure Sales approved on objectstack-ai#36075.

## Verification

- Local, on the merged head `079c7723` (shared box, under
`os-verify-lock`): plugin-detail, i18n, app-shell Record*,
recordCommentsPanel, relatedListConditions and workspacePreference: 647
files / 6,742 tests pass; app-shell type-check (src and tests) clean. On
`241f4b21`: plugin-detail + i18n 509 files / 5,677 tests pass, both
type-checks clean, `record-tabs-35595.spec.ts` 6/6 locally. Earlier, on
`fbe6e33d`: `vitest run packages/plugin-detail packages/i18n`: 500 files
/ 5,598 tests pass (31 skipped, existing). `vitest run
packages/app-shell/src/views/Record
packages/app-shell/src/utils/workspacePreference`: 133 files / 1,005
tests pass. The whole app-shell suite did not fit the 28-minute local
window; CI is the full reading.
- `type-check` (src and tests) clean for plugin-detail, i18n and
app-shell; ESLint `--quiet` on every changed file: 0 errors;
`check:test-source-alias` OK.
- Rewritten / converted tests: `RecordPageColumns.test.tsx` (new pinned
describe: threshold 744, auto-narrow 824→400 / 800→376 / 744→320 /
743→not pinned, drag, keyboard, drawer never pins, body table, narrowing
writes the implied tab with replace, `onShownTabChange`),
`RecordDetailView.recordPageTiers-26678` (host at 1440 / 1100 / 800 /
720 / 390, embedded, `?related=timeline` pinned and not, width
preference round-trip), `workspacePreference.test.ts` (details-width
codec). Deleted with the code they pinned:
`RecordPageColumns.switches-27052`,
`RecordDetailView.panelToggles-27052`.
- Tests that read the rail now open the 动态 tab or assert its absence:
`recordOpenWaves-13010`, `recordOpenOneRequest-28470`,
`timelineCount-28737`, `harness › relatedCountsFirst-27056`,
`accessibleNames-12625`, `topBar-27524`, `phoneFace-27058`,
`feedLoadFailure-29188`.
- Screenshots (1280 / 1440 / 1920, light and dark, with and without
other tabs) are attached in the project thread, plus the comment panel
open at 1280 / 1366 / 1440, the drawer at 1440 and the phone at 375; the
measured numbers are in the evidence comment.
- e2e: `ui/e2e/record-tabs-35595.spec.ts` (renamed from
`record-tabs-rail-35595.spec.ts`).

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No `packages/spec` change.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (changed files,
`--quiet`).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset
(`.changeset/35890-record-details-pinned.md`), and both declaration
lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: 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 (the 维护者速读 block is the
maintainer's summary, in the maintainer's language).
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

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

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

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

---------

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/xl 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