Skip to content

fix(app): preserve question dock state across session switches#16173

Merged
nexxeln merged 1 commit intoanomalyco:devfrom
ualtinok:fix/question-dock-state-reset
Mar 5, 2026
Merged

fix(app): preserve question dock state across session switches#16173
nexxeln merged 1 commit intoanomalyco:devfrom
ualtinok:fix/question-dock-state-reset

Conversation

@ualtinok
Copy link
Contributor

@ualtinok ualtinok commented Mar 5, 2026

Issue for this PR

Closes #16172

Type of change

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

What does this PR do?

When the question tool presents multiple questions in a batch, switching to another session and back resets the UI to question 1 with all answers lost. This happens because SessionQuestionDock is rendered inside <Show keyed>, so navigating away unmounts it and navigating back remounts it with fresh local state (tab: 0, answers: []).

This adds a module-level cache keyed by question request ID that saves in-progress state (tab, answers, custom, customOn) on unmount and restores it on remount. The cache is cleared after a successful reply or reject so stale drafts don't linger.

How did you verify your code works?

  • LSP diagnostics clean
  • Typecheck + build pass via pre-push hook

Screenshots / recordings

N/A

Checklist

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

@ualtinok ualtinok requested a review from adamdotdevin as a code owner March 5, 2026 12:31
Copy link
Member

@nexxeln nexxeln left a comment

Choose a reason for hiding this comment

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

ty

@nexxeln nexxeln merged commit 07348d1 into anomalyco:dev Mar 5, 2026
12 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.

[BUG] Question tool UI loses in-progress answers when switching sessions

2 participants