Codex/UI redesign#66
Conversation
…redit-check-dquog7 Improve chat persistence and usage accounting; preserve in-memory history; bump dev dependency
✅ Deploy Preview for tera-ai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9fc0b3875
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!user?.id) { | ||
| return |
There was a problem hiding this comment.
Clear conversation state when user context disappears
When user becomes null/undefined (for example after clicking Sign out in MainShell), this effect now returns without resetting any chat state, so the previous user's messages remain rendered until a full remount. That is a privacy leak in shared-browser/account-switch flows and a regression from the prior behavior that explicitly cleared conversations on missing user.
Useful? React with 👍 / 👎.
| if (loadedConversations.length === 0 && prev.length > 0) { | ||
| return prev | ||
| } |
There was a problem hiding this comment.
Replace stale messages when history fetch returns empty
The new guard keeps prev whenever loadedConversations is empty, which means switching to a session with no rows (or any auth/error path where fetchChatHistory returns []) will continue showing the previous session's transcript. This causes cross-session data bleed and incorrect UI state because the displayed messages no longer match the active sessionId.
Useful? React with 👍 / 👎.
No description provided.