Repository navigation
fix(comments): Reply focuses the reply box, author avatars with initials, mention menu at the caret, delete toast - #36105
Conversation
…als, mention menu at the caret, delete toast - Reply puts the caret in the reply input and expands collapsed replies first (ThreadedReplies `focusReplyOnOpen`, passed by the timeline). - Every comment and reply leads with CommentAuthorAvatar: the 20 px image, or the person chips' initials disc (getPersonInitials, now exported from @object-ui/fields). - The mention menu in RichTextCommentInput opens under the caret, or above it when the window has no room below. - The record page's comment delete shows a "Comment deleted" toast; new locale key detail.commentDeleted in all eleven packs. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
…y Reply Pressing Reply now expands a comment's replies before focusing the reply box, so the record-page threading pins read the stored and the new reply under their parent without a second click on the count toggle. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Posted 2026-11-21T14:45Z. The brief handed to the isolated declaration-face reviewer for PR #36105 (owed by the claim's Contract review brief — PR #36105 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP 维护者速读评论的四处小修:点「回复」后光标直接进回复框(有收起的回复会先展开);每条评论和回复前显示 20 大小的作者头像,没设头像的显示姓名首字圆块;输入 @ 时人员选单出现在光标下方(下面放不下就在上方);删除成功后提示「评论已删除」。L1 结论:接受。第一轮的红确实只是旧测试假设「点回复不会展开」,后两个提交只改了测试,没有改产品代码。还欠一项:手机 375 宽的截图(评论加回复、@ 选单各一张),落地前补上即可,不需要改代码。 席位核对 — ACCEPT (L1-c) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: Inputs read: card #36070 (body and both comments: the triage and the seat's ① Derived judgmentsNo accept-set change. Nothing under
Nothing is removed or renamed, and no declared meaning or default changes. ② Semver levelThe changeset
③ Boundary flags
Implemented-by: VERDICT: PASS |
…2e reads the avatar cell The comment row draws COMMENT_AVATAR_CELL since the author avatar; the 14 px STREAM_ICON_CELL had no reader left but the e2e fixture, which therefore laid out a cell the row no longer uses. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5
|
repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP 维护者速读上一轮欠的手机 375 宽截图已补齐:回复展开、光标在回复框里,姓名首字头像正常;@ 选单出现在光标下方,右边没有超出输入框。代码增量只是删掉一个不再用的样式常量,并让一个端到端测试读新的头像格。L1 结论:接受,没有欠项了。 席位核对 — ACCEPT (L1-c, delta) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Contract reviewServed-tier: This is a delta record on top of the PASS record for Inputs read:
① Derived judgmentsThe delta changes no declarations.
The should-fix from that record is fixed correctly:
② Semver levelThere is no change since ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Regen-provenance: declaration-face record 7064801429 (delta PASS) ·
|
|
repo:objectstack#1 · os-sales · session_01L6bhgXtcSJVbw8Gny1ERbP 维护者速读这个 PR 合进了最新主干(主干的 17 个提交),没有冲突,PR 自己的改动和已经审过的版本逐字一致。主干同期改过的几个文件(记录页、字段包导出、语言包)跟评论小修没有交叉。L1 结论:接受合并这一步,CI 全绿后即可落地。 席位核对 — ACCEPT (L1-c, merge only) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob Seat landing · 2026-11-21T15:43Z · #36070, small comment fixes (epic #36062 phase 1). Comments show the shared Reviews:
Gates on this head:
The seat readies this PR and arms auto-merge in the same step. The PR carries |
… on, Approve leads the band, one time face (objectstack-ai#36095) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu5xKbCuyXQ5nYfei9GkjzN3)_ Fixes objectstack-ai#35415 repo:objectstack#1 · os-sales · session_01L6bhgW5RH2VUXjRj9dZYH2 Clause-②: yes (widening) Metadata-protocol: none The widening: `@object-ui/components` takes one optional member, `RecordHeaderState.title`, and exports its type `RecordHeaderTitle`. Nothing is removed or renamed. ## 维护者速读 - 审批请求页的标题从流程名(「费用报告签批」)换成审批人要看的业务记录名(「EXP-2001」),点标题就打开那条记录。只有页面自己读得到那条记录时标题才是链接;无权读、读不到、或平台标记已删除时,标题只显示名字、不能点,和同页「提交时的内容」卡片的规则一致。取不到记录名时仍显示流程名,标题里不会出现裸记录 id。 - 流程名只在标题下方高亮条的「流程」一格出现一次。卡片第 1 条写了「副标题写流程名」,这里没有加副标题:那一格已经紧贴在标题下方,再加副标题就是卡片抱怨的重复。 - 审批条里「通过」仍是实心主按钮,「驳回」改为描边加危险色文字,「通过」成为页面上最醒目的按钮。业务记录页上的审批条是同一个组件,也一起变。 - 审批动态里的时间改成和页头一样的写法(`2026/11/21 上午10:09`),不再带秒。 - 列表、搜索、最近访问和面包屑里,审批请求仍按流程名称呼,对象定义不变。只改前端显示,可以整体撤回。 ## What changes Card objectstack-ai#35415 lists four defects on the approval request page. Read against main `fe753492`, two still held, one held in part, and one was already fixed: | Card item | On main | This PR | |:---|:---|:---| | 1. The title is the flow's name; the record cannot be opened from it | held | the title names the record and links to it | | 2. "As submitted" truncates text fields | fixed by objectstack-ai#34588 (the record is drawn whole, values wrap) | nothing to do; the screenshots confirm | | 3. Approve looks weaker than Reject | half: Approve was already filled, Reject was filled red | Reject becomes a destructive outline | | 4. Two time formats on one page | held | the timeline uses the page's one face | - **The page title (`RecordDetailView`, new `approval-decision/approvalSubjectTitle.tsx`).** On a `sys_approval_request` page the header names the business record by the `record_title` the approvals get already serves for it, as a link through the page's own record route (`RelatedRecordActionsBridge`'s `recordHref` / `openRecord`, the route the "As submitted" card's "Open record" link takes). A plain click opens the record the way the page opens one, which is the record drawer one level down on a desktop record page; a modifier or middle click keeps the anchor's new-tab behaviour. The name is a link only once one of the page's own reads of the record returned it, the rule the card's link follows (objectui#12557, objectui#11878): `SubmittedRecord`'s current read and `RecordPreviewCard`'s read report what they found through the new `RecordReadReportContext` (`approval-decision/recordReadReport.ts`), which `RecordDetailView` provides on a request page only. The title makes no read of its own. A refused, unresolvable or platform-deleted subject is named as plain text. Where the get serves no `record_title`, or one equal to the bare `record_id`, the header keeps the request's own title (`process_label`), so the page never names its subject by a raw id. That is the guarantee objectstack-ai#24665 / PR objectstack-ai#24708 gave the H1, kept here. - **`RecordHeaderState.title` (`@object-ui/components`).** The host hands `{ text, node? }`, and `page:header` draws `node` (else `text`) in its H1 in both faces: in the host's top bar and in its own row (phone, and pages with no bar). Absent, or with an empty `text`, every title rung the header had is unchanged. It sits beside the state's existing `tags`, `group` and `stage`. - **No subtitle.** The strip directly under the title already names the flow in its Flow chip, so the flow is named once. The card's item 1 asked for the flow as a subtitle. Adding one would put back the duplicate the card's first bullet complains about, so this PR does not add it. This reading is the one the claim (comment 7060828003, scope item 2) records. - **The decision band (`DeclaredActionsBar`).** In the approver's band (`foldDecisions`, drawn by the request page's panel and by the business record page's band), a declared `danger` decision is drawn as an outline button in the destructive text colour. That is the face the record header's group already gives a secondary danger lever (objectstack-ai#35593), and the two now share one condition (`secondaryDanger`). Approve keeps the filled primary face. A bar that does not fold keeps the declared filled danger face, and overrides keep their amber face. - **One time face (`ApprovalActionTimeline`).** Action times render through core's `formatDateTime(…, { style: 'compact' })`, the face every `datetime` cell and the strip's `updated_at` chip draw, in the host's display time zone. They used to be the browser's `toLocaleString` (seconds, a 24-hour clock under zh-CN). The timeline on a business record page's approvals panel is the same component, so it changes too. - `plugin-approvals`: comments only, in `sys-approval-request.object.ts` and `sys-approval-request.page.ts`, saying where the request page now names its record. The object's `nameField`, `highlightFields` and the page metadata are unchanged. Not changed, per the card's "不做的": the structure of the progress and timeline cards. ## Why An approver opens a request to decide on a business record. The page was titled by the process, which the strip repeated, and the record it is about had no name in the header and no link from it. The reject button outweighed approve, and the page wrote one moment in two ways. ## Verification Tests added (each run red with its fix ablated, green with it): - `approvalSubjectTitle.test.tsx` (new): read by the page, the title links through the host route; not read, plain text; a host that routes nowhere, plain text; a plain click is the host's `openRecord`, a modifier click the browser's; no title or an id-only title keeps the page's own. Ablating the read gate reds the not-read case. - Served request page (console, real adapter stack): `servedPageRecordLink-12557` gains an H1 case (the H1 reads the subject and its plain click opens the same drawer, the page stays put) and the readable case now counts the card's link and the H1's; its refused CONTROL also checks the H1 is plain `INV-2020`. `servedPageReferenceStates-12489`: readable names and links the H1; deleted names it as plain `INV-3030`. `ApprovalsInboxPage.opensServedPage-12484`: the served page is recognised by the subject's title in its H1. Ablating the read gate reds the refused CONTROL; ablating the report provider reds the two H1-link cases. - `RecordDetailView.harness.test.tsx`, block `RecordDetailView.approvalSubjectTitle-35415` (real `RecordDetailView`, real `page:header`, desktop top bar): the H1 reads the served subject title, and with no reader of the subject on that page it links nowhere and reads nothing; no `record_title` keeps the flow label with no link; a `record_title` equal to the record id keeps the flow label and never prints the id; CONTROL: another object with the same fields keeps its own title. Ablating the host wiring reds the subject case only. - `page-header-record-bar-35593.test.tsx`, block `the record state's title (objectstack#35415)`: the host's node is drawn inside the H1 in the bar and in the row; text-only; CONTROL: an empty title leaves the record's own name. Ablating the renderer reds the three host cases. - `DeclaredActionsBar.approverFold-34361.test.tsx`, block `…leads with a filled Approve, Reject outlined (objectstack#35415)`: Approve `bg-primary`, Reject outline with `text-destructive` and no `bg-destructive`; CONTROL: a bar that does not fold keeps `bg-destructive`. - `RecordApprovalsPanel.displayLocale-9909.test.tsx`: the de-DE and en pins now read the compact face (`4.3.2020 3:30 pm`, `3/4/2020 3:30 pm`), and a new zh-CN pin equals `formatDateTime(…, { style: 'compact' })` with no seconds. The three "is a reading of the session" pins are unchanged and green. Local runs on this head (`88775b7e`, main `493ad095` merged in, so objectstack-ai#35983's two-row record header is in): - vitest, `ui/` root, on this head: every ui test file that names an approval request, `DeclaredActionsBar`, `ApprovalActionTimeline`, `RecordHeaderState`, `RecordPreviewCard`, `SubmittedRecord`, the record pointer card, `RecordDetailView`, `ApprovalDecisionPanel` or `page:header` (490 files, console included): `Test Files 490 passed`, `Tests 6483 passed`. The first CI run on `9097b572` was red in three console served-page files (16 tests); this commit is the fix, above. - `turbo run type-check` for `@object-ui/components`, `@object-ui/app-shell` and `@object-ui/console`, on this head: 0 `error TS`. - `eslint` over the changed files: 0 errors. - `overlap-check.mjs` on this head: clean against origin/main `493ad095`, objectstack-ai#36105 and objectstack-ai#35923. Browser (showcase `objectstack dev --seed-admin --fresh`, console `vite`, zh-CN, the seeded pending request on `EXP-2001`, opened as its approver through `/system/approvals?request=`), before and after at 1280 and 375, light and dark, in the project thread's evidence folder: - before: H1 `费用报告签批`, no link; Reject `bg-destructive`; timeline `2026/11/21 10:09:5x`. - after (shot on `a02cb373`, where the subject reads, so the gate added since draws the same page; with objectstack-ai#35983's two-row header: the crumb row reads 审批请求, the title row reads the record): H1 `EXP-2001`, linked to `/apps/com.example.showcase/showcase_expense_report/record/…`; a click opens `EXP-2001` in the record drawer; Approve filled, Reject outlined; timeline `2026/11/21 下午1:37`, the same face as the strip's `更新时间` chip. ## Acceptance notes - Read first, by risk: `ui/packages/components/src/renderers/layout/containers.tsx` (`hostTitle` / `chipTitle`, both faces), `ui/packages/app-shell/src/views/approval-decision/approvalSubjectTitle.tsx` and `recordReadReport.ts` (the link's read gate), `ui/packages/app-shell/src/views/DeclaredActionsBar.tsx` (`secondaryDanger`). - Two-minute check: open a pending approval from the approvals inbox. The top bar reads the record's name, not the flow's. Click it and the record opens. In the band, 通过 is filled and 驳回 is outlined in red. The 审批动态 time reads like the strip's 更新时间. - The subject link follows the page's record route, so it exists exactly where the "As submitted" card's "Open record" link does: a subject object the console can route to. Where it cannot, the title is the record's name as plain text. - Breadcrumb, recent items and favourites still name a request by its own title (the flow), as lists and search do. Only the request page's header names the subject. - Observed, not changed: at 375 px the strip's `更新时间` value is cut (`上午10:…`) in a half-width cell. That is the strip's layout, outside this card. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (Not touched.) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgW5RH2VUXjRj9dZYH2 <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgW5RH2VUXjRj9dZYH2 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…from a header icon; 动态 keeps system entries (objectstack-ai#36075) (objectstack-ai#36114) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu7W7AujnHuifjn8Luh1TnAA)_ repo:objectstack#1 · os-sales · session_01L6bhgXXdtDHm8mLZYX8Bsb Part of objectstack-ai#36075 Clause-②: yes (widening): `@object-ui/plugin-detail` adds exports (`CommentsPanel`, `CommentsButton`, `CommentThread`, `CommentItem`, `CommentComposer`, `CommentHoverActions`, `useRecordComments`, `buildCommentThreads`, `latestRepliers`, `RecordCommentsInPanelContext`) and their types (`CommentsPanelProps`, `CommentsButtonProps`, `RecordCommentThreadProps`, `CommentItemProps`, `CommentItemActions`, `CommentComposerProps`, `CommentHoverActionsProps`, `CommentThreadData`, `RecordCommentsData`), and an optional `reservedWidth` on `useRecordPageTier`. `RichTextCommentInput` (exported) now takes the `Esc` that closes its @ list (`preventDefault` and `stopPropagation`), so nothing round it acts on that key. `RecordActivityTimeline` draws no chip group when it is handed no chips. `@object-ui/components` adds an optional `comments` slot to `RecordTopBar` and `NavigationOverlay`, and the drawer leaves an `Esc` pressed inside a `[data-owns-escape]` region to that region. `@object-ui/i18n` adds five keys to every pack: `detail.closeComments`, `detail.collapseReplies`, `detail.commentActions`, `detail.commentsEmptyHint`, `detail.resolveThread`. Nothing existing is removed or re-typed. Metadata-protocol: none ## 维护者速读 - 电脑端的记录页和记录抽屉,头部(编辑按钮左边)多了一个评论图标,旁边是这条记录的评论数(顶层评论条数;objectstack-ai#36071 合并后改成未解决的线程数)。点一下打开评论栏,再点一下关上;开着还是关着,浏览器会记住,记录页和抽屉各记各的。 - 评论栏宽 380:顶上「评论」和 ✕,中间是评论线程(最早的在上),评论框固定在最下面。一条评论有回复时显示「N 条回复」和最近回复人的头像,点开在原地展开,下面有回复框;在任意一条上点「回复」会展开这个线程、光标直接进回复框。 - 鼠标移到一条评论上,右上角出现一排操作:回复、表情、更多(自己的评论才有编辑、删除)。「已解决」按钮已经做好,等 objectstack-ai#36071 合并后再接上,现在不显示。 - 窗口 1280 及以上,评论栏放在记录右边,记录内容让出 380;窗口小于 1280,评论栏盖在记录右侧。抽屉默认宽 720,评论栏盖住整个抽屉内容(✕ 或 Esc 回到记录,焦点回到评论图标;从列表打开的抽屉也一样,抽屉本身不关);抽屉宽到 760 及以上才左右并排。 - 「动态」页签只剩系统条目(活动、字段变更),没有评论框,也没有「全部 / 活动 / 讨论」这三个筛选(卡上点名去掉的三个)。「变更」筛选照旧保留:记录开着字段历史时才有,点一下只看字段变更,再点一下回到全部。动态的数字也不再算评论。 - 只在平台默认记录页和只填插槽的页面上出现(方案 C,13:24Z)。完全手写的记录页不动:showcase 的 project-detail、sys-queue、sys-audit-log 三个页面照旧在页脚放讨论区;对象关了评论(`enable.feeds: false`)就没有图标。手机端这次不改,评论还在动态页签里,等 objectstack-ai#36076。 ## What changes **The comment components** (`@object-ui/plugin-detail`, new `src/comments/`) - `useRecordComments()` reads the record's discussion off the host's `DiscussionContext` (the rows and the writes every feed block already gets) and returns the threads, the icon's count (`null` while unknown: loading, refused or failed), the loading, refused and failed states, and each write exactly where the host hands it. Nothing reads or writes any other way, so the phone's comment page (objectstack-ai#36076) can reuse every piece. - `buildCommentThreads(items)`: the `comment` rows only, threads oldest first, replies oldest first; a reply to a reply joins its thread; a reply whose parent is not held (deleted) stays as a thread of its own, so a delete never hides another member's reply. - `CommentItem` (avatar, name, time, edited mark, text, reactions with the viewer's own marked; an inline editor where Esc cancels and Ctrl/⌘+Enter saves, the draft kept when the save is refused), `CommentThread` (`expand` for the panel, `summary` for the phone's list; actions handed out per comment through `renderActions`), `CommentComposer` (keeps the draft when the write is refused; `focusSignal` puts the caret in it), `CommentHoverActions` (the desktop's one action row), `CommentsPanel`, `CommentsButton`. Every face is objectstack-ai#36070's shared `CommentAuthorAvatar`. - `RecordCommentsInPanelContext`: while the host sets it, the default page's `record:activity` stream (the 动态 tab and the 概览 rail's 最近动态 card) drops comment rows, its 全部 / 活动 / 讨论 chips and its composer (the 变更 chip stays, on objectstack-ai#30074's rule, and pressed again goes back to every entry), ignores a refused or failed comments read, and the tab row's count probe (`RecordTimelineCountProbe`) counts the same rows. An authored `record:activity` is untouched. - **Esc** (L1-c rework at `09b716c8`): an `Esc` in the panel closes it and puts the focus back on the comments icon. The `@` list's `Esc` closes the list only (`RichTextCommentInput` now takes the key), so the draft is kept. The panel closes on an `Esc` whose target is in its own DOM; its portaled menus close themselves. `defaultPrevented` no longer decides, because the drawer marks the key to hold itself open. The section carries `data-owns-escape`. - `useRecordPageTier(el, { reservedWidth })`: the tier is measured on the width left after the panel takes its 380. **The record page and the drawer** (`@object-ui/app-shell`) - One predicate, `commentsPanelOffered`, in `RecordDetailView`: an object definition with `enable.feeds !== false`, a page that takes the default columns (no assigned page, not a blocked named page: option C), not a phone, and a record id. It is the only place the rule lives. - While the panel is offered, the discussion rides the record's open request (`streamDiscussion`), so the icon's count is known without opening the 动态 tab; activity stays lazy as before (`activityFeedWanted` is the old `feedWanted`). - `recordCommentsPanel.tsx`: the widths and thresholds (`COMMENTS_PANEL_WIDTH` 380, `COMMENTS_PANEL_BESIDE_MIN_WINDOW` 1280, `COMMENTS_PANEL_DRAWER_SPLIT_MIN_WIDTH` 760), `commentsPanelPlacement` (`beside` / `over` / `cover`), the open state kept in `localStorage` (`os:record-comments-panel:page` and `:drawer`, every access guarded), and `RecordCommentsAside`. - The icon sits in `RecordTopBar`'s new `comments` slot, ahead of the button group, on the page; the drawer portals it into the same slot through `RecordPaneBarApi.commentsSlot` (`RecordPaneBarComments`); a pane without the bar draws it in the page header's trailing controls. **Drawer width chosen**: the default drawer is `md` (720), under the 760 split threshold, so the panel covers the drawer's body there; a drawer at 760 or wider splits, leaving the record at least as wide as the panel. **Strings**: `detail.closeComments`, `collapseReplies`, `commentActions`, `commentsEmptyHint`, `resolveThread` in all eleven packs and the provider-less defaults; everything else reuses existing keys. **Docs**: the plugin-detail README and `content/docs/frontend/plugins/plugin-detail.mdx` describe the panel. ## Why Card objectstack-ai#36075 (phase 1 of epic objectstack-ai#36062): comments were buried in the 动态 tab beside system entries, so a reader had to switch tabs to see or join a discussion. The card asks for a standalone comment panel on the desktop record page and drawer, reached from a header icon, and an Activity tab of system entries only. ## Side effects reviewers should know - **Hand-written pages keep their old discussion** (option C, seat 13:24Z): showcase `project-detail`, `sys-queue` and `sys-audit-log` still place a footer `record:discussion`, and get no icon. `sys-user` and `sys-organization` have feeds off; `sys-approval-request` has no discussion block on purpose. How a hand-written page opts into the panel is a phase 2 card. - **The 动态 tab keeps one chip on the desktop, 变更** (seat L2, 16:44Z): the card removes 全部 / 活动 / 讨论 only, and 变更 (objectstack#30074) is merged behaviour, offered on the same rule (only where the record shows its field history). With no 全部 beside it, the chip is a toggle: pressed again, it goes back to every entry. The phone keeps all its chips. - **The 动态 count leaves the comments out** wherever the panel is offered (page payload total less the comments it counted). - The panel draws every comment the read holds, oldest first, with no 20-row page: a conversation is read to its end. - Not in this PR: the resolved UI, the filter menu and the unresolved count (wait objectstack-ai#36071, wired in a second PR if objectstack-ai#36071 is slow); until then this PR is `Part of objectstack-ai#36075`. The shared avatar and the delete toast from objectstack-ai#36070 are in: main was merged after objectstack-ai#36105 landed at 16:04Z. Reactor names on hover are not on the card. ## Verification **New tests (all pass)** - `plugin-detail/src/comments/commentThreads.test.ts` (6): comment rows only, oldest first; replies and a reply to a reply nested; an orphan reply kept; same-instant order; a parent loop loses nothing; latest repliers. - `plugin-detail/src/comments/CommentsPanel.test.tsx` (13): oldest first, system rows left out; collapse and expand; Reply focuses the reply box and answers the thread's first comment; Edit and Delete only on the viewer's own comment; More → Delete, More → Edit saves; React; read-only offers no actions and no box; add, and the draft kept on a refused write; ✕ and Esc; empty; refused and failed with Retry; the icon's count and pressed state. - `plugin-detail/src/__tests__/recordActivity.commentsInPanel-36075.test.tsx` (7): no comments or composer in the stream and 变更 the one chip, with the control; the lone 变更 chip toggles back to every entry; no chip where the record shows no field history; a refused comment read does not replace the system entries; the count probe counts system entries only, with the control; an authored `record:activity` untouched. - `app-shell/src/views/recordCommentsPanel.drawerEscape-36075.test.tsx` (8): the REAL `NavigationOverlay` around the REAL panel, at the stack's root (a record opened from the list) and below it. Esc in the comment box and on ✕ closes the panel, the drawer stays at its level, and the focus returns to the icon. Esc in the `@` list closes the list only. CONTROL: Esc on a record control outside the panel does what the drawer always did. With either fix removed, its pins fail (4 of 8 without the drawer change). - `CommentsPanel.test.tsx` +2: Esc in the `@` list keeps the panel and the draft, and the next Esc closes the panel; Esc in the More menu closes the menu only. Both fail with their fix removed. - `RecordDetailView.commentsPanel-36075.test.tsx` +1: Delete in the panel goes through the page's confirm and toasts 「Comment deleted」 (objectstack-ai#36070). - `app-shell/src/views/recordCommentsPanel-36075.test.ts` (2): the 1280 and 760 thresholds. - `components/src/__tests__/record-top-bar-comments-36075.test.tsx` (2): the slot sits ahead of the button group in both bar shapes. - `app-shell/src/views/RecordDetailView.commentsPanel-36075.test.tsx` (8), the real `RecordDetailView`: icon and count on the default page; open beside at 1440 and close; over at 1100; kept open for the next record; drawer cover, remembered apart from the page; the stream draws no comment and the panel does, once; no icon with feeds off; no icon on a hand-written page, which keeps its discussion. **Changed tests**: 38 cases in 11 `RecordDetailView.*` files read the default page's comments off the 动态 stream; they now read them in the comment panel (same rows, same reads, same grants), and the counts drop the comments: `feedLoading`, `feedRecordScope`, `feedLoadFailure-29188`, `harness` (feedRefusal-11195), `replyCountOnRead-12144`, `discussionExplicitComposition-7298`, `discussionFallbackPipeline-8983`, `recordOpenOneRequest-28470`, `recordOpenWaves-13010`, `recordPageTiers-26678` (变更 alone, a toggle, where `trackHistory` is on and the audit read answers; no chip without it or on a 403), `timelineCount-28737`. Authored-page cases in those files are unchanged. No test deleted or skipped. **Local runs**: every `app-shell/src/views/RecordDetailView.*`, `recordDrawer*` and `components/src/custom` test file (98 files) pass, the 11 above after their change and three that first failed to resolve `@objectstack/client` before its build on a re-run; every new file above passes. The whole app-shell, plugin-detail and components suites (3,274 files) did not fit a local run and were stopped; CI is the full reading. `type-check` (src and tests) clean for plugin-detail, components and app-shell; ESLint on every changed file: 0 errors; `check:i18n-keys`, `check:i18n-drift`, `check:new-line-citations` pass; `overlap-check.mjs`: clean against main and the 6 open PRs that share a file. **Browser evidence** (CRM example on `objectstack dev`, console on Vite, zh-CN, an account seeded with three threads, one with two replies): `/mnt/project-files/build-seat1/36075/` (seat-side folder). | Reading | Result | |---|---| | Page, 1440, light and dark, panel closed → open | icon 「3」, pressed when open; panel `beside`, 380 wide at x 1060; the record columns narrow to leave it the width | | Page, 1100, light and dark | panel `over`, 380 wide at the right edge, record columns keep their width | | Drawer (list → Initech), light and dark | the icon in the drawer's record row; panel `cover`, the drawer body's whole width (718) | | Thread states | 「2 条回复」 with the replier's face; expanded with the reply box and 「收起回复」; hover row (回复, 表情, 更多) with 编辑 / 删除 open | | 动态 tab | no 全部 / 活动 / 讨论 chips, no composer, no comment rows (shot taken before the 变更 chip was kept) | | A record with no comments | empty state with the hint, composer at the foot | ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the 维护者速读 block is the maintainer's summary, in the maintainer's language). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. Branch name is the harness-assigned `claude/project-thread-ks7hy1`. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgXXdtDHm8mLZYX8Bsb)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgXXdtDHm8mLZYX8Bsb <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgXXdtDHm8mLZYX8Bsb --> --------- Co-authored-by: Claude <noreply@anthropic.com>
… drawer; lookup cells draw an edit button (objectstack-ai#36015) (objectstack-ai#36128) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuLB1HMq57UcoRZFjpa8YhHZ)_ repo:objectstack#1 · os-sales · session_01L6bhgWkLah49N6UoD4CS3S Fixes objectstack-ai#36015 The card's 11:13Z revision (maintainer: 「同意,改卡」): a single click on a lookup chip opens that record in the side drawer, and a lookup cell has a pencil button. objectstack-ai#36033 landed the rest of the card with `Refs objectstack-ai#36015`; this PR is the lookup-cell part and closes the card. Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 列表里单击关联记录的小标签(比如联系人列表里的「客户」),右侧抽屉打开那条记录,列表不动。关掉抽屉后,滚动位置和选中的格子都还在。 - 点格子里小标签旁边的空白,只是选中这一格。一格里有几个标签,点哪个开哪个;选中后按 Ctrl+Enter / Cmd+Enter 在抽屉里开第一个;按住 Ctrl / Cmd 点,仍是新标签页整页打开。 - 关联格在鼠标移上去或已选中时,右边出现铅笔按钮,点了进入编辑(出现关联记录选择器),和双击、回车一样。没有编辑权限、字段只读、记录被锁时不出现。这个位置原来放「打开」图标,关联格不再画它。 - 人员的小标签(负责人、创建人,指向 `sys_user` 的关联)不变:单击只选中,选中后有「打开」图标,没有铅笔。邮箱、电话、网址、名称列都不变。手机上照旧整页打开。 - 抽屉的网址带上了记录和它的对象(`?recordId=…&recordObject=…`):刷新后抽屉还在,按后退关掉抽屉,和名称列「在侧边打开」一样。 - 风险:改到五个包(字段格子、表格、网格、列表、控制台抽屉);给宿主加了两个可选接口,不传时行为和以前完全一样;没有新文案键(铅笔用已有的「编辑」`table.edit`)。 ## What changes On a grid with the select-first cell model whose host opts in (today the console's list page), a **reference cell** is a column of `lookup`, `master_detail` or `tree` type whose `reference` is not `sys_user`. **`@object-ui/fields`: `index.tsx`** - `ReferencedRecordLink`'s anchor carries `data-record-object` and `data-record-id`, the record the chip names. Nothing else changes in its markup or its click. **`@object-ui/components`: `context/gridCellSelection.tsx`, `index.ts`** - `GridCellSelection` gains an optional `referenceCells?: GridReferenceCells | null`. `GridReferenceCells` (exported as a type) is `isReferenceColumn(columnKey)` (asked per column on every render, so it answers from the column alone) and `openRecord(objectName, recordId)`. **`@object-ui/components`: `renderers/complex/data-table.tsx`, `dataTableCellSelection.ts`** - New `recordChipAt` / `firstRecordChip`: the record a chip (`a[data-record-link][data-record-object][data-record-id]`) at or around the target names. - In a reference cell, the select-first `onClickCapture` that objectstack-ai#36033 added still cancels a plain click on the chip and selects the cell, and then calls `referenceCells.openRecord` for the chip clicked. A click beside the chips only selects. Ctrl, Cmd, Shift and Alt clicks, a non-primary button and a touch tap pass through to the link as before. - A double-click on a reference chip does not also edit the cell (its first click opened the record). - Ctrl/Cmd+Enter on a selected reference cell opens its first chip through `referenceCells.openRecord`; every other cell keeps objectstack-ai#36033's behaviour. - New `CellEditButton` in every reference cell while no editor is open: a pencil at the cell's right edge, labelled with the existing `table.edit` key, shown on cell hover (`group-hover/cell`) and while the cell is selected. Its click calls `attemptEdit`, the same gate double-click and Enter pass through. It is drawn only when `readOnlyReasonOf(row, col)` is `null`; that is asked when the pointer enters the cell and when the cell becomes selected, never per render (the `describeCell` contract). It takes no focus. A reference cell does not draw objectstack-ai#36033's `CellOpenButton`. **`@object-ui/plugin-grid`: `ObjectGrid.tsx`** - New runtime prop `openReferencedRecord?: (objectName, recordId) => void`. With `cellSelection` and this prop, the grid's `GridCellSelection` carries `referenceCells`: `isReferenceColumn` reads the column's field (`opensReferenceInPlace`: lookup / master_detail / tree, reference not `sys_user`), `openRecord` is the prop. **`@object-ui/plugin-list`: `ListView.tsx`** - New host prop `openReferencedRecord`, handed to the grid only (`object-grid` views), as `recordLinkAdornment` is. **`@object-ui/app-shell`: `urlParams.ts`, `views/objectViewRecordNavigation.ts`, `ObjectView.tsx`, `objectViewListRenderer.tsx`, `objectViewRecordOverlay.tsx`, `recordDrawerStack.tsx`** - New reserved URL param `RECORD_DRAWER_OBJECT_PARAM` (`recordObject`), listed in `RESERVED_URL_PARAMS`: the object of the drawer root's record when it is not the listed object. - `handleOpenReferencedRecord(objectName, recordId)`: the listed object's record opens as the name cell's 「在侧边打开」 icon opens it (`?recordId=` only); another object's sets `?recordId=` and `?recordObject=` (a push, so Back closes it). A chip clicked while the drawer is open swaps its root. - `drawerRoot` is that record when `?recordObject=` names another object the console knows and the server reads one record of (`servesRecordRead`); it has no sibling set, so the drawer draws no ↑ ↓ counter. Unknown or unread object: no drawer. - Closing the drawer, the name cell's icon and the page origin a phone redirect builds drop `?recordObject=` with `?recordId=`. - The drawer's ⤢ at a root of another object opens that object's page (`expandedRecordPath`); the listed object's root keeps its list-relative route and origin. - On a phone a `?recordObject=` link answers with that record's own page, as `?recordId=` does for the listed object. - `RecordStackDrawer` takes `listObjectName`; the list marks the root's row as active only when the root is a record of the listed object. - `ObjectView` passes `handleOpenReferencedRecord` only when its list has the drawer (`navOverlay.mode === 'drawer'`, not a phone), the same condition as `openInPanel`. A list whose rows open nothing (`none`, a list-only object) keeps objectstack-ai#36033's behaviour: the chip only selects. **Field types this reaches:** `lookup`, `master_detail`, `tree` drawn through `LookupCellRenderer` / `ReferencedRecordLink`, when the referenced object is routable from the list (the chip is an anchor only then). A `user` field (`UserCellRenderer`, avatars) draws no link and is untouched. **Readings (claim A–G):** - **A.** Only grids whose host passes `openReferencedRecord` (the console's object list). Every other host keeps objectstack-ai#36033's behaviour. - **B.** Ctrl/Cmd+Enter on a lookup cell opens its first chip in the drawer. - **C.** Person cells (lookups to `sys_user`) draw no pencil and keep objectstack-ai#36033's open button. - **D.** A chip clicked with the drawer open swaps the drawer's root, as the name cell's icon does. - **E.** A lookup to the listed object itself opens the listed object's drawer, with `?recordId=` alone. - **F.** A chip with no link (unroutable, unread, restricted or name-only) only selects; an editable cell still draws the pencil. - **G.** The drawer's record and object live in the URL, as `?recordId=` does (ui `AGENTS.md` objectstack-ai#8). Docs: `content/docs/frontend/plugins/plugin-grid.mdx` § On an object's list page (new bullet after the click bullet; the click bullet objectstack-ai#36033 wrote now leaves out the lookup chip a host opens in place). objectstack-ai#36033's changeset is untouched; this PR's own changeset says it (Notes, below). ## Notes - **objectstack-ai#36033's pending release note is left as it is** (`.changeset/36015-list-cell-click-only-selects.md`, restored from the base in `87d42cbd`; head `b59bf991`..`9c225b51` had added a sentence to it as a declared correction, which kept `Check Changeset` red). This PR's own note, `.changeset/36015-lookup-chip-opens-in-drawer.md`, now says what it changes about that note instead: "This replaces, for lookup chips on that page, the earlier change in this release where a plain click on a lookup chip only selected its cell." The docs bullet in `plugin-grid.mdx` keeps the L1-b N1 rewording. ## Tests Added, each a top-level `describe` in the component's existing harness file: - `components/src/__tests__/data-table-select-first-35684.test.tsx`, "a reference chip opens its record in place": a plain click on the chip calls `openRecord` with the chip's record, cancels the default and selects the cell, and a double-click on it opens no editor; a click beside the chip only selects, Ctrl and Cmd clicks follow the link; Ctrl+Enter opens the first chip through the host; the edit button is hidden until the pointer enters the cell, then shown on hover and while selected, opens the editor, and the cell draws no open button; a cell the host says opens no editor draws no edit button; a column the host does not name (a person) keeps the link behaviour and the open button; control: with no `referenceCells` the chip only selects and no edit button is drawn. - `plugin-grid/src/__tests__/ObjectGrid.cellSelection-35684.test.tsx`, "a lookup chip opens its record in the host's place": through `ObjectGrid` with a routing host, the account chip carries `data-record-object` / `data-record-id` and a single click calls `openReferencedRecord('crm_account', 'a7')` without following the link; the lookup cell's edit button opens its editor and the `owner_id` (lookup to `sys_user`) cell draws none; a person chip only selects; control without the prop. - `app-shell/src/views/objectViewRecordNavigation.listRows-27524.test.tsx`, "a lookup chip opens the record it names in the list's drawer": the URL params for another object and for the listed object, `drawerRoot` for another object (no siblings), for an unknown object (`null`) and for the listed object (siblings kept), close drops both params, ⤢ opens the other object's page. - After L1-b's S1 (fixed in `9c225b51`: a double-click on a chip opened its record twice, so the console's router pushed the same URL twice and the first Back left the drawer open). The grid opens a chip on a click's first press only (`e.detail > 1` opens nothing), and `handleOpenReferencedRecord` returns when the URL already names that record of that object, which also covers a fast repeat click. Each test below fails without the fix: - `data-table-select-first-35684.test.tsx`, "a double-click on the chip opens its record once": click, click (`detail: 2`), dblclick; `openRecord` is called once and no editor opens. - `objectViewRecordNavigation.listRows-27524.test.tsx`, "the record the drawer already shows is not pushed again": no `setSearchParams` for the record already shown, of another object or of the listed one; the same id under another object still opens. - same file, "in a router: a chip opened twice (a double-click) leaves one history entry, and one Back closes the drawer": a declarative `MemoryRouter` (it pushes on every navigate, the same URL included); after two opens the URL names the record, and one `navigate(-1)` returns to `?view=all`. No existing test was rewritten or dropped. Local runs. First on main `8145424b` merged with objectstack-ai#36033's head `cefd3e31`, a full `pnpm build`: - `vitest run packages/components/`: 501 files passed. `packages/fields/`: 316 passed. `packages/plugin-grid/`: 298 passed. `packages/plugin-list/`: 181 passed. - `packages/app-shell/` in full did not finish inside this container's 50-minute window; the parts this diff touches ran: `src/views/ObjectView*`, `src/views/objectView*`, `src/views/__tests__/recordDrawer*`, `src/views/__tests__/recordPane*`, `src/urlParams*`, `src/__tests__/`: 128 files passed. - After objectstack-ai#36033 merged, the change was replayed on main `dc10b3b4` as one commit (conflicts only in `objectViewListRenderer.tsx`'s memo dependencies and the two appended describes of `ObjectGrid.cellSelection-35684.test.tsx`, both sides kept), then a full `pnpm build` and `vitest run` of `components/src/__tests__/data-table*`, `plugin-grid/src/__tests__/ObjectGrid.cellSelection*`, `app-shell/src/views/objectViewRecordNavigation*`, `app-shell/src/views/__tests__/recordDrawer*` and `fields/src/`: 348 files passed (2 skipped). - `type-check` in `components`, `fields`, `plugin-grid`, `plugin-list`, `app-shell`: exit 0 (on both bases). - `eslint` on the changed files: 0 errors. - `overlap-check` on the pushed head `b59bf991`: clean against `origin/main` (`dc10b3b4`, objectstack-ai#36033 merged) and the four open PRs sharing a file (objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024). - `87d42cbd`: `main` `6c7c6db2` merged in (clean). `check-empty-changeset` and `check-changeset-no-major`: pass. `overlap-check`: clean against `main` and objectstack-ai#36123; objectstack-ai#36133 (draft) conflicts only on the one-line `useMemo` dependency list in `objectViewListRenderer.tsx`, which each PR extends by one name; the second to land merges `main`. ## Verification (browser) CRM and Todo examples (`--fresh`), Console via Vite on this tree, Chromium, 1280 light and dark, 375 light and dark. Screenshots and the journey log: project folder `build-seat1/36015/PR2/` (`after-*`, `after-journey.log`). The before state is objectstack-ai#36033's after state (`build-seat1/36015/after-*`): a chip only selected its cell. | Step | After | |:--|:--| | Contacts, hover the Account cell | pencil at the cell's right edge | | Click the Acme Corp chip | drawer opens Acme Corp (`?recordId=…&recordObject=crm_account`), the list stays, the cell is selected | | Close the drawer | params gone, the Account cell still selected | | Click beside the chip | cell selected, nothing opens | | Click the pencil | the lookup editor opens in the cell | | Ctrl+Enter on the selected Account cell | drawer opens Acme Corp | | Click the email text | cell selected, no navigation, open button in the cell | | Click the name | the contact's record page | | Todo tasks, hover the Assigned To cell (lookup to `sys_user`) | no pencil | | Click the Dev Admin chip | cell selected, page stays, open button on hover | | 375 | phone cards (no grid), unchanged | ## Acceptance notes 1. Click a lookup chip: the drawer opens that record, the list stays, closing it keeps scroll and selection: yes (browser). 2. Click beside the chip: the cell is selected, nothing opens: yes. 3. Hover a lookup cell: a pencil; it opens the cell's editor (the lookup picker); none on a read-only field: yes (browser for the pencil and the editor; read-only unit-pinned). 4. Person chips (owner): single click only selects: yes (browser, Todo's Assigned To, a lookup to `sys_user`). 5. Ctrl/Cmd-click a chip opens the record in a new tab: yes (the click passes through to the anchor; unit-pinned). 6. Email, phone, URL, Ctrl/Cmd+Enter on them and the name column: unchanged from objectstack-ai#36033: yes. 7. This body lists the field types reached and the tests: above (none rewritten). --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWkLah49N6UoD4CS3S <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgWkLah49N6UoD4CS3S --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…es and publishes it; layout and row colour join the list draft (objectstack-ai#35955 PR 2) (objectstack-ai#36123) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuG6LywHEovAnGuZpiKQEc2W)_ repo:objectstack#1 · os-sales · session_01L6bhgWyeXh2Keywo6oK1Nn Part of objectstack-ai#35955 (PR 2 of three: PR 1 objectstack-ai#36026 made a list change a draft; PR 3 retires the server-side list preference and runs in parallel. The card stays open.) Clause-②: yes (widening) — five new `console.objectView.draft.*` keys in every `@object-ui/i18n` locale pack (`saveToViewConfirmTitle`, `saveToViewConfirm`, `saveToViewConfirmButton`, `savedForEveryone`, `pendingDraft`); `@object-ui/plugin-list` `ListView` gains the optional host prop `onRowColorChange` and two optional `viewDefaults` members, `viewType` and `rowColor`; nothing removed or renamed Metadata-protocol: none ## 维护者速读 - 共享视图上,能改这个视图的人(管理员,且视图所在的包接受保存)在「保存 ▾」里也看到「保存到这个视图」:先问一次「所有用这个视图的人都会看到」,确认后存并立刻发布,提示「已保存,所有人可见」。选项菜单里的「保存」同一条路。 - 这个视图已有没发布的修改(谁存的都算)时什么都不写,提示先去视图设置里发布或放弃;不替任何人发布。保存人的行高、列宽不会写进共享视图。 - 显示面板的「布局」「行颜色」现在也是草稿:点开记录再回来还在,两条「保存」都会存进去,「放弃」还原成视图自己的。 ## What changes **Save to this view on a shared view** (`ObjectView.tsx`, `objectViewViewCrud.tsx`, `runtime-metadata-persistence.ts`) - Offered when `canSaveToSharedView`: not an environment list, not a personal view, and the same test the footer calculation's pick uses (`isAdmin && !activeViewPackageRefusesSaves && isSavedViewId(savedViews, id)`), so a read-only package's view and the fallback tab never get it. A personal view keeps its own save. The phone / narrow `Save ▾` is the same component; the options menu's Save calls the same handler. - It asks once through `confirmHandler` (`saveToViewConfirmTitle` / `saveToViewConfirm` naming the view / `saveToViewConfirmButton`, cancel `console.objectView.cancel`). - The body is the view's own config with the draft laid over it (`layListStateOverView`, split out of `buildPersonalViewConfig`), then `buildViewConfigSaveBody`, the body the view settings panel saves. The reader's row height is left out (`rowHeight: undefined` on the laid preference, F5); column widths never travel. - New `saveAndPublishRuntimeMetadata(type, name, body, ctx)`: a draft write with the first-write pin (`{ mode: 'draft', ifNoneMatch: '*' }`), then `publish`. A `409 METADATA_CONFLICT` on the write means a draft is already pending; it resolves `'pending-draft'` and nothing is written or published. A publish the server refuses discards the draft this save wrote (`reset(type, name, { state: 'draft' })`) and rethrows. Caches are invalidated and the draft ledger announced on both paths. - `handleViewSaveAndPublish` shows the saved body at once (`setViewDraft`) and lets `handleDraftBarChange` drop it when the saved-views re-read lands (objectstack-ai#36031), so the list does not flash the old sort. On `'published'` the list draft is dropped (`handleResetView`) and "Saved, visible to everyone" is toasted; on `'pending-draft'` the draft stays and `pendingDraft` is toasted. - Using the server's pin instead of a client read of the draft closes the read-then-write window the premise read named (P4). The window left is between this save's draft write and its publish: the view settings panel writes its draft without the pin, so a settings save landing in those milliseconds would overwrite this draft and be published with it. A known edge, not closed here: card objectstack-ai#36137. **Layout and row colour join the draft** (`objectViewListRenderer.tsx`, `ListView.tsx`, `personalViews.ts`) - The renderer wires the published `onViewChange` to `listDraft.patch({ viewType })` and the new `onRowColorChange` to `listDraft.patch({ rowColor })`; picking the view's own value drops the entry. The draft's values go to `ListView` as `schema.viewType` / `schema.rowColor`, and the view's own through `viewDefaults.viewType` / `viewDefaults.rowColor`, so the `layout` / `rowColor` parts and the Display count still judge against the view after a remount. - `ListView`: `onRowColorChange` fires on a pick in the row colour panel (the rule in force) and on Clear (`null`), never at mount or for a reset. Each new `viewDefaults` member is read only when its key is present; without them nothing changes. - Both saves read them: `PersonalViewListState.display` carries `viewType` and `rowColor`; a layout switch retypes the view and fills the kanban / gallery mirror from the saved columns when the block lacks one (`IN_PLACE_COLUMN_MIRRORS`). Save as my view builds from `listDraft.draft.viewType ?? activeView.type` and passes the row colour. **i18n**: the five keys in all ten hand-written packs; zh-Hant regenerated (`pnpm gen:zh-hant`). **Docs**: `ui/packages/plugin-list/README.md` (new host-props section), `content/docs/ui/views.mdx` (§ "A user's list state never writes the view"), `docs/qa/platform-checklist/areas/records-forms.json` `records-forms.adhoc-filter-sort-builder` revision 14 (steps[8], acceptance[5], negative[4]; not loosened). ## Tests - New `ObjectView.sharedViewSave-35955.test.tsx` (8): confirm, then `save(... { mode: 'draft', ifNoneMatch: '*' })` then `publish`, body carries the draft sort and the view's own row height `short` while the reader's stored one is `tall`; cancel writes nothing; pending draft (409 `METADATA_CONFLICT`) writes nothing more and toasts; refused publish resets the draft; a read-only package's view is not offered; layout and row colour laid into the schema and `viewDefaults` and kept across a remount; picking the view's own value drops it; the save retypes to kanban with its columns mirror and the row colour. - `runtime-metadata-persistence.test.ts` (+4): published; pending-draft; a `409` with another code (`DESTRUCTIVE_CHANGE`) rethrows; refused publish resets and rethrows. - `ListView.personalization-28950.test.tsx` (+4): the `rowColor` part judged against `viewDefaults`, a control without them, `onRowColorChange` on pick and on Clear (`null`), and no call at mount. - `ObjectView.personalViews-29635.test.tsx` (+1): the draft row colour reaches the personal save and Save as my view. - L1-b S1 (`ObjectView.sharedViewSave-35955.test.tsx` +3, `ObjectView.personalViews-29635.test.tsx` +2): the confirm and Save as my view's default name read the view's tab label (`listLabel`, `viewTabLabel`), with a view that has no label and one whose label is a locale map (plus a plain-label control on the confirm). Ablated: the raw label turns the locale-map confirm case and both copy-name cases red. In the shared-view harness a stored view with no label already arrives named by its name, so that case is a pin, not a discriminator. - `ObjectView.listUrlState-11860.test.tsx` (+2, G2): a reload whose address was rewritten before the seed applies its `uf_*` state; a reload on a record page then Back applies the list entry's `uf_*` state. Pins of current behaviour, no behaviour change. ## Acceptance notes - P3 (seat 14:28Z): any pending draft refuses, the saver's own earlier draft too; the server does not record a draft's author. - F5: a shared save never carries the saver's row height or column widths; a personal save still carries the row height, as on main. - The view settings panel and the footer calculation still save a shared view as a draft that the view settings publish (ruling 7045525672 unchanged). - Not touched: where column widths, row height and the view order are stored (PR 3). - Landing order with objectstack-ai#36133 (PR 3): both bump `records-forms.adhoc-filter-sort-builder` to revision 14 and edit the same section of `content/docs/ui/views.mdx`. Whichever lands second renumbers to 15 and merges the two history entries. - L1-b N1 taken: the pending-draft test is `isDraftVersionConflict` from `DraftConflictDialog.tsx`, the predicate the other draft-door callers use. ## Verification CI and local runs at head `da8b797b`; the S1 commit's tests and type check at `0ada6797`. - CI: every check green (54 passed, 10 skipped by path), mergeable clean. The first head (`433d7c02`) went red on four pins, each fixed in its own commit: the `rowColor` firing control in `object-view-unmirrored-keys-7779.test.ts` now reads `const viewOwnRowColor = viewDef.rowColor ?? listSchema.rowColor;` (the relay reads the view's own rule once, so the draft's can lie over it); the de quote-pair count in `de-quote-pairing-3876.test.ts` goes 120 to 121 for `saveToViewConfirm` („{{name}}“); three `viewDefaults` equalities in `ObjectView.userListState-12418.test.tsx` gain `viewType`; a checker narrowing in the new test is read through a cast. No pin was loosened: each asserts the same thing at the new spelling. - Local (`pnpm --dir ui exec vitest run` over `app-shell/src/views/ObjectView*`, `runtime-metadata*`, `personalViews*`, `listDraft*`, `plugin-list/src/__tests__/ListView*`): 237 files, 2290 tests; the only 3 failures were the `viewDefaults` equalities above, 40/40 after the fix. `packages/i18n`: 105 files, 1962 passed. `packages/types` 7779: 236/236. - `pnpm --dir ui/packages/app-shell run type-check` exit 0; `pnpm --dir ui/packages/plugin-list run type-check` exit 0 (both include `tsconfig.test.json`). - eslint on every changed `ui/` source and test: 0 errors. `check:i18n-keys`, `check:i18n-drift`, `check:control-bytes`, `check:vi-mock-specifiers`, `check:vi-mock-override-shape`, `check:metadata-write-doors`, `check:changeset-claims`, `check:pending-changeset-literals`, `check:readme-exports`, `check:new-line-citations` exit 0; `node scripts/check-platform-checklist.mjs` OK. - `node scripts/pm/overlap-check.mjs --base=origin/main`: clean against main `dc10b3b4` and open objectstack-ai#36114, objectstack-ai#36105, objectstack-ai#36096, objectstack-ai#36024. - Clause-② measured on the built `ui/packages/plugin-list/dist/ListView.d.ts`: `onRowColorChange` and the two `viewDefaults` members are added, optional; no member removed or narrowed. The seat runs the declaration L2. - Browser, at `0ada6797` (showcase `objectstack dev`, the `ui/` HMR console pointed at it; checklist `records-forms.adhoc-filter-sort-builder` steps[8]), on a shared view the admin created and published (`showcase_task.team_tasks`, package `com.example.showcase.custom`): - admin, sort by Priority: Save offers "Save to this view"; the confirm reads "Everyone who uses “Team tasks” will see these changes."; confirming sends `PUT /api/v1/meta/view/showcase_task.team_tasks?mode=draft` with `If-None-Match: *` (200) then `POST …/publish` (200) and toasts "Saved, visible to everyone"; Discard and Save go. - a second reader who is not an administrator (`phone.demo@example.com`) opens the view sorted by Priority, and after a sort of their own is offered only "Save as my view". Control: on the read-only package's `showcase_task.in_progress` the admin is offered only "Save as my view" too. - with a draft of the view already pending, the admin's confirmed save gets `409` on the pinned `PUT`, sends no publish, toasts the pending-draft hint and keeps Discard and Save; the pending draft is still there afterwards and the live view unchanged. - Not driven in the browser: the row height (F5) and the layout and row colour round trip, pinned in the unit tests above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgWyeXh2Keywo6oK1Nn --- _Generated by [Claude Code](https://claude.ai/code)_ <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgWyeXh2Keywo6oK1Nn --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
repo:objectstack#1 · os-sales · session_01L6bhgU81jVj4Jk1kQNvLJ5
Fixes #36070
What changes
Four small fixes to comments (epic #36062, phase 1), made in the shared pieces so the comment panel of #36075 carries them over:
ThreadedRepliestakes a new optionalfocusReplyOnOpenprop: each time its reply input opens, it expands the replies (when collapsed) and focuses the input.RecordActivityTimelinepasses it behind its Reply button. Defaultfalse, so a host that always shows the input does not have every thread pull focus on mount.CommentAuthorAvatar(exported from@object-ui/plugin-detail): the author's image, or their initials on the sameAvatar/AvatarFallbackdisc the people-field chips andPersonRowdraw, with the samegetPersonInitials(now exported from@object-ui/fields). It replaces the comment icon on every comment and the hand-drawn first-letter disc on every reply.RichTextCommentInputmeasures the caret with a mirror element (textareaCaret.ts) and opens the menu under the caret's line, or above it when the window has no room below (menu taller than the space under the line, and more space above). Where layout cannot be measured, it keeps its old place over the editor's top left. Candidates and notifications are unchanged.handleDeleteCommentshows a success toast "Comment deleted" (zh 评论已删除) after the server deleted the row. A refused delete keeps its error toast. New keydetail.commentDeletedin all eleven locale packs.Not changed: where comments sit and how they are structured (#36075 / #36076).
For #36075 to reuse:
CommentAuthorAvatar(avatar/initials),ThreadedReplies'focusReplyOnOpen(passtruewherever the reply input opens behind a Reply button), the mention placement insideRichTextCommentInput(comes with the component), and the delete toast in the host'shandleDeleteComment(comes with the handler).Why
Measured on main in the showcase (account record, Activity tab, 1312 wide): after Reply, focus stayed on the Reply button, so typing went nowhere; on a comment with a collapsed reply, Reply showed the input but not the reply; comments without an avatar showed a comment icon; the mention menu opened at the editor's top left; a delete showed nothing.
Verification
plugin-detail/src/__tests__/commentSmallFixes-36070.test.tsx(10 tests): focus and expand on Reply, a CONTROL that the default does not pull focus, initials (Latin and CJK) on comment and reply, the menu below / above / clamped to the box / fallback when unmeasurable.RecordDetailView.feedCommentEditDelete-12268.test.tsx: the delete now also asserts the success toast; Cancel and a refused delete assert none.STREAM_ICON_CELLhad no reader left once the avatar cell replaced it; it is removed, andui/e2e/narrow-drawer-time-34614.spec.tsnow readsCOMMENT_AVATAR_CELL(tokensshrink-0,w-5), the cell the row draws.plugin-detailsuite 3660 passed;i18n+fields5050 passed;plugin-detailtype-check clean; eslint on the touched files clean of new warnings.493ad095, after = this branch. Focus read fromdocument.activeElementafter Reply: beforeBUTTON Reply, afterINPUT Reply…; typed text lands in the reply input. Delete: before no toast, after "Comment deleted".Reply on a comment with no replies, then typing without clicking (before / after):
Reply on a comment whose reply is collapsed:
Author avatar (no image set: initials):
Mention menu,
@at the end of the second line:Delete:
Phone width (375, after): Reply on the collapsed thread expands it and focuses the reply box;
@on the second line opens the menu under the caret.The evidence images live on this branch's commits
7e6998c0andadbf13dfand are each removed in the next commit, so they never reach main.Clause-②: yes (widening)
Metadata-protocol: none
Widening:
ThreadedRepliesProps.focusReplyOnOpen(optional),CommentAuthorAvatar+CommentAuthorAvatarPropsexports,getPersonInitialsexport from@object-ui/fields, locale keydetail.commentDeleted. Nothing removed or changed in meaning.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lint).main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgU81jVj4Jk1kQNvLJ5