Skip to content

feat(frontend): implement chat session recovery and reset UX#35

Merged
Hanseooo merged 2 commits intomainfrom
feat/session-recovery
Mar 16, 2026
Merged

feat(frontend): implement chat session recovery and reset UX#35
Hanseooo merged 2 commits intomainfrom
feat/session-recovery

Conversation

@RANDAAAALL
Copy link
Collaborator

@RANDAAAALL RANDAAAALL commented Mar 16, 2026

Description

  • 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

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Other (please describe):

Testing

  • Build passes (npm run build for frontend, pytest for backend)
  • Type check passes (npm run typecheck for frontend)
  • Tested locally
  • All existing tests pass

Screenshots / Visual Changes

After

Desktop Screen "Start New Plan" Button:
Screenshot 2026-03-16 134556

Mobile Screen "Start New Plan" Button:
Screenshot 2026-03-16 134612|

"Start New Plan" temporary window confirmation
Screenshot 2026-03-16 142958

Desktop Screen "Clear Recovery Message":
Screenshot 2026-03-16 134704

Mobile Screen "Clear Recovery Message":
Screenshot 2026-03-16 134710


Related Issues

Checklist

  • Code follows project conventions (see ARCHITECTURE.md)
  • No any types used unnecessarily (TypeScript)
  • Proper error handling implemented
  • Loading states added (if applicable)
  • Responsive design tested (if UI changes)
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated (if needed)

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.

- 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
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
@RANDAAAALL RANDAAAALL requested a review from Hanseooo March 16, 2026 06:40
@RANDAAAALL RANDAAAALL self-assigned this Mar 16, 2026
@Hanseooo Hanseooo linked an issue Mar 16, 2026 that may be closed by this pull request
Copy link
Owner

@Hanseooo Hanseooo left a comment

Choose a reason for hiding this comment

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

🔥🔥🔥

@Hanseooo Hanseooo merged commit 9080f1e into main Mar 16, 2026
3 checks 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.

[Frontend]: Add chat session lifecycle and recovery UX

3 participants