When clicking a session inside a worktree group, the layout effect in useProjectSessionSelection could override the user's selection with the project's first root session. This happened because projectSections (and thus projectSessionMeta) might not yet include the worktree group on the first render after the click. The fix adds a guard: if currentSessionId is set but not found in the current projectMap (stale data), the effect returns early instead of falling through to auto-selection logic. Fixes #1804 Co-authored-by: Leonid Skorobogatyy <bash@opencode.itc.local>