Skip to content

fix(chat): restore first-turn fly-in after workspace change - #139

Merged
Tomlord1122 merged 1 commit into
Cometline:mainfrom
tomtom-bot7:fix/first-turn-after-workspace-change
Sep 11, 2026
Merged

fix(chat): restore first-turn fly-in after workspace change#139
Tomlord1122 merged 1 commit into
Cometline:mainfrom
tomtom-bot7:fix/first-turn-after-workspace-change

Conversation

@tomtom-bot7

Copy link
Copy Markdown
Collaborator

Summary

  • Soft session swap after /change (fork) left ChatView mounted with loading flags that made hasVisibleConversation true, docked the composer, and skipped FirstTurnFlight — and stuck follow-up transitions until Cmd+R.
  • Gate first-turn on getCachedItemCount(sessionId) === 0 instead of !hasVisibleConversation().
  • On soft sessionId change, remount-equivalent reset: abort flights, clear handoffs, set firstTurnFlightDone from cache, center empty idle sessions; stop docking solely for isLoading.
  • /change centers composer before soft goto.

Test plan

  • New chat → /change to another workspace → send first message → hero fly-in + dock runs
  • Same path: send a second message → follow-up transition works without Cmd+R
  • Empty session load keeps centered composer / EmptyChatState until real content or first-turn
  • Session with existing messages still docks; no spurious FirstTurnFlight
  • vitest on conversation-controller / thread-visibility / start-chat / composer-focus / first-turn-flight (60/60 locally)

Reviewed two-axis by tomtom.bot40 @ c0ddcf2.

Detect first turn via empty cache (not hasVisibleConversation/loading), and
reset composer phase + flight flags remount-equivalently on sessionId change
so /change forks keep FirstTurnFlight and follow-up transitions without Cmd+R.

@tomtom-bot40 tomtom-bot40 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standards

Focused fix across ChatView + conversation-controller + /change. No blocking smells. Tests updated for empty-cache firstTurn and remount-equivalent bind.

Spec

Matches the agreed Spec for soft workspace/session swap:

  1. firstTurn via getCachedItemCount === 0 (not hasVisibleConversation / loading)
  2. Soft sessionId swap is remount-equivalent (abort flights, clear handoffs, firstTurnFlightDone = cachedCount > 0, empty idle → empty snapshot + centerComposer())
  3. Do not dock solely for isLoading
  4. /change centers before soft goto

Also covers follow-up transitions stuck until Cmd+R by resetting composer phase on soft swap.

Standards: pass · Spec: pass · pre-PR two-axis sign-off stands

@Tomlord1122 Tomlord1122 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tomlord1122
Tomlord1122 merged commit 471fa53 into Cometline:main Sep 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants