Skip to content

chore(ui): one comment editor and one open-item view for the activity feed - #39831

Open
harsh-vador wants to merge 5 commits into
mainfrom
chore/feed-one-editor
Open

harsh-vador wants to merge 5 commits into
mainfrom
chore/feed-one-editor

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

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 main and does not depend on the open cleanup PRs.

Commit Before After
One editor ActivityFeedEditor was a fork of ActivityFeedEditorNew, 5 lines apart. SendButton and KeyHelp showed only in the fork. Editing in the Activity list used the old editor with Save and Cancel; the thread panels used CommentEditForm. Comments are written with CommentComposer and edited with CommentEditForm, everywhere. ActivityFeedEditor, SendButton, KeyHelp, send-button.less and the CSS only they used are removed. ActivityFeedEditorNew is now only CommentEditor's base input.
One detail view The feed drawer (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. Both render FeedItemDetail, and the two drawer-only wrappers are removed. The four copies use the existing getTaskEntityType with the same fallback.

Fix found by the full Playwright run:

  • What broke: the first run had 17 failures in task comments, reply edits and mentions. Each posted only the first character typed, for example {"message":"O"} in the CI trace.
  • Cause: ActivityFeedEditorNew forwarded FeedEditor'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.
  • Fix: commit e11f19acbe3 makes the handle call through to FeedEditor on each use.
  • Checks: a new unit test fails on the old forwarding. In a browser, typing key by key now posts the whole text ({"message":"Hello world"}; before the fix, {"message":"H"}).

Visible changes, all in classic mode (agreed on the epic, decision 3):

  • Reply box: a conversation's reply box and a task's comment box show the composer with its send arrow ("Reply in Conversation"), as AI mode does.
  • Edit form: editing a post or reply in the Activity list uses the same form as the thread panels: the send arrow saves, with a Shift+Return hint and Cancel.
    • The old Save and Cancel buttons were clipped by the card's fixed height; see the screenshot.
  • Unchanged: the read-only comment input that opens the composer stays, so the many Playwright helpers that click comments-input-field keep 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 FeedItemDetail for tasks as well. Each place renders TaskTabNew with 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:

  • Improvement

High-level design:

N/A. Two existing components (CommentComposer, CommentEditForm) replace their duplicates. One small component, FeedItemDetail, replaces two wrappers.

Tests:

Use cases covered

  • Editing a reply (CommentCard): it opens CommentEditForm, both in the list and in a thread panel.
    • Saving calls onEdit, then shows the preview.
    • A failed save keeps the form open.
    • Cancel and a click outside close it without saving.
  • Editing a post (FeedCardBodyNew): it uses CommentEditForm in the list and in a thread panel, and saving calls onUpdate.
  • Commenting on a task: the task tab posts the message the composer sends.
  • 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.
  • Playwright: ActivityAPI.spec.ts finds the editing reply by the form's edit-message-editor test id instead of the removed .is_edit_post class. TaskComments.spec.ts keeps working unchanged: the form renders the same activity-feed-editor-new with its .ql-editor and send-button.

Unit tests

  • 266 suites (2,920 tests) pass across components/ActivityFeed, components/Entity/Task, components/common/CommentComposer and components/discovery/personal-space.
  • tsc: no errors in the changed files; the ones that remain are on main. ESLint 0 errors. Prettier and organize-imports leave no diff.
  • The 183 browser-helper tests pass locally.
  • openmetadata-collate uses none of the removed files. Its one test that mocks ActivityFeedEditorNew still resolves.

Before / after

Captured against a local backend with the same data, before (the main files) 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:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>. The issue is in openmetadata-collate, so the title names the area instead.
  • My PR is linked to a GitHub issue via Fixes above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. Not applicable.
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). Not applicable, explained above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md and 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_post selector was updated in the one spec that used it.
  • Decision check: if this PR decides something the next contributor could undo, it adds a record under 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

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.
@harsh-vador
harsh-vador requested a review from a team as a code owner December 4, 2026 12:24
@harsh-vador harsh-vador added the UI UI specific issues label Dec 4, 2026
@harsh-vador
harsh-vador requested review from shah-harshit and removed request for a team December 4, 2026 12:24
@harsh-vador harsh-vador self-assigned this Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

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.
@harsh-vador

Copy link
Copy Markdown
Contributor Author

Playwright full suite

PR CI skips Playwright here, so I ran the whole suite on this branch (playwright-postgresql-e2e.yml, full_suite=true).

  • First run, 47334002948: 17 failed.
    • Symptom: in task comments, reply edits and mentions, the composer posted only the first character typed. The CI trace showed {"message":"O"}.
    • Fix: e11f19acbe3. The cause is explained in the description.
  • Second run, 47342928369: 4,798 passed, 1 failed, 2 flaky.
    • The one failure: FeedEditorDuplicateId.spec.ts clicked the editor's emoji button, which is hidden because CommentEditForm's format bar starts collapsed.
    • Fix: test(playwright): open the edit form's format bar before toggling emoji. The spec now opens the format bar first, and it passes locally against this branch: 1 passed in 18.4 s, with the HTML report screenshot attached below.
    • Flaky: ExplorePageRightPanel and DataQuality "Column test case" passed on retry. This PR touches neither area.

Comment on lines 79 to 84
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),
}));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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 👍 / 👎

@gitar-bot

gitar-bot Bot commented Dec 6, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 🟡 Medium risk 0 closed / 1 findings

Unifying comment composers changes reply and edit submission across activity views; editor-state errors could lose or misapply user text.

Consolidates feed comment writing into CommentComposer and editing into CommentEditForm, removes the duplicate editor and send button, and unifies open-conversation framing under FeedItemDetail.

  • Open: the single-editor rule and the imperative-handle call-through in ActivityFeedEditorNew are not recorded in docs/decisions/, and the read-only comments-input-field dependency has no warning comment, so a later cleanup could reintroduce the bug or remove the placeholder input unnoticed.

Address this by adding a decision record or explanatory comments on the useImperativeHandle and the read-only input before merge.

⚠️ Quality: Single feed comment editor rule is not in docs/decisions

📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/ActivityFeedEditorNew.tsx:79-84 📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.tsx:575-582 📄 openmetadata-ui/src/main/resources/ui/src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:2032-2039

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.
🤖 Prompt for agents
Code Review: Consolidates feed comment writing into `CommentComposer` and editing into `CommentEditForm`, removes the duplicate editor and send button, and unifies open-conversation framing under `FeedItemDetail`.
  
  - Open: the single-editor rule and the imperative-handle call-through in `ActivityFeedEditorNew` are not recorded in `docs/decisions/`, and the read-only `comments-input-field` dependency has no warning comment, so a later cleanup could reintroduce the bug or remove the placeholder input unnoticed.
  
  Address this by adding a decision record or explanatory comments on the `useImperativeHandle` and the read-only input before merge.

1. ⚠️ Quality: Single feed comment editor rule is not in docs/decisions
   Files: openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedEditor/ActivityFeedEditorNew.tsx:79-84, openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedCardNew/ActivityFeedcardNew.component.tsx:575-582, openmetadata-ui/src/main/resources/ui/src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:2032-2039

   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.

   Fix (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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

This branch was previously deployed

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

Labels

UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant