Skip to content

feat(console): a grid row whose record has open comment threads shows a dot after the record name - #39106

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-39082-grid-row-comment-dot
Dec 2, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-39082-grid-row-comment-dot

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #39082

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:对象列表页的表格里,有未解决评论的记录在名称后面多一个小圆点,鼠标悬停显示「未解决的评论:N」;看板不变。
  • 为什么做:列表页评论入口专题的第一张打底卡,让主管和销售在列表上一眼看出哪几条记录还有没处理的评论。
  • 出错会怎样:最坏是圆点该有没有、该消失没消失,列表本身照常显示,不报错;直接撤回这次改动即可。
  • 要你做什么:无。

What changes

On an object's list view drawn as a grid, a record with at least one open comment thread (top-level, not resolved) shows a small dot after its name (epic #39077 ruling 7; Q4 and Q5 answered 「按推荐」: open threads only, every object with feeds on, marker only, object list views only).

  • Read: a new sibling module, objectViewRowCommentDot.tsx, wraps the list the renderer draws. It takes the rows the list reports through onRowsChange (still relayed to the host's handler unchanged), and feeds their ids to the existing useRecordCounts from @object-ui/plugin-detail, with comments asked and attachments not. The hook is unchanged. A page of rows costs one grouped read (POST /data/sys_comment/query, record_id IN (page ids), parent_id null, is_resolved not true), never one per row. It is asked again on a new page (the id set changes), on a list re-read (the renderer's combined refresh key is the hook's reloadKey), and on a sys_comment write announced on the data-invalidation bus.
  • Gate: only where objectDef.enable.feeds !== false (the record page's own test, ruling 8), and never while the list draws a board. A board reports its cards through the same onRowsChange channel. A report made under a board is tagged and never read as grid rows, before or after a layout switch.
  • Composition: the grid's single rowAdornment is now composed: the managed environment's Users marker and the dot each draw where they apply, and both draw when both apply. When no row has an open thread, the grid gets exactly the adornment it got before (the host's, or none), so its title cells are unchanged.
  • Accessible name: the dot is role="img" with aria-label and title from the existing kanban.cardFooter.comments key ("Open comments: {{count}}", zh-Hans 「未解决的评论:{{count}}」). It is the same number the board's foot count shows, so no locale key is added.
  • Renderer: objectViewListRenderer.tsx only adds the call. Its return ( became const drawList = (dots) => (, so the ListView JSX keeps its indentation, and the function returns the wrapper keyed by the list identity. Two props now read dots.*.
  • Docs: content/docs/frontend/plugins/plugin-grid.mdx, under "A node beside a row's title".

Tests

New ObjectView.rowCommentDot-39082.test.tsx, through the real console ObjectView and the real ListView:

  • one grouped sys_comment read for the page, asking record_id: { $in: ['t1','t2'] }, parent_id: null and is_resolved: { $ne: true }; the dot on the row with threads, none on the other; accessible name "Open comments: 2";
  • after notifyDataChanged({ objectName: 'sys_comment' }) with a re-read answering nothing, the dot is gone (2 reads in total);
  • enable.feeds: false: zero sys_comment reads and no dot;
  • a refused read (403 PERMISSION_DENIED): no dot, no list error state, no error toast, rows still drawn;
  • the wrapper: a board's cards are never read; across grid → board → grid, neither layout's rows are read for the other; the dot composes with the host marker.

Ablations (each a one-time proof through scripts/ablation-replace.mjs, mutation verified on disk and restored to the HEAD blob):

Ablation readings
Mutation Result
renderer rowAdornment={dots.rowAdornment} reverted to the managed marker alone 2 failed / 4 passed (the dot and the resolve cases)
feedsOn={objectDef?.enable?.feeds !== false} set to true 1 failed (the feeds-off case)
board guard asked = feedsOn && !drawsBoard set to feedsOn first run 6/6 green, so no test pinned it; the layout-switch case was added; re-run: 1 failed
board-tag guard asked && !shown.board set to asked 1 failed (the layout-switch case)

ObjectView.listUrlState-11860.test.tsx went red under this change. Its queryGroupHeaders spy recorded every object's group read as "the grouped grid's", so the dot's sys_comment read showed as groupBy: ['record_id']. The spy now records only the list object's reads, the same filter its find spy already applies. Nothing it asserts about grouping changed.

Acceptance notes

  • Browser verification was not done in this run. The four acceptance bullets are pinned by the component tests above through the real ObjectView and ListView, with a data source shaped like the server's grouped door.
  • Grids that report no rows draw no dot: a server-grouped grid (groupingNeedsHeaderQuery) reports no row sequence to the host today, so it draws no dot. A client-grouped grid reports its open groups' rows and does draw dots. The phone card view's title draws the dot through the same rowAdornment.
  • Sort or filter changes that keep the same id set ask nothing new: the hook keys on the id set, and the counts of the same records are the same. A comment write in between is covered by the bus.
  • The accessible-name key lives in the kanban namespace. It is reused rather than duplicated because Clause-② stays no.

Verification

Read first, by risk:

  1. ui/packages/app-shell/src/views/objectViewRowCommentDot.tsx: RowCommentDots, the board tag in handleRowsChange, and the recordIds gate.
  2. ui/packages/app-shell/src/views/objectViewListRenderer.tsx: the drawList / RowCommentDots hand-off at the end of renderListView.
  3. ui/packages/app-shell/src/views/ObjectView.rowCommentDot-39082.test.tsx.

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.rowCommentDot-39082.test.tsx should report 7 passed.

Local runs

All at head 49b6e0a (tree objectstack-ai/objectstack).

  • pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.rowCommentDot-39082.test.tsx: 7 passed (7).
  • pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.listUrlState-11860.test.tsx packages/app-shell/src/views/ObjectView.rowCommentDot-39082.test.tsx: 2 files, 47 passed.
  • The 104 ObjectView.* suites plus the five suites that read the list's shown rows (objectViewRecordNavigation.listRows-27524, recordPaneGroupScope-28461, recordDrawerStack.rootStepper-26679, recordDrawerStack.prefetch-27056, RecordDetailView.topBar-27524): 109 files, 960 passed and 1 failed. The failure was listUrlState-11860, fixed in this PR as described above and re-run green. That run was at the head before the fixture commit, and the fixture commit touches only that test file.
  • pnpm --filter @object-ui/app-shell type-check (tsc --noEmit and tsc -p tsconfig.test.json, which includes src/**/*.test.tsx): exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands derived 71 families; all 71 ran locally, each with its exit code recorded. --ran reconciliation: "71 derived, 71 run, 0 NOT-MEASURED, 0 UNRUN". check:skill-examples first exited 3 (PREREQUISITE NOT MET, client-react unbuilt); after pnpm --filter @objectstack/client-react build it exited 0. Also ran pnpm check:changeset-fixed (exit 0).
  • pnpm --dir ui run check:new-line-citations: 0 new citations.
  • Not run locally: the full Test UI farm (app-shell alone has about 2,500 test files, more than the 10-minute foreground cap) and Type Check UI. CI runs both.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzhdHJJKEk4qyMAEUoz

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 2, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhdHJJKEk4qyMAEUoz

2026-12-02T09:14Z · Final green head for L1: 49b6e0a96f48940b1d06e0f99383ac1531652f4c. Check-runs on it: 45 success, 12 skipped, 0 failure. +530 / −7 across 6 files (under the 3,000 line). Claim 7338596319, amended 2026-12-02 for the two added files (the sibling module and the stale fixture). Clause-②: no, Metadata-protocol: none. os-dev report: #39082 comment 7340539967. Browser verification was not run; component tests pin the four acceptance bullets. L1 requested from osa-L1-a.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review — ACCEPT on 49b6e0a96f48940b1d06e0f99383ac1531652f4c

l1-face CLEAN (13 items). Check-runs: 45 success, 12 expected-skip, 0 failed, 0 pending. Not governed. @object-ui/app-shell is private, so Clause-②: no holds, and the label reuses the existing kanban.cardFooter.comments key, so no i18n pack changes.

Code.

  • Count read. It goes through the existing useRecordCounts (plugin-detail/src/comments/recordCounts.ts). That is one grouped sys_comment read per shown page: record_id ∈ ids, parent_id: null, is_resolved ≠ true, grouped by record_id. That is exactly "open thread = top-level, not resolved", the same definition as unresolvedThreadCount. Attachments are not asked.
  • When it re-reads. The ids come from ListView's onRowsChange, which is still relayed to the host's handleListRowsChange first. The read is skipped when the set of ids is unchanged (key compare). Re-reads follow the page, combinedRefreshKey, and the invalidation bus that comment writes already announce.
  • Gates. enable.feeds !== false (the record page's test) and not a board. A board's own report is tracked through drawsBoardRef, so the dot never reads cards as rows, before or after a layout switch. Off means no read and no dot. A refused read draws nothing (useRecordCounts).
  • composeRowAdornment. With no dot anywhere it returns the host's own adornment unchanged, so a grid with no open threads draws exactly what it drew before. Where both apply, the Users "Not authorized" marker and the dot both draw, and that is pinned.
  • Wrapper. RowCommentDots is keyed by identityKey, so another object or view starts with no rows and does not carry stale counts.
  • Sibling module. The claim amendment records it, under the 1,000-line rule. The listUrlState-11860 fixture change is a narrowing of that test's fixture only.

Relation. Fixes #39082 (U1 of #39077): the dot, one grouped read, the feeds gate, the board unaffected, and a quiet refusal. The card is delivered.

Nits (not owed).

  • N1. Once any row has a dot, composeRowAdornment builds a new function on every render of the wrapper, so the grid sees a new rowAdornment prop each time the counts or the shown rows change. This is harmless at a page of rows. If the grid memoises on that prop, a useMemo keyed on [hostAdornment, comments] would keep it stable.
  • N2. Browser verification was not run; component tests stand in. One look at a real grid row, to check the dot's spacing after the name and beside the Users marker, would settle the visual side when the zone next dogfoods.

Not Tier H: the zone lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhdHJJKEk4qyMAEUoz

2026-12-02T09:16Z · Landing on 49b6e0a96f48940b1d06e0f99383ac1531652f4c, L1 ACCEPT 7340631898 (osa-L1-a) on this same head.

reading value
check-governed-merges.mjs --pr 39106 NOT governed · 0 of 6 paths hit the register · 537 changed lines ≤ 3000
check-runs on head 45 success · 12 skipped · 0 failure

State: ready + auto-merge (squash) now; #39082 closes on merge via Fixes. L1 nits N1 (memoise rowAdornment) and N2 (one real-grid look at the dot's spacing) are not owed; N2 rides the zone's next dogfood pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid: a row whose record has open comment threads shows a dot after the record name

2 participants