Fix/UI session history sync#1633
Open
BingqingLyu wants to merge 5 commits intomainfrom
Open
Conversation
Fix P2 Badge: The mobile picker now uses .selected=${live(...)} instead of
?selected attribute binding to reliably force the live selected option
after rerender, preventing stale selection display when state.sessionKey
changes externally (navigation/deep-link rehydration).
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
Describe the problem and fix in 2–5 bullets:
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
<select>relied on.valuewhile its option list could be rebuilt during rerender.chat-controls__sessionclass as the desktop picker, which made selector targeting ambiguous.git blame, prior PR, issue, or refactor if known): Earlier investigation focused on async history/nav flows because the symptom looked like session-state drift; the exact repro showed the thread content was already correct while only the selector was stale./chat?session=...and the session options are reconstructed around the current session.chat.historyoverwrite, and not a session reset caused by auth/token handling.Regression Test Plan (if applicable)
ui/src/ui/views/chat.test.tsUser-visible / Behavior Changes
Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
sessionquery param or after returning to Chat with a previously selected sessionSteps
/chat?session=agent%3Amain%3Atest-b.Expected
Actual
test-ewhile the rendered thread was alreadytest-b.Evidence
Attach at least one:
Local verification:
pnpm test -- ui/src/ui/views/chat.test.ts ui/src/ui/controllers/chat.test.tsbefore


With this PR:
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm test -- ui/src/ui/views/chat.test.ts ui/src/ui/controllers/chat.test.ts.sessionquery param and verifying repeated page switches do not desync the picker.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
<select>behavior can be sensitive when options are rebuilt dynamically.data-chat-session-selectmarkers.