feat(frontend): implement chat session recovery and reset UX#35
Merged
feat(frontend): implement chat session recovery and reset UX#35
Conversation
- Implement useChatSession hook to verify session validity on page mount - Add strict 404 error handling to gracefully wipe invalid local session data - Add temporary 'Start New Plan' button to manually reset conversation flow - Leverage existing Zustand persist store to handle safe session restoration
There was a problem hiding this comment.
Pull request overview
Updates the chat UI to better handle expired/invalid backend sessions and adds a manual “Start New Plan” reset control for users.
Changes:
- Adds a session existence check (
useChatSession) and auto-resets local chat state on session errors. - Adds a “Start New Plan” button that clears the local conversation.
- Expands pending state to include session fetch activity.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Restrict session auto-wipe to explicitly catch 404 HTTP status errors using AxiosError - Add guard in handleResetSession to alert and prevent users from resetting while a network request is pending - Refine code comments for temporary UI components
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Testing
npm run buildfor frontend,pytestfor backend)npm run typecheckfor frontend)Screenshots / Visual Changes
After
Desktop Screen "Start New Plan" Button:

Mobile Screen "Start New Plan" Button:
|
"Start New Plan" temporary window confirmation

Desktop Screen "Clear Recovery Message":

Mobile Screen "Clear Recovery Message":

Related Issues
Checklist
anytypes used unnecessarily (TypeScript)Breaking Changes
None
Deployment Notes
None
Additional Context
Note on Persistence: The localStorage persistence layer (Zustand persist middleware inside frontend/atla/src/stores/chatStore.ts) was actually implemented in a previous PR (#25). This PR specifically focuses on utilizing that layer to implement the visual recovery, verification, and reset UX.
Review Notes:
Reviewer: Please indicate whether to squash commits or preserve history when merging.