Skip to content

improvement(chat): speed up conversation navigation - #7011

Merged
waleedlatif1 merged 3 commits into
stagingfrom
codex/chat-navigation-performance
Aug 23, 2026
Merged

improvement(chat): speed up conversation navigation#7011
waleedlatif1 merged 3 commits into
stagingfrom
codex/chat-navigation-performance

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep the current conversation visible while the next chat route and transcript are prefetched from deliberate navigation intent
  • reuse the exact transcript query, avoid non-404 legacy retries, and use the conditional mark-read endpoint
  • document the safe dynamic-route prefetch and continuity patterns for future navigation work

Type of Change

  • Improvement
  • Bug fix
  • New feature
  • Breaking change
  • Documentation

Testing

  • bun run type-check
  • bun run lint
  • bun run lint:check
  • bun run check:audits
  • bun run check:api-validation:strict
  • 29 focused Vitest tests covering navigation intent, history fetching, chat lifecycle, and collapsed sidebar behavior
  • React Doctor changed-line scan (no findings)

Notes

  • No new loading indicators or transcript-rendering changes
  • The existing transcript remains virtualized; this change targets navigation lifecycle and redundant requests

@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 23, 2026 5:41pm

Request Review

@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Removes the chat route loading.tsx and changes prefetch/history-fetch behavior, so a missed prefetch can leave the previous conversation on screen until data arrives. Also switches mark-read onto a dedicated endpoint.

Overview
Speeds up switching between mothership chats by keeping the current conversation visible until the destination is ready, instead of swapping to a route-level loading frame.

Sidebar chat rows now use ChatNavigationLink, which enables Next Link prefetch and React Query transcript prefetch only after deliberate hover (80ms dwell), keyboard focus, or an unmodified click. Drive-by hovers, touch-scroll, nested menu actions, and the already-open chat are skipped. Shared mothershipChatHistoryQueryOptions power both the live useChat query and that prefetch.

History fetch no longer falls through to the legacy copilot alias except on 404. Mark-as-read uses the conditional /api/mothership/chats/read contract. Claude rules document this continuity + intent-prefetch pattern as the exception to requiring loading.tsx.

Reviewed by Cursor Bugbot for commit b7e2669. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR accelerates conversation switching by retaining the current chat while deliberate navigation intent warms the destination route and its shared transcript query.

  • Adds intent-aware route and transcript prefetching for hover, keyboard, mouse, touch, and pen navigation.
  • Reuses shared history query options and limits legacy fallback requests to 404 responses.
  • Removes the chat route loading boundary to preserve continuity during peer navigation.
  • Adds focused regression coverage and documents the navigation pattern.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/chat-navigation-link/chat-navigation-link.tsx Implements deliberate-intent route and transcript prefetching, including the quick-click and completed-touch paths requested by the prior review.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/chat-navigation-link/chat-navigation-link.test.tsx Covers hover dwell, cancellation, keyboard focus, quick pointer activation, nested controls, current-route suppression, and route-role changes.
apps/sim/hooks/queries/mothership-chats.ts Centralizes transcript query options and restricts the legacy alias fallback to canonical endpoint 404 responses.
apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts Exposes history pending state from the same query consumed by the chat lifecycle.
apps/sim/app/workspace/[workspaceId]/chat/[chatId]/loading.tsx Removes the route-level loading boundary so the existing conversation remains visible while an intent-prefetched peer destination resolves.

Reviews (3): Last reviewed commit: "fix(chat): preserve quick-click prefetch..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@waleedlatif1
waleedlatif1 force-pushed the codex/chat-navigation-performance branch from bdb0a2f to b7e2669 Compare August 23, 2026 17:36
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b7e2669. Configure here.

@waleedlatif1
waleedlatif1 merged commit 1cb9c86 into staging Aug 23, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/chat-navigation-performance branch August 23, 2026 18:15
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.

1 participant