fix: サイドバー同期トーストの見切れを body ポータルで修正 (#1399)#1401
Merged
Merged
Conversation
ToastContainer が transform を持つ祖先 <aside data-testid="sidebar-container"> (AppShell) の subtree 内で描画されるため、position:fixed の containing block が サイドバー枠となり、右下のはずのトーストがサイドバー基準に配置され左端が見切れて いた。ToastContainer を createPortal(..., document.body) でラップして containing block を viewport に戻す。SSR/hydration 対策として client-mount 後のみ portal を 描画する(CommandPalette / Modal と同じパターン)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QRiYX98sodhZtCyHtbswoR
This was referenced Jul 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
サイドバーの同期(Sync)ボタン押下時に表示されるトーストが、ビューポート右下ではなくサイドバー基準に配置され左端が見切れる不具合を修正する。Closes #1399
根本原因
ToastContainer(src/components/common/Toast.tsx)はposition: fixedだが、showToastを呼ぶSyncButton内で描画され、その祖先<aside data-testid="sidebar-container">(AppShell.tsx)がtransform(スライド演出)を持つ。CSS 仕様上、transformを持つ祖先はposition: fixed子孫の containing block になるため、トーストがビューポートではなくサイドバー枠(既定幅 224px)を基準に配置され、min-w-[300px]のトーストの左端が画面外へはみ出して見切れていた。変更内容
ToastContainerをcreatePortal(..., document.body)で描画するよう変更(Toast.tsxのみ、+19/-1)mountedガードを追加し、クライアントマウント後のみ portal 描画(既存のModal.tsx/CommandPalette.tsxと同パターン)fixedがビューポート基準となり、トーストが右下に全幅で表示されるテスト
npm run lint: PASSnpx tsc --noEmit: PASSnpm run test:unit(CI=true): PASS(596 files / 10167 tests)影響範囲