Repository navigation
chore(ui): one comment editor and one open-item view for the activity feed - #39831
harsh-vador wants to merge 5 commits into
Conversation
The classic feed kept a fork of the comment editor (ActivityFeedEditor, five lines from ActivityFeedEditorNew), a send button and key hint only that fork showed, and a second edit form outside the thread panels. Comments are now written with CommentComposer and edited with CommentEditForm everywhere: the classic reply box and the task tab's comment box show the composer with its send arrow, and editing a post or reply in the Activity list uses the same form as the panels. ActivityFeedEditor, SendButton, KeyHelp, send-button.less and the CSS only they used are removed.
…Detail The feed drawer (FeedPanelBodyV1, ActivityPanelBody) and the activity thread panel each framed the open conversation or activity the same way. Both now render FeedItemDetail, and the two drawer-only wrappers are removed. The task panels, the classic tab and the task card read a task's entity type through getTaskEntityType with the same table fallback instead of four copies of it. The classic tab's right panel keeps its own layout.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Editing a reply in the Activity list now uses CommentEditForm, whose format bar starts collapsed, so the emoji toolbar button is hidden until the formatting toggle opens it.
Playwright full suitePR CI skips Playwright here, so I ran the whole suite on this branch (
|
| useImperativeHandle(ref, () => ({ | ||
| getEditorContent: editorRef.current?.getEditorContent ?? (() => ''), | ||
| clearEditorContent: editorRef.current?.clearEditorContent ?? noop, | ||
| setEditorContent: editorRef.current?.setEditorContent ?? noop, | ||
| getEditorContent: () => editorRef.current?.getEditorContent() ?? '', | ||
| clearEditorContent: () => editorRef.current?.clearEditorContent(), | ||
| setEditorContent: (content: string) => | ||
| editorRef.current?.setEditorContent(content), | ||
| })); |
There was a problem hiding this comment.
⚠️ Quality: Single feed comment editor rule is not in docs/decisions
The PR sets a rule that docs/decisions/ does not record. The rule: activity-feed comments are written through CommentComposer and edited through CommentEditForm. ActivityFeedEditorNew stays only as the internal editor of CommentComposer, and its imperative handle calls through to FeedEditor on every use. That second part comes from the description: "the ActivityFeedEditorNew handle must call through to FeedEditor on each use, or typed text is lost after the first character."
The description also sets a test contract that the tree only implies. The read-only comments-input-field that opens the composer "is kept so existing Playwright helpers that click comments-input-field keep working." The repository squash-merges, so neither rule reaches git log. A later cleanup could add another feed editor, go back to editorRef.current?.getEditorContent ?? noop-style capture in ActivityFeedEditorNew.tsx:79-84, or remove the placeholder input. Nothing would warn against it.
Fix: add a record that states both rules. Alternatively, put a why-comment on the useImperativeHandle and on the read-only input.
Add docs/decisions/2026-12-xx-feed-comments-use-one-editor.md asserting the rules.:
# Feed comments are written with CommentComposer and edited with CommentEditForm
Status: Accepted
Activity-feed, thread-panel and task-tab comments are written only through
CommentComposer and edited only through CommentEditForm; ActivityFeedEditorNew
is CommentComposer's internal editor and its ref handle reads FeedEditor on each
call. The read-only `comments-input-field` trigger stays as the Playwright entry point.
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
Describe your changes:
Fixes https://github.com/open-metadata/openmetadata-collate/issues/9242
The activity feed had several editors doing one job, and three places drawing the same open conversation. This PR leaves one editor and one detail view, in two commits. Part of the activity feed cleanup (open-metadata/openmetadata-collate#9236). It is based on
mainand does not depend on the open cleanup PRs.ActivityFeedEditorwas a fork ofActivityFeedEditorNew, 5 lines apart.SendButtonandKeyHelpshowed only in the fork. Editing in the Activity list used the old editor with Save and Cancel; the thread panels usedCommentEditForm.CommentComposerand edited withCommentEditForm, everywhere.ActivityFeedEditor,SendButton,KeyHelp,send-button.lessand the CSS only they used are removed.ActivityFeedEditorNewis now onlyCommentEditor's base input.FeedPanelBodyV1,ActivityPanelBody) and the activity thread panel each framed an open conversation or activity the same way. Four places copied(task.about?.type as EntityType) ?? EntityType.TABLE.FeedItemDetail, and the two drawer-only wrappers are removed. The four copies use the existinggetTaskEntityTypewith the same fallback.Fix found by the full Playwright run:
{"message":"O"}in the CI trace.ActivityFeedEditorNewforwardedFeedEditor's handle by copying its functions when it rendered. Removing the old send button also removed the per-keystroke re-render that had kept those copies up to date.e11f19acbe3makes the handle call through toFeedEditoron each use.{"message":"Hello world"}; before the fix,{"message":"H"}).Visible changes, all in classic mode (agreed on the epic, decision 3):
comments-input-fieldkeep working. Classic still shows field changes its own way. The classic tab's right panel keeps its own layout.Scope compared with the issue: the issue suggested one
FeedItemDetailfor tasks as well. Each place rendersTaskTabNewwith different props (columns, panel resize, owners, close callbacks), so a shared task view would only pass them through. The shared part, the entity-type fallback, now goes through one helper instead.Type of change:
High-level design:
N/A. Two existing components (
CommentComposer,CommentEditForm) replace their duplicates. One small component,FeedItemDetail, replaces two wrappers.Tests:
Use cases covered
CommentCard): it opensCommentEditForm, both in the list and in a thread panel.onEdit, then shows the preview.FeedCardBodyNew): it usesCommentEditFormin the list and in a thread panel, and saving callsonUpdate.FeedItemDetail: it frames a conversation and shows an activity unframed, with the same card props the old wrappers passed. The drawer opens a task about no known entity as a table task.ActivityAPI.spec.tsfinds the editing reply by the form'sedit-message-editortest id instead of the removed.is_edit_postclass.TaskComments.spec.tskeeps working unchanged: the form renders the sameactivity-feed-editor-newwith its.ql-editorandsend-button.Unit tests
components/ActivityFeed,components/Entity/Task,components/common/CommentComposerandcomponents/discovery/personal-space.tsc: no errors in the changed files; the ones that remain are onmain. ESLint 0 errors. Prettier and organize-imports leave no diff.ActivityFeedEditorNewstill resolves.Before / after
Captured against a local backend with the same data, before (the
mainfiles) and after (this branch). Light theme only: classic mode resolves every theme preference to light.9242-one-editor.png: replying in a conversation, editing a post in the Activity list, and commenting on a task.UI screen recording:
Not applicable: the before/after captures above show each changed surface.
Checklist:
Fixes <issue-number>: <short explanation>. The issue is in openmetadata-collate, so the title names the area instead.Fixesabove.REVIEW.mdand fixed every 🔴 finding, or answered it on the line below. No removed export or test id is used by openmetadata-collate; the removed.is_edit_postselector was updated in the one spec that used it.docs/decisions/. Not applicable: the visual change is the agreed decision 3 on open-metadata/openmetadata-collate#9236, and it changes no contract.🤖 Generated with Claude Code