fix(tui): prevent identity redo loop + fix session browser selection bug#1515
Closed
Aaronontheweb wants to merge 3 commits into
Closed
fix(tui): prevent identity redo loop + fix session browser selection bug#1515Aaronontheweb wants to merge 3 commits into
Aaronontheweb wants to merge 3 commits into
Conversation
The IdentityStepView is a singleton on IdentityRedoViewModel. Each layout rebuild creates new TextInputNode instances with new subscriptions added to _stepSubs, but old subscriptions were never cleared. After the user submitted the timezone field, stale callbacks from the previous render would re-fire and re-trigger GoNext(), creating an infinite loop back to the timezone input screen. Clear _stepSubs inside the DynamicLayoutNode callback before creating new subscriptions to prevent this accumulation.
Add comprehensive regression tests for SessionsPage that verify: - Arrow key navigation updates SelectedIndex correctly - SelectionListNode + .WithHighlightedIndex() renders scrollable lists - Enter confirms selection and sets ResumeSessionId - N key starts new chat without resuming Regression for: sessions were unselectable after commit 35d79d2 ("make all TUI list views scrollable") because SelectionListNode captured arrow keys internally but never propagated selection back to ViewModel.SelectedIndex.
Comment on lines
+307
to
+310
| return Task.FromResult(new HttpResponseMessage(System.Net.HttpStatusCode.OK) | ||
| { | ||
| Content = new StringContent(json, Encoding.UTF8, "application/json") | ||
| }); |
Collaborator
Author
|
Superseded by #1518. #1518 carries the same two fixes rebased cleanly onto current Investigation notes carried into #1518:
|
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.
Summary
Two TUI fixes on
fix/identity-redo-loop-bug:1. Identity Redo Timezone Loop Fix
The IdentityStepView is a singleton on IdentityRedoViewModel. Each layout rebuild creates new TextInputNode instances with new subscriptions added to
_stepSubs, but old subscriptions were never cleared. After the user submitted the timezone field, stale callbacks from the previous render would re-fire and re-trigger GoNext(), creating an infinite loop back to the timezone input screen.Fix: Clear
_stepSubsinside the DynamicLayoutNode callback before creating new subscriptions.2. Session Browser Selection Bug
Regression for: sessions were unselectable after commit 35d79d2 ("make all TUI list views scrollable") because SelectionListNode captured arrow keys internally but never propagated selection back to ViewModel.SelectedIndex.
Fix: Use SelectionListNode with
.WithHighlightedIndex()for scrollable rendering while keeping manual Up/Down key handling in the ViewModel for proper two-way selection binding.Tests
Added comprehensive regression tests in
SessionsPageTests.cs: