Repository navigation
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
Conversation
… 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
…s it Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
|
repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP 维护者速读手机评论整页做得完整:右上角评论图标、两层列表、输入框固定在底部、长按面板、筛选、「动态」只留系统记录,375 宽的截图都对得上。需要改一处再合并:
席位核对 — REWORK (L1-c) · repo:objectstack#1 · head
|
…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
|
repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP 维护者速读上一轮指出的问题已经修好:手机上长按评论时,「能否编辑别人的评论」的查询现在在手指按下的那一刻就发出,而不是等长按结束;底部弹出的操作单也会跟着答案更新,答案晚到也会补上「编辑」这一行。两处都有新测试。我读的代码没有发现问题。 席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head
|
…ad, Delete behind the own-comment door (#36076) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy
|
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 Contract review brief — PR #36208 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP 维护者速读这一轮只是合入主干:带进了评论的两个新服务端入口(#36200)和宽屏钉左栏(#36136)。手机上长按评论弹出的菜单随之更新,和电脑端一致:任何看得到的评论串都能点「已解决」;普通成员只能删自己的、而且下面没有回复的评论。新加了一条测试锁住这一点,代码本身没有改。我读的部分没有发现问题。 席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Declaration face, owed by ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
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 Reviews:
Gates on this head (
The seat readies this PR and arms auto-merge in the same step. The PR carries |
…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>
…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>
…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>
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgTfxZyB5T41DdoPaBy
Fixes #36076
Clause-②: yes (widening) —
@object-ui/plugin-detailexportsCommentsPageandCommentsPageProps;CommentThreadtakes a thirdmode('page') and optionalitemInteraction,heldIdandonHeldActions;CommentIteman optionalinteractionProps;CommentComposerandRichTextCommentInputan optionallayout('default' | 'phone').@object-ui/app-shellreserves the console URL parametercomments(RECORD_COMMENTS_PARAM, listed inRESERVED_URL_PARAMS).@object-ui/i18ngains fourdetail.*keys in every pack. Nothing is removed or re-typed; the desktop is unchanged.Metadata-protocol: none
维护者速读
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 readsuseRecordComments(), the same discussion, writes and gates as the desktop panel. Props:threadId(null= the list),onOpenThread,onBack,backLabel,onEngage.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.CommentThread mode="page"(new): its comment, then every reply, with no reply box of its own; 「回复」 there puts the caret in the docked box.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.visualViewport(top and height while the keyboard covers more than 80 px), the same reading asPhoneListPanels' sheet; the inline style is positional only.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.onPressStartfires at the press itself (pointer down, context menu, Enter/Space), and the page hands itonEngage, so the host's question about the comment's actions is on the wire before the hold completes.contextmenuopens 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(vaulDrawer): six reactions (the viewer's own markedaria-pressed), then Mark resolved / Reopen, Edit, Delete (destructive). A row is drawn only where the comment'sCommentItemActionshands its handler: these are the objectCommentThread.actionsOfbuilds for the desktop's hover row, so every gate is the thread's. The sheet is never a snapshot of the press:CommentThreadtakesheldIdand reports the held comment's current actions toonHeldActionseach 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 withselect-noneand 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)commentsPageOfferedinRecordDetailView: the same rule ascommentsPanelOffered(feeds on, a standard page, a record id) on a phone and not embedded.commentsSurfaceOffered(either one) now drives whatcommentsPanelOffereddrove: 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__commentsPushedin 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'sDiscussionContextProvider, 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.RecordTopBargets thecommentsslot (CommentsButtonat 44 px).moderatesCommentsis asked while the panel or the page is open;updatesOthersCommentson the first press on a comment (the page'sonEngage, 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.formatItalicin all eleven packs (zh-Hant regenerated) and the provider-less defaults; the rest reuse existing keys (detail.sendCommentalready 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)
?related=.Overlap
@object-ui/plugin-detailimport line inRecordDetailView.tsx(main's list plusCommentsPage). After the mergetscfor app-shell is clean and everyRecordDetailView.*andplugin-detail/src/commentstest passes (103 files, 873 tests), as doesi18n(105 files).actionsOf, so it takes the new ✓ gate (any thread the viewer reads) and the own-comment delete door (ownCommentDeletesOnly: own comment with no reply only) with no code change; one CommentsPage test expectation moved from['delete']to['resolve','delete'], and a new test pins the door on the phone sheet.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,onEngageonce; 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 whenupdatesOthersCommentsturns 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 realRecordDetailViewat 375: the top-bar icon with 「2」, a press pushes?comments=(flagged) and draws the list over the still-mounted record; tap →?comments=c-adawith 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 thesys_commentexplain 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): everyapp-shell/src/views/RecordDetailView.*,plugin-detail/src/commentsandi18ntest file, 209 files, 2,830 tests pass. Before the merge, a wider set (allRecordDetailView.*,recordCommentsPanel*,ObjectView.phone*,app-shell/src/__tests__, all ofplugin-detailandi18n): 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 ofplugin-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)?comments=<id>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
packages/specholds no runtime logic. (not touched)pnpm lintpasses on the changed files.main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Branch name is the harness-assigned
claude/project-thread-uzlelf.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgTfxZyB5T41DdoPaBy