fix(desktop): remove duplicate HTML5 backend from v2 Workspace#3174
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRemoved the bundled react-dnd HTML5 backend and the internal DnDProvider wrapper from Workspace; documentation updated to require consumers to provide a DndProvider when using . (50 words) Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes a runtime crash — Key changes:
Architecture note: Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["AuthenticatedLayout\n(layout.tsx)"] -->|"DndProvider\nmanager=dragDropManager\n(HTML5Backend singleton)"| B["Outlet / Child Routes"]
B --> C["V2WorkspacePage\n(page.tsx)"]
C --> D["Workspace\n(@superset/panes)"]
D --> E["TabBar"]
D --> F["Tab"]
E --> G["TabItem\n(useDrag/useDrop)"]
F --> H["Pane / PaneHeader\n(useDrag/useDrop)"]
style A fill:#4ade80,color:#000
style D fill:#60a5fa,color:#000
subgraph "BEFORE (conflicting)"
OLD_D["Workspace\n(DndProvider + HTML5Backend)"]
OLD_D -->|"❌ Second HTML5Backend\ncauses runtime error"| OLD_PARENT["Parent DndProvider\nalready active"]
end
subgraph "AFTER (this PR)"
NEW_D["Workspace\n(no DndProvider)"]
NEW_D -->|"✅ Consumes parent\nDndProvider context"| NEW_PARENT["AuthenticatedLayout\nDndProvider"]
end
Reviews (1): Last reviewed commit: "Remove provider from v2 workspace" | Re-trigger Greptile |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/panes/src/react/components/Workspace/Workspace.tsx`:
- Around line 43-51: The bulk tab-close handlers (onCloseOtherTabs and
onCloseAllTabs) call the async closeTab for each tab without awaiting, causing
concurrent onBeforeCloseTab flows; change these callbacks to async and iterate
with a for...of loop awaiting closeTab(tab.id) for each tab (use the existing
tabs array and closeTab function), ensuring each close completes before
proceeding to the next to avoid race conditions in validation/store updates.
- Around line 38-77: The bulk-close callbacks currently call the async function
closeTab without awaiting it in onCloseOtherTabs and onCloseAllTabs, which can
produce overlapping operations and unhandled rejections from onBeforeCloseTab;
make those callbacks async and either await each closeTab sequentially (for
predictable ordering) or collect promises and await Promise.allSettled to handle
errors; update the onCloseOtherTabs and onCloseAllTabs handlers to await
closeTab for each tab and add basic error handling (try/catch or allSettled) so
rejections from onBeforeCloseTab are handled gracefully.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 839bf85f-67d8-4985-b8a0-e30281f8b8a7
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
packages/panes/package.jsonpackages/panes/src/react/components/Workspace/Workspace.tsx
💤 Files with no reviewable changes (1)
- packages/panes/package.json
…set-sh#3174) * Reuse dnd backend * Remove provider from v2 workspace * Lint * fix: await async closeTab in bulk close callbacks * docs(panes): document DndProvider requirement for consumers
cherry-pick方式で内容を取り込み済みの14コミットをgit履歴上もマージ済みにする。 取り込み済み (cherry-pick / 手動移植): - be22b46 superset-sh#3125 — スキップ (下記参照) - 88bc7fb superset-sh#3127 — Revert DA1 ✓ - 92d0ff9 superset-sh#3054 — DA1 fix ✓ - c48450e superset-sh#3093 — file viewer pane fix ✓ - fffa8db superset-sh#3128 — version 1.4.7 ✓ - 589a7c7 superset-sh#3136 — fuzzy scorer (ハイブリッド方式) ✓ - ceb8c81 superset-sh#3150 — Electron 40.8.5 ✓ - 8922b94 superset-sh#3137 — terminalId分離 ✓ - c7508e5 superset-sh#3152 — GitHub無料化 ✓ - 2b91f11 superset-sh#3155 — v2 terminal theme ✓ - b8b11af superset-sh#3154 — TUI dimension fix ✓ - 7599ace superset-sh#3149 — v2 sidebar file tree (手動統合) ✓ - 4d7c612 superset-sh#3174 — DnD重複削除 ✓ - 864977d superset-sh#3157 — Host Service分離 ✓ 意図的にスキップ: - be22b46 superset-sh#3125 (GitHub polling簡素化) フォーク独自のGitHubSyncService (バックエンド集中ポーリング) と 設計が異なるため不採用。upstreamはフロントエンドhover駆動、フォークは バックエンドキャッシュウォーマー方式。詳細は githubQueryPolicy.ts と github-sync-service.ts のFORK NOTEを参照。 ゴースト・マージ復元 (revert 134cfd5 で消失した内容): - 538f306 superset-sh#3120 — Patch vuln ✓ - 1588d20 superset-sh#3108 — terminal lifecycle分離 ✓ - 59426f6 superset-sh#3122 — file tree + FilePane + Alert refactor (手動統合) ✓ - 10d9a5d superset-sh#3097 — tiptap line-height ✓ - 337a9ae superset-sh#3121 — Codex hooks削除 ✓
Summary
DndProviderfrompackages/panesWorkspacecomponent that conflicted with the one in the authenticated layout, causing "Cannot have two HTML5 backends at the same time" when v2 feature flag is disabledreact-dnd-html5-backenddependency from@superset/panes— child components (TabItem,TabBar,Pane,PaneHeader) useuseDrag/useDrophooks which consume the existingDndProvidercontext from the layoutTest plan
Summary by cubic
Removed the duplicate HTML5 DnD backend from
Workspaceto reuse the app-level provider and stop the “Cannot have two HTML5 backends” error when the v2 flag is off; bulk tab close actions now await asynccloseTaband DnD still works. Updated@superset/panesREADME to document thatWorkspacemust be wrapped in a single app-levelDndProvider.Bug Fixes
DndProvider/HTML5Backendfrompackages/panes/src/react/components/Workspace/Workspace.tsxto use the authenticated layout provider.onCloseAllTabsandonCloseOtherTabsnow await asynccloseTabto avoid race conditions and inconsistent state.Dependencies
react-dnd-html5-backendfrom@superset/panes.Written for commit a8af7cb. Summary will update on new commits.
Summary by CodeRabbit
Refactor
Chores
Documentation