fix(web): close open dialogs when a route is hidden
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nextjs, playwright, react, typescript
調査の方向性
Start with the timeline-only fix already merged for #380 in src/components/timeline/event-inspector.tsx, then read src/components/ui/modal-dialog.tsx and src/components/ui/dialog-controller.ts to see where a useLayoutEffect cleanup could close the native <dialog> on hide. Read the Next guide section the issue cites on preserving UI state before trusting that effects are torn down. Done means an e2e spec covering one caller passes and the timeline workaround is removed.
索引モデルが issue の本文から書いたものです。
説明
Context
Raised in the Fable review of PR #378 (thread https://github.com/eddiejaoude/DevMacro/pull/378#discussion_r4560190412). cacheComponents is on (next.config.ts:38), so Next hides a route it navigates away from with <Activity> (display: none) and keeps its DOM state, dialogs included (node_modules/next/dist/docs/01-app/02-guides/preserving-ui-state.md, section "Dialog and initialization logic"). Effects are torn down on hide, and ModalDialog (src/components/ui/modal-dialog.tsx) and the dialog controller (src/components/ui/dialog-controller.ts) have no cleanup that closes the native <dialog>. The reviewer confirmed in Chromium and WebKit that an open modal <dialog> under a display: none ancestor keeps the rest of the document inert, so nothing outside it can be clicked or focused.
PR #378 fixes this only for the timeline event inspector (#380). Every other ModalDialog caller still has the gap: src/app/w/[workspace]/settings/api-keys.tsx, src/app/w/[workspace]/settings/workspace-handle-form.tsx, src/components/alerts/confirm-delete.tsx, src/components/app/command-palette.tsx, src/components/connections/connection-controls.tsx, src/components/projects/delete-project-dialog.tsx, src/components/public-metrics/publication-controls.tsx, src/components/public-metrics/share-dialog.tsx.
Not reproduced in the app yet. Likely paths: a multi-entry history jump from the Back menu while a dialog is open, or a router.refresh() that redirects while a dialog is open.
Plan
- Reproduce with Playwright: open a dialog, navigate away so the route is hidden rather than unmounted, and check that the next page is interactive.
- Close the native dialog on hide in the shared primitive (a
useLayoutEffectcleanup inModalDialogor the controller), so every caller gets it. - Remove the timeline-only fix from
src/components/timeline/event-inspector.tsxonce the primitive covers it.
Acceptance criteria
- Navigating away with any
ModalDialogopen leaves the next page fully interactive. - Returning to the route does not leave a stale open dialog, and URL-driven dialogs reopen from the URL.
- Playwright e2e covers one representative dialog.
Files and areas
src/components/ui/modal-dialog.tsx, src/components/ui/dialog-controller.ts, their unit tests, one e2e spec. Non-goals: redesigning dialogs, changing focus-restoration rules.
Verification
To be filled in by the implementing chat.
Branch: <issue-number>-modal-close-on-hide
Closes with a Closes #<issue-number> footer on the commit or pull request.
Model: anthropic/claude-opus-5-5 | Reasoning effort: not exposed by harness
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 1
- 平均マージ
- 6時間 56分
- マージ済み PR(30日)
- 136
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eddiejaoude/StackDash のほかの issue
-
area: docs documentation priority: P3 size: S
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eddiejaoude/StackDash#462 ·
メンテナーはふだん 1 日以内に返信
-
area: web bug priority: P3 size: XS
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
eddiejaoude/StackDash#432 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: database bug priority: P3 size: S
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
eddiejaoude/StackDash#419 ·
メンテナーはふだん 1 日以内に返信
-
area: docs bug priority: P2 size: XS
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
eddiejaoude/StackDash#418 ·
メンテナーはふだん 1 日以内に返信
-
accessibility area: timeline bug priority: P3 size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
eddiejaoude/StackDash#389 ·
メンテナーはふだん 1 日以内に返信
eddiejaoude/StackDash の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
open-webui/tether#52 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
voidzero-dev/void#835 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AykutSarac/jsoncrack.com#616 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
melgarafael/DeskcommCRM#4679 ·
メンテナーはふだん 1 日以内に返信