Conversation
…y chats - Replace setChatMode(mode) with selectAskMode() / selectAgentMode(); enforce free subscription and temporary-chats constraints inside selectAgentMode(); expose effectiveChatMode for model persistence. - Make temporary chats URL source of truth via useSearchParams(); replace setTemporaryChatsEnabled(bool) with enableTemporaryChats() / disableTemporaryChats() that update query via Next router. - Remove redundant typeof window checks in URL-sync effects. - Update ChatHeader, ChatInput, ChatModeSelector, ModeSelectorContent, SidebarHeader, and chat.tsx to use new APIs; remove ChatInput useEffects that forced ask mode (logic lives in GlobalState). Made-with: Cursor
… state
- Derive chatId and isExistingChat from route (routeChatId); remove
local chatId/isExistingChat state and URL sync effect. Use stable
local ref for new-chat id when route has no id.
- On new-chat reset call router.replace("/"); update URL to /c/[id]
in send handler when sending first message (not in onFinish).
- Clear message queue in selectAskMode and on chatId change (cleanup);
remove separate clear-when-switching-to-Ask effect.
- Require chatId === routeChatId for isChatNotFound to avoid flash
during new-chat transition; simplify sandbox init and hasSavedSandboxType.
Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR refactors the GlobalState API to replace generic setter functions with specific action functions ( Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit