Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .changeset/36075-comments-resolved.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@object-ui/app-shell': patch
'@object-ui/plugin-detail': patch
'@object-ui/react': patch
'@object-ui/types': patch
'@object-ui/i18n': patch
---

feat(record-page): the desktop comment panel resolves and reopens threads, filters them, counts the unresolved ones, and offers Edit and Delete on other people's comments only where the server admits them

Clause-②: yes (widening) — `@object-ui/react`'s `DiscussionContextValue` adds three optional members: `onResolveComment(itemId, resolved)`, `moderatesComments` and `updatesOthersComments`. `@object-ui/types`' `FeedItem` adds five optional members: `resolved`, `resolvedById`, `resolvedByName`, `resolvedAt`, `mentionsViewer`. `@object-ui/plugin-detail` adds exports `useRecordVerdict` (the three-state verdict `useRecordEditable` fails open on; a definite allow is the explain answer's `allowed` together with its `record.visible`, as the server admits a by-id write, so `useRecordEditable` reads as before except that an answer whose `allowed` is false beside a visible record, such as an on-behalf-of session whose delegator is gone, now reads not editable), `threadResolvable`, `threadResolved`, `threadInvolvesViewer`, `filterCommentThreads`, `unresolvedThreadCount`, `DEFAULT_COMMENT_THREAD_FILTER` and the type `CommentThreadFilter`; `RecordCommentsData` adds `resolvable`, `onResolveComment`, `moderates` and `updatesOthers`, and its `count` is now the unresolved threads; `CommentItemActions` adds `onResolve` and `resolved`; `CommentHoverActionsProps` adds `resolved`; `RecordCommentThreadProps['comments']` may carry `onResolveComment`, `moderates` and `updatesOthers`. `@object-ui/i18n` adds ten keys to every pack: `detail.reopenThread`, `detail.threadResolved`, `detail.threadResolvedBy`, `detail.filterComments`, `detail.showResolvedComments`, `detail.commentsInvolvingMe`, `detail.noUnresolvedComments`, `detail.noCommentsInvolvingMe`, `detail.showAllComments`, `detail.commentResolveFailed`. Nothing existing is removed or re-typed.
Metadata-protocol: none
Skills-docs: none — no skill under `skills/**` teaches the console's comment panel; `content/docs/frontend/plugins/plugin-detail.mdx` and the plugin-detail README gain resolved threads, the filter and the moderator's Edit and Delete in this change.

The desktop record page's comment panel (objectstack#36075) gains the resolved threads #36071 stores:

- ✓ in a thread's first comment's action row marks the thread resolved: it leaves the list and the comments icon's number, now the unresolved threads, drops by one. ✓ is offered under the `sys_comment` update grant: on a thread the viewer started, and on anyone's only where the explain engine admits the viewer's update of a comment they did not write. Today the platform's row floor admits that for administrators, not for rank-and-file members, so a member resolves only the threads they started until the server carries ruling 7063285032 (any reader of the record may resolve) past that floor.
- The filter menu at the panel's top right holds 「显示已解决」, which shows resolved threads marked 「已由 X 解决」 (their ✓ reopens them), and 「只看我参与的」, the threads the viewer started, replied in or is mentioned in. The filter is not stored. With every thread resolved, the panel says so and offers to show them all.
- A reply into a resolved thread shows the thread reopened, as the platform stores it.
- The resolver is named from the people the page already knows (the viewer and the discussion's authors); any other resolver is named by one `sys_user` read of exactly those ids, after the discussion is drawn. Where that read is refused, the mark reads 「已解决」.
- Edit and Delete under More are offered on other members' comments to a viewer the explain engine admits to update the record by id, the server's rule for moderating someone else's comment; Edit also needs the explain engine to admit their update of a comment they did not write (the row floor above). Both are asked only on a definite allow: pending, a refusal, an error or a deployment without the explain service offers them on the viewer's own comments alone. Their own comments keep them as before.

Unchanged: no server permission changes (a deployment without the explain service shows ✓ and Edit on the viewer's own rows only, administrators included); a deployment whose comment rows carry no `is_resolved` shows no ✓ and no filter, and the icon counts every thread; hand-written record pages and the phone keep their feed as before.
20 changes: 16 additions & 4 deletions content/docs/frontend/plugins/plugin-detail.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,26 @@ opened from the comments icon in the record header (on the record page and in
the record drawer), and no longer inside the 动态 (Activity) tab
(objectstack#36075):

- **The icon** shows how many top-level comments the record holds. A press
- **The icon** shows how many unresolved threads the record holds (a comment
and its replies are one thread). A press
opens the panel, the next one closes it, and the browser remembers whether it
was left open, once for the record page and once for the drawer.
- **The panel** is 380 px wide: 「评论」 and ✕ at the top, the threads oldest
first, the comment box at the foot. A thread's replies fold to 「N 条回复」
and open in place. A comment's actions (Reply, an emoji, and More with Edit
and Delete on your own comments) appear at its top right while the pointer is
over it.
and open in place. A comment's actions (Reply, an emoji, ✓ on a thread's
first comment, and More with Edit and Delete) appear at its top right while
the pointer is over it. Edit and Delete are on your own comments. On other
people's they appear only where the server would accept them: Delete for a
member who may edit the record, Edit when the server also lets you change a
comment you did not write (today, administrators).
- **Resolved threads**: ✓ marks a thread resolved and it leaves the list; the
icon's number drops by one. It is on the threads you started, and on other
people's only where the server would accept it: today administrators, since
the platform lets a member change only the rows they wrote. The
filter menu at the panel's top right holds 「显示已解决」, which shows resolved
threads marked with who resolved them (their ✓ reopens them), and
「只看我参与的」, the threads you started, replied in or are mentioned in. A
reply into a resolved thread reopens it.
- **Where it sits**: beside the record from a 1280 px window, the record giving
way; over the record's right edge in a narrower window. In a drawer narrower
than 760 px (the default drawer is 720) it covers the drawer's body, and ✕ or
Expand Down
Loading
Loading