Conversation
Tooltip was persistently visible after React concurrent re-renders lost the synthetic mouseleave, leaving `isTooltipVisible=true` stuck on the previously-hovered branch. - A: skip rendering the tooltip for the currently selected branch so a stale visibility flag does not linger on the focused item. - B: wrap the button onClick to explicitly reset `isTooltipVisible` to false before forwarding to the parent handler. - C: unmount the portal contents when not visible instead of keeping an empty tooltip node in the DOM; only attach aria-describedby while the tooltip is actually rendered so screen readers do not chase a dangling reference. Tests updated: existing tooltip-content assertions now fire mouseEnter first, and new tests cover initial-render absence, selected-branch absence, click-dismisses-tooltip, focus/blur lifecycle, and aria-describedby gating.
- useFileTabs: SET_DIRTY short-circuits when target tab isDirty is unchanged, so upstream useReducer skips re-render and MarkdownEditor's onDirtyChange useEffect no longer feeds a loop. - WorktreeDetailRefactored: useCallback deps for file-panel handlers switched from [fileTabs] to [fileTabs.dispatch] to stabilise callback identity and stop MarkdownEditor from re-firing onDirtyChange every render. This unblocks router.push transitions when switching branches from the sidebar while a .md file is open. - Adds reducer tests covering same-value SET_DIRTY no-op (false→false, true→true, double-apply stable reference). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…eptance) Investigation, work-plan, TDD and acceptance artifacts for the sidebar tooltip stuck bug fix (A+B+C defensive guard). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… acceptance, progress) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(#675): stop MarkdownEditor re-render loop blocking worktree URL updates
fix(#676): prevent stuck sidebar branch tooltip (A+B+C)
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.
Summary
サイドバー操作時の 2 件のバグ修正を main にリリースします。両 issue は本会話のオーケストレーションで根本原因分析→修正→PR→マージまで自動実行され、developにマージ・統合検証済み。
含まれる変更
加えて両 issue の調査・作業計画・TDD・受入・進捗レポート(`dev-reports/bug-fix/` 配下)を含む。
#675: onDirtyChange 無限ループ修正
根本原因
`useFileTabs` の戻り値が毎レンダー新オブジェクト → `WorktreeDetailRefactored` の 4 つの `useCallback` の deps `[fileTabs]` が毎レンダー再生成 → `FilePanelContent` → `MarkdownEditor` に不安定 prop 伝播 → `useEffect([isDirty, onDirtyChange])` が毎レンダー発火 → `SET_DIRTY` reducer が同値でも新 state を返す → 無限 re-render ループで `router.push` の transition が starve(commit されない)。
修正
#676: tooltip 固着修正
根本原因
`mouseleave` 合成イベントと React 18 concurrent rendering の race により、`isTooltipVisible` が `true` のまま固定。focus も触らないので `onBlur` も発火せず tooltip が永久に残る。Issue #675 の無限ループが race を増幅していた。
修正
統合検証(develop で実施済)
Test plan
フォローアップ Issue 候補(受入テストで判明)
#675 の受入テストエージェントの指摘:
🤖 Generated with Claude Code