Fixes #32641: scope FeedEditor DOM queries to each instance root - #32710
ShaileshParmar11 merged 5 commits into
Conversation
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 885 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 52m 14s ⏱️ Max setup 4m 50s · max shard execution 18m 37s · max shard-job elapsed before upload 21m 54s · reporting 7s 🌐 197.45 requests/attempt · 2.70 app boots/UI scenario · 26.41% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
| Count | Rule |
|---|---|
| 1 | openmetadata-imports/no-api-calls-in-iteration |
| 1 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/ActivityFeed/FeedEditor/FeedEditor.tsx:131:20 |
openmetadata-imports/no-api-calls-in-iteration |
Avoid issuing one API request per item. Fetch at the data owner, use a bulk endpoint, or use useQueries with an intentional concurrency policy. |
| 🟡 | src/components/ActivityFeed/FeedEditor/FeedEditor.tsx:246:7 |
react-hooks/exhaustive-deps |
React Hook useMemo has missing dependencies: 'renderItems', 't', and 'userSuggestionRenderer'. Either include them or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedRefactor the react-quill-new mock so getFormat/format arrow functions no longer nest more than 4 levels deep — sonarjs/no-nested-functions was failing UI Checkstyle on the PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
…dom-queries-to-each-i-aae2f7
|
🚦 Removed from the merge queue —
|



Detail bug report: View on Detail
Describe your changes:
Fixes #32641
I worked on the Activity Feed rich-text editor (
FeedEditor) because it hard-codedid="om-quill-editor"on its root<div>and resolved the emoji panel, the emoji toggle, and the RTLdata-dirroot through the globaldocument. When twoFeedEditorinstances mount on the same page (e.g. the always-on Inbox composer plus an inline reply/task-comment edit, or the activity-card composer plus a main-post edit), the duplicate IDs make everydocument.getElementById/querySelector('#om-quill-editor …')resolve to the first instance, so a later instance's emoji toggle-to-close "bounced" (the panel closed then re-openened in the same gesture) and, in an RTL locale, every editor after the first had its blank-state placeholder left-aligned instead of right-aligned.What I changed
id="om-quill-editor"from the root and added a per-instancerootRef.handleClickOutsideand the RTLuseEffectnow queryrootRef.current(this instance's own root) instead of the globaldocument, so each editor only manages its own DOM.feed-editor-rootclass on the root (viaclassNames) and re-keyed the two LESS rules that depended on#om-quill-editor— the RTL placeholder right-align rule and the quill-emoji palette tab styling — to.feed-editor-root, preserving their styling and specificity.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
FeedEditorinstances mounted on the same page no longer share a root id; each scoped its own DOM.data-dir="rtl"on itself).Unit tests
openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/FeedEditor/FeedEditorDuplicateId.test.tsx— a jsdom regression suite (FeedEditoris un-mocked;react-quill-newis mocked with aforwardRefcomponent whose emoji toggle drives the shared#textarea-emojipanel the way the pinned@windmillcode/quill-emojibundle does). Three cases, one per fix point: (1) no#om-quill-editorid is rendered and.feed-editor-rootis present on every instance; (2) the second editor's toggle-to-close no longer bounces; (3) every editor root is markeddata-dir="rtl"in an RTL locale. The suite was RED-verified: reverting onlyFeedEditor.tsx+feed-editor.lessmakes all three cases fail (duplicate id present, panel still open after the close gesture, RTLdata-dirwritten to the wrong root), and re-applying the fix makes them pass.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/.../ui/playwright/for UI changes.openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/FeedEditorDuplicateId.spec.ts— seeds a thread + reply via the Conversations API, opens the reply's inline editor in the activity-feed thread drawer on/users/admin/activity_feed/all, and asserts (in a real Chromium) that the editor root has classfeed-editor-rootwith noom-quill-editorid, and that the emoji toggle opens then closes the panel cleanly (the exact gesture the duplicate id broke). Verified green against a running OpenMetadata server built from this branch (mysql + Elasticsearch + Flyway migrations +yarn builddist baked into the server jar).Manual testing performed
FeedEditor.test.tsx+FeedEditorDuplicateId.test.tsx): 10/10 pass; FeedEditor-consumer suites (ActivityFeedEditor,CommentCard,ActivityThreadPanel): 10/10 pass.setup/entity-data-setup/entity-data-teardownprojects).grep feed-editor-rooton the builtassets/FeedEditor-*.jschunk inside theopenmetadata-uijar matches.UI screen recording / screenshots:
TODO: attach a short screen recording of opening a reply's inline editor in the activity feed, toggling the emoji panel open and closed on the second editor without the bounce, plus an RTL-locale placeholder alignment check. (The change is UI-visible; the recording should be added before review.)
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Automatic Fixes PRs can be configured here.