Skip to content

feat(record-page): on a phone the record's comments open as a page: threads first, replies inside, the box docked at the foot, a long press for actions (#36076) - #36208

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-uzlelf
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/project-thread-uzlelf

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_01L6bhgTfxZyB5T41DdoPaBy

Fixes #36076

Clause-②: yes (widening) — @object-ui/plugin-detail exports CommentsPage and CommentsPageProps; CommentThread takes a third mode ('page') and optional itemInteraction, heldId and onHeldActions; CommentItem an optional interactionProps; CommentComposer and RichTextCommentInput an optional layout ('default' | 'phone'). @object-ui/app-shell reserves the console URL parameter comments (RECORD_COMMENTS_PARAM, listed in RESERVED_URL_PARAMS). @object-ui/i18n gains four detail.* keys in every pack. Nothing is removed or re-typed; the desktop is unchanged.
Metadata-protocol: none

维护者速读

  • 手机上打开一条记录,右上角多了评论图标,旁边是未解决的评论串数。点了进整页评论,盖在记录页上;左上「‹ 记录名」或系统返回键回到记录页,记录页滚到哪还在哪(实测返回前后都是 74)。
  • 两层:列表只列第一层评论,有回复的下面是回复人头像加「N 条回复」;点一条进这一串,原评论在上,回复按时间往下,左上「‹ 评论」回列表。
  • 输入框固定在屏幕底部,键盘弹起时站在键盘上面。平时一行,点了展开,下面一排:提到人、加粗、斜体、列表、代码,右边发送。在列表里发的是新评论,在一串里发的是回复(两个框各留各的草稿)。页面上没有「Ctrl+Enter」字样。
  • 长按一条评论(或系统的长按菜单),从底部升起面板:第一行六个表情,下面「标记已解决」(只在第一层)、「编辑」「删除」(红色,点了先确认)。每一项出现的条件和电脑端悬停那排完全一样,手机没有另判权限。
  • 列表右上角筛选:「显示已解决」「只看我参与的」,和电脑端同一个菜单。手机上「动态」页签只剩系统记录。
  • 删除的门:comments: an ordinary member cannot mark another member's thread resolved; the row floor refuses the resolution-only write that ruling 7063285032 allows #36186+comments: an ordinary member cannot delete their own comment; add an own-row delete door (maintainer ruling 7069889899) #36191 已合并并合入本分支。手机长按面板和电脑端用同一套判定:普通成员能删自己没有回复的评论,能给自己看得到的任何评论串标记已解决。
  • 不改电脑端,不改任何权限和服务端。

What changes

The phone's comment page (@object-ui/plugin-detail, src/comments/)

  • CommentsPage: a full-screen page (role="dialog", fixed over the host) that reads useRecordComments(), the same discussion, writes and gates as the desktop panel. Props: threadId (null = the list), onOpenThread, onBack, backLabel, onEngage.
    • The list draws each thread with CommentThread mode="summary"; a tap on a comment outside its own controls, Enter on a focused comment, or its 「N 条回复」 opens the thread. A thread that is not held (deleted, stale link) shows the list.
    • The thread draws CommentThread mode="page" (new): its comment, then every reply, with no reply box of its own; 「回复」 there puts the caret in the docked box.
    • Two docked CommentComposer layout="phone" boxes (list and reply), each keeping its own draft; the list's stays mounted while a thread is open, so its draft and the list's scroll survive a visit to a thread.
    • The page follows the on-screen keyboard through visualViewport (top and height while the keyboard covers more than 80 px), the same reading as PhoneListPanels' sheet; the inline style is positional only.
    • Esc returns one level (data-owns-escape); the focus lands on 「‹」 when a level opens.
  • useCommentPress: 500 ms hold, cancelled past 10 px of travel; the click that ends a hold is swallowed. onPressStart fires at the press itself (pointer down, context menu, Enter/Space), and the page hands it onEngage, so the host's question about the comment's actions is on the wire before the hold completes. contextmenu opens the same sheet (Android's own long press, the keyboard's menu key, a right click). One record of the press serves every comment.
  • CommentActionSheet (vaul Drawer): six reactions (the viewer's own marked aria-pressed), then Mark resolved / Reopen, Edit, Delete (destructive). A row is drawn only where the comment's CommentItemActions hands its handler: these are the object CommentThread.actionsOf builds for the desktop's hover row, so every gate is the thread's. The sheet is never a snapshot of the press: CommentThread takes heldId and reports the held comment's current actions to onHeldActions each time what they offer changes, so a verdict that lands while the sheet is up adds its rows (L1-c REWORK 7070700220). A comment with no action raises nothing.
  • CommentsFilterMenu: the desktop panel's filter menu, extracted unchanged so both surfaces draw the same one.
  • CommentItem.interactionProps: spread on the comment's box with select-none and no iOS callout, except while it is being edited.
  • RichTextCommentInput layout="phone": the editor first, then one row (mention, bold, italic, list, code; send at the right end, round, 44 px), no preview, the names without their shortcut (detail.formatBold, detail.formatItalic), 16 px text. A press on the row keeps the caret (and the keyboard) in the box. The default layout is untouched.

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

  • commentsPageOffered in RecordDetailView: the same rule as commentsPanelOffered (feeds on, a standard page, a record id) on a phone and not embedded. commentsSurfaceOffered (either one) now drives what commentsPanelOffered drove: the discussion rides the open's payload, the 动态 stream gives the comments up (RecordCommentsInPanelContext) and its count leaves them out.
  • ?comments= (list) / ?comments=<id> (thread), read from the router: opening and a thread push an entry flagged __commentsPushed in history state (the entry's other state kept); 「‹」 pops a flagged entry and otherwise replaces the URL one level up (a reload or a shared link). The page is mounted inside the record's DiscussionContextProvider, over the record, which stays mounted, so nothing is read again and the scroll is kept. Closing returns the focus to the top bar's comments icon.
  • The phone's RecordTopBar gets the comments slot (CommentsButton at 44 px).
  • The explain probes: moderatesComments is asked while the panel or the page is open; updatesOthersComments on the first press on a comment (the page's onEngage, fired at pointer down), as on the desktop's first reach into the panel. Opening the record asks nothing more.

Strings: detail.addReactionEmoji, detail.commentThread, detail.formatBold, detail.formatItalic in all eleven packs (zh-Hant regenerated) and the provider-less defaults; the rest reuse existing keys (detail.sendComment already existed).

Docs: content/docs/frontend/plugins/plugin-detail.mdx (### On a phone) and the plugin-detail README (### The phone's comment page).

Pending release notes: .changeset/36075-record-comments-panel.md (from #36114) is left as it stands on main. Its line "the phone keeps the comments in its 动态 tab" is answered in this PR's own changeset, which says that on a phone the comments live on the phone's page and that this replaces that line. 36075-comments-resolved.md ("…and the phone keep their feed as before") is left as it stands too; the same sentence of this PR's changeset answers it.

Small calls made here (dev-thread rule, Sales 22:19:27Z)

  1. The full page is a URL parameter over the record route, not a new route: the record stays mounted (no re-read, scroll kept), precedent ?related=.
  2. No 「回复」 row in the long-press sheet: in a thread the docked box is the reply; in the list a tap opens the thread.
  3. No 「预览」 on the phone toolbar; the card's row lists mention, bold, italic, list, code and send.
  4. The filter is the desktop's dropdown, not a bottom sheet.
  5. A long press on a comment with no available action opens nothing (a read-only discussion).
  6. Thread title 「评论串」; the list keeps 「评论」.

Overlap

Verification

New tests (all pass)

  • plugin-detail/src/comments/CommentsPage.test.tsx (18): the list shows top-level comments with 「2 replies」, no reply; a tap on a comment or its count opens the thread, a tap on a reaction is the reaction's; Enter opens; 「‹」 names the record; the docked box writes a comment, toolbar order @ B I list code Send, no 「Ctrl」 in the page; a thread shows comment then replies and replies to its comment; a missing thread shows the list; the list draft survives a thread visit; long press on own comment: 6 reactions (own one pressed), resolve, edit, delete, and the release opens nothing, onEngage once; another's comment: no edit or delete; a reply: no resolve; a sheet reaction toggles, Delete reaches the host; a press that travels is a scroll; contextmenu opens the sheet; read-only raises nothing and docks no box; a moderator's press on another's comment engages at pointer down, the sheet opens with Mark resolved and Delete, and when updatesOthersComments turns true with the sheet up Edit joins (fails on the pre-fix head); behind the own-comment delete door Delete is on the viewer's own reply only, not on their comment with replies nor on another's reply; resolved threads hidden by default with the filter offered.
  • app-shell/src/views/RecordDetailView.commentsPanel-36075.test.tsx, new top-level describe (6), the real RecordDetailView at 375: the top-bar icon with 「2」, a press pushes ?comments= (flagged) and draws the list over the still-mounted record; tap → ?comments=c-ada with the reply, 「‹」 → list → record, focus on the icon; a link straight to a thread: 「‹」 replaces one level up twice; the 动态 tab draws no comment and no 「Ctrl」; no icon with feeds off; a moderator's first long press on Grace's comment with the sys_comment explain answered late: no comment explain before the press, asked at the press, the sheet shows Delete, then Edit and Delete once the answer lands (fails on the pre-fix head).

Local runs (after merging main cbd582f4): every app-shell/src/views/RecordDetailView.*, plugin-detail/src/comments and i18n test file, 209 files, 2,830 tests pass. Before the merge, a wider set (all RecordDetailView.*, recordCommentsPanel*, ObjectView.phone*, app-shell/src/__tests__, all of plugin-detail and i18n): 640 files, 6,991 tests pass. tsc (src and tests) clean for plugin-detail and app-shell. ESLint on the changed files: 0 errors (warnings only of the kinds already in these files). overlap-check.mjs: clean against main; #36136 conflict as above. After the L1-c fix: all of plugin-detail (405 files, 3,745 tests) and the host comments file (16 tests) pass; ESLint 0 errors on the touched files.

Browser evidence (CRM example on objectstack dev --fresh, console on Vite from this branch, zh-CN, 375×812 touch, light and dark; seat-side folder /mnt/project-files/build-seat1/36076/, script and readings in its README)

Shot Reading
Record page icon 「3」 at the top bar's right
List 「‹ Globex Ltd」 · 评论 · filter; three first-level comments, 「2 条回复」 under the first
Thread comment, then both replies; URL ?comments=<id>
Composer expanded @ B I list code, round send at the right; the box's bottom at 812 (the viewport's)
Long press, own comment six reactions, 标记已解决, 编辑, 删除 (red)
After 👍 「👍 1」 under the comment, marked as own
Back to the record scrollTop 74 before, 74 after
动态 tab 「动态 (0)」, no comment, no box

Not shown in the browser (the run's only account is an administrator, who moderates): a member's long press on someone else's comment; pinned by the unit test above. The iOS keyboard cannot be emulated in headless Chromium.

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 on the changed files.
  • 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).

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


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy

… their own (#36076)

The phone's record page gains the comments icon in its top bar. It opens
the record's comments as a page over the record (`?comments=`, pushed),
which lists each thread's first comment with its reply count; a tap
opens the thread (`?comments=<id>`) with its replies under the comment.
The comment box is docked at the foot of the screen and follows the
on-screen keyboard; its toolbar sits under the text. A long press (or
the context menu) raises a sheet with six reactions, Mark resolved,
Edit and Delete, each gated exactly as the desktop's hover row. The
动态 tab keeps the system entries alone, as on the desktop.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
@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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

手机评论整页做得完整:右上角评论图标、两层列表、输入框固定在底部、长按面板、筛选、「动态」只留系统记录,375 宽的截图都对得上。需要改一处再合并:

  • 有权管理别人评论的人(比如管理员),在一次打开评论页里第一次长按别人的评论时,面板里会缺「编辑」和「标记已解决」,只有表情和删除。关掉再长按一次才出现。
  • 原因是:「能不能改别人的评论」要先问一次服务器。手机上要等到第一次长按时才开始问,可面板在那一刻就按「还没得到答复」画好了,答复到了也不会更新。
  • 改法很小:手指按下时就开始问(长按本身要按住半秒,足够答复回来);同时让面板跟着答复更新。
    普通成员不受影响:他们今天本来就只能改自己的评论。
    L1 结论:请修改后再审。

席位核对 — REWORK (L1-c) · repo:objectstack#1 · head 07ba1c3b · 2026-11-21T23:10Z

Card: Fixes #36076 (epic #36062). Declarations: Clause-②: yes (widening), Metadata-protocol: none. 31 files, +1365 / −87 against cbd582f4. The seat runs the declaration L2.

Gates:

  • CI was still running at this read: 8 success · 10 skipped · 18 in progress on 07ba1c3b. Finalising waits for green.
  • The branch is 2 behind main.
  • l1-face is INCOMPLETE only because checks were pending.

Must fix

1. The long-press sheet freezes the actions it was raised with, before the updatesOthers probe that the same press starts has answered.

  • In CommentsPage.tsx:102-108, engage(actions) calls onEngage() and then setSheet(actions), keeping that CommentItemActions object as state. CommentActionSheet draws from that object (:295).
  • onEngage is the host's engageComments. It is the only thing that turns on the updatesOthersComments probe for the page: RecordDetailView.tsx, (commentsOpen || commentsPageOpen) && commentsEngaged && ….
  • So on a viewer's first long press after opening the page, actionsOf in CommentThread.tsx has just computed updatesOthers === false for any comment the viewer did not write.
    • The sheet opens with no ✓ (ownComment || updatesOthers), and with no Edit (moderates && updatesOthers).
    • Delete still shows where the viewer moderates.
    • When the explain answer lands, the sheet does not change: its state is the old object.
    • Only a second press after that shows ✓ and Edit.
  • Who is affected:
  • The desktop does not have this race, because the panel engages on pointer entry, before any hover row is reached.
  • Fix:

Notes for the seat (not blocking)

Read and found sound

  • Navigation (openCommentsPage / leaveCommentsPage).
    • Open and thread each push an entry flagged __commentsPushed, keeping the entry's other state.
    • 「‹」 pops a flagged entry. An unflagged entry (a reload or a shared link) replaces one level up: thread → list → record.
    • The record stays mounted under the page, so nothing is read again and the scroll is kept (evidence: scrollTop 74 → 74).
    • RESERVED_URL_PARAMS lists comments.
  • Surfaces.
  • Gates.
    • The sheet's rows are the thread's own actionsOf handlers, so the phone makes no permission decision of its own.
    • The resolve row is offered on roots only.
    • Delete confirms through the host's handler.
  • useCommentPress.
    • The hold is 500 ms, and 10 px of travel, pointerup, pointercancel or pointerleave cancel it. A touch scroll raises pointercancel.
    • The click that ends a hold is swallowed.
    • contextmenu covers Android's own long press and the keyboard's menu key.
    • Taps on the comment's own controls are not a tap on the comment.
  • Composer. layout="phone": the toolbar order is @ B I list code Send, there is no 「Ctrl」 text, the text is 16 px (so iOS does not zoom), and the send button is 44 px. The page follows visualViewport, the same reading as PhoneListPanels.
  • Filter. CommentsFilterMenu is extracted unchanged, and the desktop panel now uses it.
  • Evidence (build-seat1/36076/, 375 × 812 touch, light and dark): it covers the card's four required shots (list, thread, expanded composer, long-press sheet), plus the record icon, a reaction, and 动态 with no comments.
  • No Twenty or Attio markup. The sheet is the existing vaul Drawer.

L1 never replaces L2. The declaration L2 is the seat's.

Generated by Claude Code

…actions, and the press asks for them (#36076)

L1-c REWORK: the sheet kept the actions from the moment of the hold, and the
updatesOthers question started on that same hold, so a moderator's first
sheet on someone else's comment had no Mark resolved and no Edit even after
the answer came. The press now engages the host (pointer down, context menu,
Enter), and CommentThread reports the held comment's current actions
(heldId / onHeldActions) whenever what they offer changes.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
… note says the phone's comments live on its page (#36076)

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP

维护者速读

上一轮指出的问题已经修好:手机上长按评论时,「能否编辑别人的评论」的查询现在在手指按下的那一刻就发出,而不是等长按结束;底部弹出的操作单也会跟着答案更新,答案晚到也会补上「编辑」这一行。两处都有新测试。我读的代码没有发现问题。
另外,桌面评论栏 #36075 已合并的那段说明恢复原样,这个 PR 在自己的说明里写明手机上的评论现在放在独立页面。
L1 结论:通过。这个 PR 仍要等 #36200 先合,再合一次主干。

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

Delta read: 07ba1c3b..e7d93e69, two commits: d0c2bcd7 (fix) and e7d93e69 (changeset). 8 files, +167 / −23.

Gates:

REWORK item, closed

The sheet was a snapshot taken before the updatesOthers answer.

  • The question is asked at the press. useCommentPress gains onPressStart, called on pointerdown (primary button only), on the context menu, and on Enter/Space. CommentsPage passes onEngage there for both the list and the thread, so the 500 ms hold covers the explain round trip. The host's engageComments is idempotent per record (prev === feedRecordKey ? prev : …), so a scroll touch that also starts a press costs one state write at most, and nothing is asked before the first press (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 still holds; the new app-shell test pins that opening the page asks nothing about sys_comment).
  • The sheet is live. CommentThread takes heldId / onHeldActions, computes the held item's actions with the same actionsOf the hover row uses, and reports them in a layout effect keyed on the item and the joined offer flags. CommentsPage.refreshHeld replaces the sheet only when the id matches, so a stale report from another thread cannot swap it. No render loop: the report sets state only when the flags or the item change.
  • Tests:
    • CommentsPage.test.tsx: onEngage fires at pointerdown, before the hold; the sheet shows ['delete'] for a moderator, then ['resolve', 'edit', 'delete'] once updatesOthersComments turns true while it is up, and the new Resolve row writes ('c2', true).
    • RecordDetailView.commentsPanel-36075.test.tsx: end to end through the real explain path, with the sys_comment answer held back. The press asks, the hold opens on ['delete'], and ['edit', 'delete'] follows when the answer lands. The __clearRecordEditableCache relative import has precedent in five app-shell tests on main.

Changesets

L1 never replaces L2. The declaration L2 is the seat's.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Posted 2026-11-22T02:49Z. The brief handed to the isolated declaration-face reviewer for PR #36208, owed by Clause-②: yes (widening) in claim 7070192001 on #36076. The record follows as its own comment.

Contract review brief — PR #36208 @ 1f94bcfc8f9108f7779eb3c5a0c457b307b1520b (card #36076)

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 #36076: its body and EVERY comment (rulings and earlier records included)
· also epic #36062 (body), PR #36114 and PR #36200 (merged; their bodies only) for context; the seat claim 7070192001 on #36076 (Clause-② yes widening: new plugin-detail exports, a new optional composer prop, new i18n keys, a kept comments URL parameter on the record route; Metadata-protocol none); ruling A on changeset levels (level follows the Metadata-protocol line; a Clause-② widening alone ships patch); the comment-door ruling 7069889899 on #36186 (resolve door, own-delete door)
· PR #36208: its body, its file list, and the net diff against main at 1f94bcfc8f9108f7779eb3c5a0c457b307b1520b
· the check-runs on 1f94bcfc8f9108f7779eb3c5a0c457b307b1520b: 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-36208/ 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. Include: the phone sheet's actions follow the same doors as desktop (resolve, own-delete without replies), and no permission is widened beyond ruling 7069889899.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line. Another PR's pending changeset must be untouched (#36075 notes).
③ 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

维护者速读

这一轮只是合入主干:带进了评论的两个新服务端入口(#36200)和宽屏钉左栏(#36136)。手机上长按评论弹出的菜单随之更新,和电脑端一致:任何看得到的评论串都能点「已解决」;普通成员只能删自己的、而且下面没有回复的评论。新加了一条测试锁住这一点,代码本身没有改。我读的部分没有发现问题。
L1 结论:通过。

席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head 1f94bcfc · 2026-11-22T02:51Z

Delta read: e7d93e69..1f94bcfc. It holds two merges of main and one commit between them. My ACCEPT 7071150476 stands for everything outside this delta.

Gates:

Merges (--remerge-diff)

ce92ba19: the phone sheet after #36200

L1 never replaces L2. The declaration L2 (brief 7073151668) is the seat's.

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: 1f94bcfc8f9108f7779eb3c5a0c457b307b1520b
Local-runs: none

Declaration face, owed by Clause-②: yes (widening) in claim 7070192001 on #36076. Read: the card and its two comments (triage, claim), epic #36062, the bodies of #36114 and #36200, ruling 7069889899 on #36186, the PR body and file list, the net diff origin/main...pr-36208 (merge base 48c732c4, 30 files), and the 66 check-runs on the head. Nothing built, run or re-run.

① Derived judgments

  • @object-ui/plugin-detail root exports: CommentsPage and CommentsPageProps only (src/index.tsx). Right. CommentsFilterMenu, CommentActionSheet, useCommentPress, COMMENT_LONG_PRESS_MS and COMMENT_PRESS_SLOP go into the internal comments/index.ts barrel only. The package's exports map has . alone, so they are not public, and the declaration is right to leave them out.
  • RecordCommentThreadProps.mode goes from 'expand' | 'summary' to 'expand' | 'summary' | 'page'. It also gains the optional itemInteraction, heldId and onHeldActions. Right: the union is input-only, and all three new props are optional. For expand and summary the behaviour is unchanged: openReply now tests mode !== 'expand', which is the same branch as before for summary. itemOf still calls renderActions(actionsOf(...)) when the desktop passes renderActions.
  • CommentItemProps.interactionProps (optional) is spread on the comment's box and dropped while the comment is being edited. Right. CommentComposerProps.layout and RichTextCommentInputProps.layout ('default' | 'phone', optional, default 'default'): right. The default branch draws the same toolbar markup, moved into a variable. The phone row has mention, bold, italic, list, code and send, and no preview or shortcut hint, which matches card item 3 and item 4.
  • CommentsPanel: the filter dropdown is pulled out into CommentsFilterMenu with the same markup, data attributes and filtering reading. Right. The desktop is unchanged, as the card's 不做的 asks.
  • @object-ui/app-shell RECORD_COMMENTS_PARAM = 'comments' is added to RESERVED_URL_PARAMS, and RECORD_COMMENTS_PUSHED_STATE is a history-state flag, not a URL parameter. Right. urlParams is not re-exported from the package root (src/index.ts), so the surface added is the console URL contract alone. Nothing else on the branch reads or writes ?comments (git grep), so the name collides with nothing. It is read only while commentsPageOffered is true: a phone, not embedded, feeds on, a default-columns page, and a record id.
  • @object-ui/i18n: four detail.* keys (addReactionEmoji, commentThread, formatBold, formatItalic) in all 11 packs, 44 lines added. The exported DETAIL_DEFAULT_TRANSLATIONS gains the same four. Right, additive only.
  • Host accept-set (RecordDetailView). commentsSurfaceOffered = commentsPanelOffered || commentsPageOffered now drives three things: the discussion riding the open's payload, RecordCommentsInPanelContext, and the 动态 total leaving out comments. Right: this is card item 8, and authored pages and enable.feeds: false still show no icon. The two explain probes are the existing ones. moderatesComments is asked while the panel or the page is open. updatesOthersComments is asked only after engageComments, which the page's onEngage calls at pointer down. The open itself asks nothing new. Right.
  • Doors, phone sheet against desktop: right. CommentActionSheet draws a row only where the CommentItemActions object built by CommentThread.actionsOf carries a handler. This PR does not touch actionsOf. It is the same object the desktop hover row gets through renderActions.
  • Tests: CommentsPage.test.tsx (18) and the new host describe (6) cover the doors. They check own against another's comment, no Resolve on a reply, and, behind the own-comment delete door, Delete only on an own comment with no reply. They also check that a late updatesOthers verdict adds Edit while the sheet is up. Right.

② Semver level

  • .changeset/36076-phone-comment-page.md: @object-ui/app-shell, @object-ui/plugin-detail and @object-ui/i18n, each a patch, with Metadata-protocol: none. Right under ruling A: the level follows the Metadata-protocol line, and a Clause-② widening alone ships patch. Those three packages are exactly the ones the diff publishes from. The docs (content/docs/**) and the README do not publish.
  • Clause-②: yes (widening): the PR body and the changeset say the same thing. They name a superset of what claim 7070192001 lists: the plugin-detail exports, the optional composer layout, the four i18n keys, and the kept comments parameter. Every widening the diff makes is named there, and nothing is removed or re-typed. Right.
  • Other pending changesets: on the merge base and on the head, 36075-record-comments-panel.md and 36075-comments-resolved.md are byte-identical. The diff's only change under .changeset/ is the new 36076 file. The stale phone lines in both 评论(一)电脑:评论从「动态」页签拿出来,做成记录页和抽屉右侧的独立评论栏;对一条评论的操作收到一处 #36075 entries are answered by a sentence in this PR's own changeset. Right, as the 评论(一)电脑:评论从「动态」页签拿出来,做成记录页和抽屉右侧的独立评论栏;对一条评论的操作收到一处 #36075 notes require. Check Changeset is green.
  • Gate verdicts on the head: every completed check-run is success (Type Check, Lint, Test UI 1–16, Test Core, Build & E2E UI, Live E2E UI, Governed Surface Queue Guard, Dogfood Regression Gate, Spec property liveness, Check Changeset). The rest are skipped by design, plus one cancelled run of PR-body guards. That cancelled run (02:27:05Z) was superseded by a success run of the same job (02:27:33Z).

③ Boundary flags

  • The dev's six small calls:
    1. The page is a URL parameter, not a route. Answered: it is declared, reserved and collision-free, and ?related= is the precedent.
    2. No 回复 row in the sheet. Answered: card item 5 lists none.
    3. No 预览 on the phone toolbar. Answered: card item 3 lists none.
    4. The filter is the desktop dropdown. Answered: card item 7 says 列表右上角筛选 and names no sheet.
    5. A comment with no action raises nothing. Answered: this is the read-only case, and it is pinned by a test.
    6. The thread title is 评论串. Answered: it is a new key, already declared.
  • open_questions: none on the claim or the PR. The card's 没有核对的 items (how a phone triggers comment actions today, and why Attio's sheet has no 删除) are answered by this change and by ruling 7069889899 point 2.
  • Escalated to the seat's ACCEPT, not a contract finding. The card's acceptance asks for four screenshots in the PR body: the list, a thread, the open composer and the long-press sheet. The body has a readings table and points to /mnt/project-files/build-seat1/36076/, but embeds no images.
  • Escalated, not verified. 键盘弹起时输入框在键盘上面: the dev states that headless Chromium cannot emulate the iOS keyboard. The visualViewport reading is unit-shaped only, so a real-device check belongs to the seat.
  • Noted. A member's long press on another member's comment is pinned by a unit test only, because the browser run had an administrator account alone. That is enough for the contract: the gate is actionsOf, which the desktop shares.
  • SQL push-down: no finding. The diff adds no read, no id materialisation and no join. threads.find, heldItem and the reply check work in memory over the discussion already loaded through DiscussionContext. The two explain probes are the existing ones, gated by open and by engage.

Implemented-by: claude/project-thread-uzlelf
Reviewed-by: session_01L6bhgUkbQqRUUFSiu2HGob

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-22T02:54Z · #36076, comments part three: the phone. The phone record page opens a full-screen comments page, kept in the comments URL parameter. A long press opens an action sheet whose actions come from the same doors as the desktop (ruling 7069889899): resolve on a thread's first comment, delete on a member's own comment while it has no replies, and edit for the author only. The desktop is unchanged.

Reviews:

Gates on this head (1f94bcfc):

The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #36076.

Merged via the queue into main with commit c30ce97 Nov 22, 2026
66 of 67 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-uzlelf branch November 22, 2026 03:16
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…ts the system history alone while the comment panel holds the comments (objectstack-ai#36193) (objectstack-ai#36221)

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

repo:objectstack#1 · os-sales · session_01L6bhgXV5qLuX94Bn6aqb4y

Fixes objectstack-ai#36193

> **Premise.**
> 1. What the card reads now: objectstack-ai#36136 (48c732c) retired the overview's
right rail, so the 「最近动态」 card is gone and the overview lists no
comment. The card's 「讨论 (3)」 face came from a slotted page whose
`discussion` slot holds `record:chatter`; after objectstack-ai#36136 that author's
block is drawn on the 动态 tab only, where it still drew 「讨论 (4)」, the
全部动态 filter, every comment and reply and a comment box, beside the
comment panel showing the same comment (before:
`pr36136/timeline-tab-panel-open-*`).
> 2. Reading (seat, 2026-11-21 23:06Z): the card's 「不改动态页签」 means the
platform's own 动态 tab (its label and the stream the platform draws). The
target is the author-placed chatter/discussion block, which now happens
to sit inside that tab.
> 3. `Clause-②: no` (a UI face of an existing block; no contract,
permission or spec key).

## What changes

- `renderers/record-chatter.tsx`: while `RecordCommentsInPanelContext`
is on and the block is on the default/slotted page
(`useDefaultRecordPage()`), a `record:chatter` / `record:discussion`
block draws the system entries only: comments and replies filtered out
before `applyFeedConfig`, no composer (`onAddComment` withheld,
`commentsShown: false`, which also drops the Comments-only filter), a
refused or failed comment read not reported (the panel's to say),
heading 「动态」 (`detail.timeline`) and empty line `detail.noActivity`. The
`(N)` count is the filtered items, so it leaves comments out.
- `RecordChatterPanel.tsx`: optional `titleLabel` / `emptyLabel` props
(default 「讨论」 / 「暂无评论」, unchanged for every other caller); a
caller-named heading takes the stream's `Activity` icon instead of
`MessageSquare` (L1-c nit, 3efc293).
- Test
`renderers/__tests__/record-chatter.commentsInPanel-36193.test.tsx` (6).

Not changed: the platform's own `record:activity` stream, the 动态 tab's
label (still 「动态」, no count), an authored (`kind: 'full'`) page.

**Phone, after objectstack-ai#36208 (merged into this branch at `abe8f8b5`):** objectstack-ai#36208
sets `RecordCommentsInPanelContext` to the panel OR the phone comment
page, so on the phone too the author's block on the 动态 tab now drops its
comments; the phone's comments live on their own page. Before objectstack-ai#36208 the
phone had no comment surface and kept them.

### Small calls (seat may overrule)

1. Heading is 「动态」, matching the platform stream's heading in the same
tab; the 全部动态 filter stays (its Comments-only entry goes).
2. The switch is "comment panel offered", not "open", as objectstack-ai#36114 uses for
the stream.

## Why

Card objectstack-ai#36193 (epic objectstack-ai#36062 phase 1 wrap-up): with the comment panel open
the same comment showed twice, and a resolved thread stayed in the
record body.

## Verification

- New test 6/6. Ablation (renderer + panel reverted to main): 4 red, the
2 CONTROL cases green.
- plugin-detail chatter / timeline / RecordPageColumns / renderers
suites: 123 files, 1,274 tests green. app-shell suites naming
`record:chatter` / discussion slots / the comment panel: 14 files, 221
tests green.
- Browser: HotCRM main on `objectstack dev`, console on Vite from this
branch, zh-CN, 1440, dpr 2, one comment + one reply on Wayne
Enterprises, a local uncommitted slotted `crm_account` page with
`slots.discussion: [record:chatter]`. Evidence in the project folder
`build-seat1/36193/`:
- before (main after objectstack-ai#36136):
`pr36136/timeline-tab-panel-open-{light,dark}.png`: 「讨论 (4)」, the
comment and 「1 条回复」 beside the panel.
- after: `after/timeline-tab-panel-open-{light,dark}.png`: 「动态 (2)」, two
system rows, no comment box; `after/overview-panel-open-*`: no comment
on the overview; tab row 「… 活动 5 动态」 unchanged.
- phone: `after/phone-timeline-tab-light.png`: still 「讨论 (4)」 with the
comment (no comment surface on the phone yet).
- Drawer: the comment panel is offered in the drawer too (objectstack-ai#36114), so
the author's block in the drawer's 动态 tab follows the same rule as on
the page.
- Overlap: `overlap-check.mjs` clean against main (c30ce97, after
objectstack-ai#36208) and open heads.

Clause-②: no
Metadata-protocol: none

## 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. (eslint on the three
files: 0 errors)
- [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.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

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

https://claude.ai/code/session_01L6bhgXV5qLuX94Bn6aqb4y

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…the expand/collapse button is the one control, Recent lists this app (objectstack-ai#36112) (objectstack-ai#36297)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X6okWxYPWAsooBsJoAhnT1u)_

repo:objectstack#4 · os-project-manager ·
session_01FEkQ5oK4fFfnLADcipbEeT

Fixes objectstack-ai#36112

This is PR B of two for the card: the sidebar's docking model. PR A
(objectstack-ai#36187) moved everything off the desktop top bar.

Clause-②: no
Metadata-protocol: none

Seat claim: [objectstack-ai#36112
claim](objectstack-ai#36112 (comment)).
Ruling: [F1,
7069868269](objectstack-ai#36112 (comment)).

## 维护者速读

- 电脑上打开应用:窗口 1280
宽及以上侧边栏默认展开,更窄默认收起;收起和展开按钮是唯一开关,浏览器按宽窄两边各自记住;「保持侧边栏展开」开关去掉;侧边栏的「最近使用」只列当前应用里的;手机不变。
- 「去掉顶栏、侧栏常驻」这张卡的后一半,按你 11 月 21 日的裁定(1280 起默认展开,更窄才收起)收尾,合并后这张卡关闭。
-
出错时用户看到的是侧边栏开始时的展开或收起不对,点一下按钮就能改回,选择会被记住;只改界面,不动数据,可以直接撤回;以前选过「保持展开」的人在窄窗口上照旧是展开的。
- 无

## Upgrade change and accepted cost

- **Upgrade change (stated as the ruling asks):** on 1280–1415 px
windows, a user who never set 「保持展开」 now starts with the sidebar
expanded (it folded before), unless they had collapsed it on a wide
window.
- **Accepted cost (stated on the card):** on a 1280 px window the list
beside an open record drawer is 304 px wide (560 today), and on
1280–1415 px with the sidebar expanded, opening the comment panel
returns the record page's fields to the tab row; collapsing the sidebar
restores the three columns. The 304 / 560 figures are pinned in
`consoleSidebarRail.width-27593.test.tsx` against the primitive's
sidebar width and plugin-view's drawer width.

## What changes

`@object-ui/app-shell`

- `layout/consoleSidebarRail.ts`
- `CONSOLE_SIDEBAR_RAIL_BELOW_WIDTH` is `1280`, one constant, no longer
derived (`RECORD_DRAWER_MIN_CONTENT_WIDTH` removed; the drawer and list
constants stay, to state the accepted cost).
- The narrow-window choice is `CONSOLE_SIDEBAR_NARROW_OPEN_PREFERENCE`
(was `CONSOLE_SIDEBAR_KEEP_OPEN_PREFERENCE`), stored under the same name
`console.sidebar.keepOpen`, so an existing `on` reads as "expanded on
narrow" with no migration. The wide-window choice keeps its key
(`os:console-sidebar:wide-open`). Wide and narrow stay stored
separately.
- New `startingSidebarOpen(wide)`: the reader's choice for that side,
else expanded on wide and collapsed on narrow. `primeConsoleSidebarOpen`
writes it into the primitive's cookie before the first frame;
`seedWideWindowOpen` is gone (with an explicit wide default it has
nothing to seed).
- `useConsoleSidebarRail` answers `narrowOpen` / `setNarrowOpen` instead
of `keepOpen` / `setKeepOpen`; `railMode` is "narrow and collapsed by
the narrow choice".
- `useConsoleSidebarRailPanel`: `keepOpenControl`, `dock` / `undock` and
the `'dock'` closer are removed. While the sidebar is hidden, a press on
a sidebar trigger (the page header's expand button, or the corner
fallback) now docks it: on a narrow window the capture phase sets the
narrow choice to expanded before the provider's toggle opens it, so the
open is not a float. ⌘B still floats the menu over a collapsed sidebar
(unchanged), and so does the left edge.
- `hooks/useResponsiveSidebar.ts`: gives a window its starting state on
load and when it crosses 1280 px or the phone breakpoint; keeps an
open/close on a wide window as the wide choice (only on a change, so a
default is never recorded as a choice), and a close of the docked
sidebar on a narrow window as the narrow choice; a narrow choice turned
collapsed (this tab or another) collapses an open sidebar. Public
signature unchanged.
- `layout/UnifiedSidebar.tsx`: the 「保持侧边栏展开」 footer row is gone (the
foot holds only the account menu). From 768 px up the Recent group lists
only entries whose address names the current app (resolved by
`matchAppBySegment`, as Home resolves a recent row's app); the phone
drawer is unchanged.

`@object-ui/i18n`: `sidebar.keepOpen` removed from all 11 packs (zh-Hant
regenerated with `gen:zh-hant`).

Text that named 1416 (the ruling's list, plus one more found by grep):

- `ui/packages/plugin-detail/src/synth/recordPageColumns.ts` comment
(also corrected: it still described the retired 48 px icon rail).
Comment only, no bump for plugin-detail.
- `docs/qa/platform-checklist/areas/platform-core.json`
`platform-core.builtin-apps-nav-render` steps[2], revision 17 → 18 with
a history row.
- `examples/app-showcase/e2e/detail-shapes.spec.ts`: its comment cited
1416 and the case docked the sidebar with the retired "Keep sidebar
open"; it now docks with the page header's expand button.

## Tests

New (card-named):

- `layout/__tests__/consoleSidebarRail.docking-36112.test.tsx`:
threshold 1280; first frame at 1279 collapsed and 1280 expanded whatever
the cookie, 768 / 1920 edges, phone keeps the cookie; the mounted layout
at 1279 → 1280; a stored choice beats the default on each side and the
two sides stay apart; a raw legacy `os:pref:console.sidebar.keepOpen`
record `{"value":"on","v":1}` reads as expanded on a narrow window.
- `layout/__tests__/UnifiedSidebar.recentThisApp-36112.test.tsx`: Recent
lists only this app's entries (other app, Setup, Studio item left out),
its five are this app's newest five, no group when this app has none,
and the phone drawer still lists every app's.

Rewritten (they encoded 1416 or the keep-open switch):

- `hooks/__tests__/useResponsiveSidebar.test.tsx`: defaults at 1279 /
1280, no choice recorded by a default, each side's state across the
threshold, wide collapse kept, narrow close kept as the narrow choice, a
narrow choice turned collapsed elsewhere, phone untouched.
- `layout/__tests__/ConsoleLayout.sidebarFirstFrame-28077.test.tsx`:
1280 → 1279 for the collapsed first frame; new cases for 1280 expanded
against a collapsed cookie, a wide collapse, and a narrow expand.
- `layout/__tests__/consoleSidebarRail.width-27593.test.tsx`: no longer
pins the derived 1416; pins 1280, the 256 px width (F2) and the 304 /
560 cost.
- `layout/__tests__/UnifiedSidebar.hiddenCollapse-35062.test.tsx`:
narrow width 1280 → 1024; the trigger-floats cases now float with ⌘B;
the "Keep sidebar open" cases are replaced by "the expand button docks
(wide and narrow), a reload keeps it, the collapse button takes it
back", the legacy keep-open read, and "the expand button docks even when
React renders between the capture phase and the trigger's handler" (the
old render-between case, now for the dock).
- `layout/__tests__/UnifiedSidebar.railOverlay-27593.test.tsx`: 1280 /
1360 → 1024; floats with ⌘B; the three "Keep sidebar open" cases and the
Esc-on-keep-open case are replaced by the expand-button dock and the
narrow/wide choices kept apart (objectstack#28079).
- `examples/app-showcase/e2e/detail-shapes.spec.ts` (see above).

Retired: none as a file. The removed cases are the ones that drove the
retired control; each behaviour they pinned that still exists (float,
Esc, focus, fold on navigation, choices kept apart) is pinned in the
rewritten files above.

<details><summary>Local runs (head ce00125)</summary>

All at head `ce00125fc`, under the shared verify lock unless marked
lock-free.

- `pnpm --filter @object-ui/app-shell type-check && pnpm --filter
@object-ui/i18n test && vitest run` the seven changed or new app-shell
test files: VERDICT command-exit 0; i18n `Test Files 105 passed (105)`,
`Tests 1962 passed | 13 skipped`; app-shell `Test Files 7 passed (7)`,
`Tests 71 passed (71)`.
- Earlier, at `114ccd7a7` (source identical to the head; the last commit
adds one import line to a test): `vitest run` app-shell `layout`,
`hooks`, `chrome`: `Test Files 279 passed (279)`, `Tests 2217 passed
(2217)`.
- Derived gate families (`dispatch-gates.mjs`, 65 derived, `--ran`
reconciliation: 65 run, 0 unrun): 62 lock-free families re-run at the
head, exit 0 each; `check:type-check-debt` exit 0 under the lock;
`vitest run scripts/` under `ui/` exit 0 under the lock (the lock-free
attempt was SIGKILLed by the box's memory limit, not a red);
`check:test-source-alias` red on the first run, fixed by `ce00125fc` and
green since.
- NOT MEASURED: `check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT
MET (needs a full `pnpm build` of 36 framework packages this PR does not
touch); CI runs it.
- Declared to CI: `test:repo` and the full lint farm.

</details>

<details><summary>Ablations (one per leg; each mutation committed-first,
landed on disk by `scripts/ablation-replace.mjs`, restored to HEAD and
proven by blob hash)</summary>

Six legs, one lock hold (VERDICT command-exit 0), at head `ce00125fc`.
Each leg red, each restored with `git diff HEAD` empty and the file's
blob equal to HEAD's.

| Leg | Mutation | Suite | Result |
|:---|:---|:---|:---|
| L1 | threshold 1280 back to 1416 | `consoleSidebarRail.docking-36112`
| 4 failed / 8 |
| L2 | the narrow choice (legacy keep-open) read always false |
`consoleSidebarRail.docking-36112` | 2 failed / 8 |
| L3 | the expand press no longer sets the narrow choice |
`UnifiedSidebar.hiddenCollapse-35062` | 2 failed / 20 |
| L4 | Recent filter removed | `UnifiedSidebar.recentThisApp-36112` | 3
failed / 4 |
| L5 | Recent filter applied on the phone too |
`UnifiedSidebar.recentThisApp-36112` | 1 failed / 4 |
| L6 | a narrow-window close no longer kept | `useResponsiveSidebar` | 1
failed / 7 |

The suites import the edited modules by relative path (source), so no
build sits between the mutation and the run.

</details>

## Acceptance notes

Card acceptance, walked against main after PR A (a5a5312) and this
branch:

| Card acceptance line | Met by |
|:---|:---|
| Desktop app page: no top bar; sidebar on the left, content beside it,
not covered | PR A (no top bar); this PR (docked by default from 1280
px; below it collapsed by default, as ruled) |
| Collapse: sidebar disappears, content widens, expand button top-left;
left edge slides it out; still collapsed after refresh | PR A (collapse,
expand button, edge); this PR (the expand button docks instead of
floating; the choice is kept on both sides of 1280) |
| App name opens only the app list (search when many) and 「添加应用」; Setup
for admins only; switching works | PR A |
| Sidebar search works, shortcut works | PR A |
| Avatar at the bottom; its menu has switch organization and sign out |
PR A |
| Bell beside search; panel and count as before | PR A |
| Impersonation banner at the content top, exit works; lost-connection
notice | PR A |
| List, record, dashboard, report, custom page all carry the
page-actions group | objectstack-ai#36111 and PR A (always on) |
| Phone width unchanged | PR A; this PR leaves the phone drawer's Recent
unfiltered and the phone sidebar state untouched |
| Setup and Account use the new shell, menus unchanged | PR A |
| Onboarding walks through | PR A (the walkthrough component renders
nothing on main; no step points at the top bar) |
| PR body: before/after desktop screenshots (expanded, collapsed, app
menu, banner) and the changed components and rewritten tests | this PR
(before/after shots at 1440, 1280 and 1279 (expanded, collapsed, app
menu open, the 1279 expand press, and a reload after it), saved with the
seat's evidence; the banner was not shot, see Acceptance notes;
components and tests above) |
| Item 2: 「保持侧边栏展开」 removed | this PR |
| Item 5: Recent lists this app's items | this PR |

The PR A rows are read from PR A's body and main's code, not re-driven
here except where the screenshots show them.

Browser evidence (showcase booted on a private port, console served by
Vite from this branch; the before set from the same server with the
three sidebar files and the English pack swapped back to the merge base,
then restored to HEAD and checked by blob hash):

- Fresh profile, 1440 px: expanded, before and after. 1280 px: collapsed
before, expanded after.
- 1279 px: collapsed on load in both. Pressing the expand button:
before, the menu floats over the page with the 「Keep sidebar open」 row
at its foot, and a reload brings back the collapsed state; after, the
sidebar docks beside the page (content reflows), and a reload keeps it
docked.
- App menu open at 1440: same in both (Showcase, Setup, Add app).
- The impersonation banner was not shot: it needs a second user to
impersonate on a fresh database, and its surface is PR A's and is not
changed here.
- Recent was not shot: a fresh profile has no recent items; the filter
is pinned by `UnifiedSidebar.recentThisApp-36112` and its ablations L4
and L5.

Reading taken where the ruling is literal, carried as an open question
in the report:

- The expand button's tooltip names ⌘B (it draws the chord the sidebar
primitive answers to), but with ⌘B kept unchanged as ruled, ⌘B over a
collapsed sidebar floats the menu while a press on the button docks it.
Before this PR both floated. Either ⌘B docks too, or the tooltip stops
naming it; this PR does neither and leaves it to the seat.

Out of scope, noted not filed: none.

Overlap: `overlap-check.mjs` exit 1 against objectstack-ai#34223 (a draft from
2026-11-19 that already conflicts with main on another file) in
`docs/qa/platform-checklist/areas/platform-core.json`; not merged
around, per the order. objectstack-ai#36234 and objectstack-ai#36208 share the i18n packs and merge
cleanly.

## Verification

Read first (riskiest first):

1. `ui/packages/app-shell/src/layout/consoleSidebarRail.ts`, the capture
listener in `useConsoleSidebarRailPanel` (expand docks; ⌘B floats) and
`startingSidebarOpen`.
2. `ui/packages/app-shell/src/hooks/useResponsiveSidebar.ts`, the layout
effect (which transitions write which choice).
3. `ui/packages/app-shell/src/layout/UnifiedSidebar.tsx`, the
`recentItems` filter.

Two-minute check: in a fresh browser profile open any app at a 1280 px
window: the sidebar is expanded beside the page. Resize to 1279 px: it
collapses and the page header shows the expand button; press it: the
sidebar docks, and a reload keeps it docked.

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

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

https://claude.ai/code/session_01FEkQ5oK4fFfnLADcipbEeT

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 22, 2026
…k before it edits, and a page's locks are read in one request (objectstack-ai#35795) (objectstack-ai#36295)

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

repo:objectstack#1 · os-sales · session_01L6bhgXSK9qt8je9QbZvhKb

Fixes objectstack-ai#35795

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

## 维护者速读

- 列表里直接改格子时:如果这条记录「是否被审批锁住」或「我能不能改这条」还没查回来,双击、回车、F2
或直接打字都不会立刻弹出编辑框,格子上先显示「正在确认这条记录能否编辑…」;答案一回来,没锁就自动打开编辑框(打的那个字也保留),锁了就显示「此记录正在审批中,已锁定。」。不会再出现「能进编辑、保存才被拒」。
-
查询中点了别的格子,就放弃这次等待,不会突然在别处弹出编辑框。查询中点开关、粘贴、清空:同样先提示正在确认,答案回来没锁才写入,锁了就不写并说明原因。
- 一页数据只发一个锁查询:第一次点格子时把整页的锁一起问;之后用方向键走动不再发请求。新增服务端批量接口 `POST
/api/v1/approvals/records/:object/locks`(一次最多 200 条,读不到的记录和不存在的一样答
null),SDK 有对应方法。
- 风险:查询很慢时,用户第一次操作要等一下才出编辑框;没装审批服务的部署照旧(501 后不再问)。可直接撤回本 PR 回到原样。
- 需要你决定的:无。

## What changes

**Server (new route, contract, SDK).**
- `IApprovalService.getRecordLocks?(object, recordIds, context)`
(`packages/spec/src/contracts/approval-service.ts`, optional like
`getRecordLock`): entry `i` answers `recordIds[i]` exactly as
`getRecordLock` answers it (`{ locked }`, or `null` for an unreadable or
missing record, never told apart). New export
`APPROVAL_RECORD_LOCKS_MAX_RECORD_IDS = 200` (the explain batch's cap,
so a page splits the same way for both reads).
`api-surface/contracts.json` and `export-origins/contracts.json`
regenerated.
- `ApprovalService.getRecordLocks` (plugin-approvals): two engine reads
whatever the page size: the caller's `id $in` read of the ids (the same
anchor `getRecordLock` reads as the caller), then one pending-request
lookup judged by the record-lock hook's own judgement through the new
`recordsHeldByLockingApproval` (`lifecycle-hooks.ts`, the many-record
form of `recordHeldByLockingApproval` over the same
`lockingRequestsForRecords`).
- `POST /api/v1/approvals/records/:object/locks`
(`approvals-routes.ts`): body `{ "recordIds": [...] }` answers `{
success: true, data: { records: [{ recordId, locked }] } }` in order,
`locked: null` where the single read answers 404. Closed query set EMPTY
(`APPROVAL_RECORD_LOCKS_PARAMS`); the body is closed too
(`readRecordLocksBody`): any other key, a non-list, a non-string or
blank id, an empty list or more than the cap is refused whole with `400
VALIDATION_ERROR`, the service never asked. A service without
`getRecordLocks` answers 501, never one `getRecordLock` per id. Route
ledger row `sdk` → `client.approvals.getRecordLocks(object, recordIds)`.

**List grid.**
- `useRowApprovalLocks` asks the locks of the page in one request per
`APPROVAL_RECORD_LOCKS_MAX_RECORD_IDS` ids when a cell is first selected
(`ObjectGrid`'s `onCellSelect` passes the selected row plus the page's
ids); rows already asked are not asked again, rows a later page brings
are asked on the next select. It exposes `settling(recordId)`: the read
the row waits on while it is on the wire.
- `useRecordCrudVerdicts` exposes `settling()`: the explain questions on
the wire as one promise (read from a ref, so it sees a question sent
since the last render).
- `ObjectGrid.describeCell`: when the cell has no read-only reason yet
but the row's lock read, or its `update` verdict (when still unknown),
is on the wire, the facts carry `checking: { text, settled }`.
- `@object-ui/components` `GridCellFacts.checking` (optional, new):
`data-table`'s `attemptEdit` shows `text` on the cell, remembers the
edit (with its typed seed) and asks it again when `settled` settles,
unless another cell was selected, a newer edit was asked or an editor is
open by then. A toggle, paste or clear asked meanwhile shows `text` and
writes nothing (an intrinsic refusal such as "required" is still said
first).
- i18n: `grid.readOnlyReason.checking` in all 11 locales plus the
plugin's English fallback.

Docs: `content/docs/automation/approvals.mdx` ("Reading the locks of a
page of records"). Changeset
`.changeset/35795-batched-record-lock-read.md` (patch on the seven
packages the diff moves; `Metadata-protocol: none` ⇒ patch).

## Why

PR objectstack-ai#35747 read a row's lock with one `GET …/:recordId/lock` per selected
row, sent on a double-click's first press and needed on its second. A
slower answer let the editor open on a locked record and only the save
was refused; the record verdict had the same window, and arrow keys sent
one read per row (the L2 record 7034067196, S3 and N2). objectstack-ai#35684 rules out
「能进编辑、保存被拒」.

**Batch route over projection** (premise, accepted by the seat with the
claim 7072869185): the lock is the approvals plugin's own judgement;
projecting it into `GET /data/:object` would teach the data layer about
approvals or add a virtual-field protocol and charge every list read,
while a batch route is the same shape as the explain batch the list
already sends, asked only when the reader first acts on a cell.

## Small calls made in this thread (Sales 22:19:27Z: listed here)

- **Wait, then open** (the card's first arm) rather than "open nothing,
say checking": the premise proposed the latter; building it showed that
a real double-click on a fresh page (and every Playwright `dblclick`)
would then always need a second double-click. The waiting edit is
dropped by selecting another cell, so nothing opens elsewhere.
- The lock and verdict of a page are asked on the first cell select
(lazy, the objectstack-ai#34208 posture), not on first paint.
- The same cap as explain (200); a body with any other key is refused,
like an unknown query name.
- A row the caller cannot read (`locked: null`) and a failed read fall
back to the `approval_status` column (fail open, as before; the server
still refuses a locked write).
- No principal key on the lock answers (unchanged from objectstack-ai#35747): they are
dropped on any data change of the object and on unmount.

## Verification

Each new pin was run against the fix, then with the fix ablated.

- `ObjectGrid.cellSelection-35684.test.tsx`, new top-level `describe`
"an edit waits for the row's lock and verdict (objectstack#35795)", 7
cases with fake timers for the slow reads: a slow lock read on a locked
row says checking for 1999 ms and then locked, never an editor; on an
unlocked row the editor opens by itself when it answers; a key typed
while checking is the editor's value; a slow verdict holds it the same
way; selecting another cell drops the wait; a page sends one lock read
and the arrow keys send none (lock or explain); a 501 deployment is
asked once and edits. The existing lock case now reads the page in one
request. Ablating the `checking` branch of `attemptEdit`: 5 of the 7
red, restored.
- `rest-approvals-record-lock-route.test.ts`, new top-level `describe`
for the route: preservation (service asked once with the ids in order
and the caller; one entry per id; a full page at the cap), nine refusal
shapes (400 + nested `VALIDATION_ERROR` + service never called), the
empty closed query set, 501 when only `getRecordLock` exists (and it is
not called), a read refusal relayed at its own status.
- `record-lock-read.integration.test.ts` (real ObjectQL + better-sqlite3
+ `ApprovalsServicePlugin.start()`), new top-level `describe`: for each
of submitter, approver and a non-participant reader, the page answer
equals `getRecordLock` per id (repeated ids, unreadable, missing); two
engine reads for a page of three; an outsider is refused 403 as for one
record; a blank id answers null; deciding unlocks the page as the hook
does.
- `client.test.ts`: one POST, object segment encoded, body `{ recordIds
}`.
- Local runs on the merged tree: see the next section.

**Local runs** (merged tree, main `a5a5312f` + this branch, after `pnpm
install --frozen-lockfile && pnpm build`):
- `@objectstack/plugin-approvals` test: 126 files / 1,812 passed.
`@objectstack/client`: 59 / 820 passed. `@objectstack/spec`: 869 files /
27,877 passed. `@objectstack/rest`: first run 2 red (the two write-route
ledgers had no row for the new POST route); rows added (`no-record-echo`
in the objectstack-ai#8497 tripwire, a driven `approvals.getRecordLocks` row in the
hook-refusal ledger), both files now 737 / 737.
- Typecheck clean: rest, plugin-approvals, client, spec, ui plugin-grid,
components, i18n.
- UI (`packages/plugin-grid/ components/ plugin-list/ plugin-detail/
i18n/`): first run 18 red in 4 files: a paste / toggle / digit was
dropped while checking (fixed: those writes now wait too, as the edit
does), and `zh-Hant.ts` was not regenerated (fixed with `gen:zh-hant`).
The six affected files then 102 / 102. A second full run of these
packages is in progress; its result goes on this PR.
- `spec check:generated`: `api-surface` and `export-origins` regenerated
(one line each). `overlap-check.mjs`: clean against main and every open
PR sharing a file (objectstack-ai#36135, objectstack-ai#36144, objectstack-ai#36208).
- Added after the seat's ask: `ObjectGrid.autosave-35685.test.tsx`, new
top-level `describe` (2 cases, fake timers): a paste is not written for
1999 ms of a slow lock read and is written when it answers unlocked; on
a locked answer it is never written and the cell says why. Ablating the
wait in `writeCell`: both red, restored.

## Acceptance notes

- **objectstack-ai#36135** (draft) makes `getRecordLock` also answer `true` for a
`master_detail` line of a locked record. This PR's batch answers the
record half only. Whichever lands second carries the other half into
`getRecordLocks` (the line half batched: one FK read of the page, one
lookup per master object). `overlap-check.mjs` reads this branch clean
against objectstack-ai#36135 (it was moved off the lines objectstack-ai#36135 edits).
- The notice text stays on the cell until the answer arrives or the
reader moves; it is not a toast.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(a contract interface member and a constant)
- [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.
- [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_01L6bhgXSK9qt8je9QbZvhKb)_

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

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

---------

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

2 participants