Skip to content

fix(web): clear changes views after deleting all sessions#14861

Closed
ravshansbox wants to merge 1 commit intoanomalyco:devfrom
ravshansbox:fix/changes-view-clearing
Closed

fix(web): clear changes views after deleting all sessions#14861
ravshansbox wants to merge 1 commit intoanomalyco:devfrom
ravshansbox:fix/changes-view-clearing

Conversation

@ravshansbox
Copy link
Copy Markdown
Contributor

@ravshansbox ravshansbox commented Feb 24, 2026

Issue for this PR

Closes #14860

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Problem: After deleting all sessions and navigating back to the session list (where params.id is undefined), the following views still display stale content instead of being empty:

  • Session changes view
  • Last turn changes view
  • Changes view

Root Cause:

  1. The SessionReview component's local store is initialized with initial diffs and doesn't clear itself when diffs become empty
  2. The tree state (tracking activeDiff, pendingDiff, reviewScroll) is only cleared when sessionKey changes, but not when params.id becomes undefined

Changes:

  1. SessionReview component (packages/ui/src/components/session-review.tsx):

    • Added effect to clear local store.open state when props.diffs becomes empty
    • This ensures the component's internal state resets when no diffs are available
  2. Session page (packages/app/src/pages/session.tsx):

    • Added effect to clear tree state (reviewScroll, pendingDiff, activeDiff) when params.id is undefined
    • This ensures diff tracking state is cleared when navigating away from a session

How did you verify your code works?

Verified that after deleting all sessions and navigating back to the session list:

  • All changes views are completely empty
  • No stale content is displayed
  • The review panel shows the empty state

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Feb 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added contributor and removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Feb 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@ravshansbox ravshansbox force-pushed the fix/changes-view-clearing branch from 4bd5b9a to 3f0956b Compare February 25, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Changes views show stale content after deleting all sessions

1 participant