fix(desktop): persist yolo composer mode across reload#3546
Merged
Conversation
persistedTabMode dropped yolo (only plan was saved), so selecting yolo and relaunching reverted to normal — the tab persist/restore machinery already round-trips the mode, yolo was just filtered out. Persist plan and yolo (a restored yolo tab keeps its status-bar indicator); normal stays the un-persisted default. Closes #3517
TestSaveTabsDoesNotPersistYoloMode encoded the old drop-yolo behavior; renamed to TestSaveTabsPersistsYoloMode and flipped to assert yolo survives the real saveTabsLocked/loadTabsFile round-trip. Drops the redundant unit test added alongside the fix.
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.
Fixes #3517: select yolo, close the app, reopen → it reverted to normal/auto.
Root cause
The desktop already persists and restores each tab's composer mode across reload and relaunch (saved as
entry.Mode, restored at startup and applied to the controller). ButpersistedTabModeonly kept"plan"and dropped"yolo"to""— a deliberate safety choice. Both the save and load sides go through that one function, so yolo never survived.Fix
Per maintainer decision (persist per-session incl. yolo),
persistedTabModenow keeps plan and yolo;normalstays the un-persisted default. A restored yolo tab still shows the status-bar YOLO indicator, so it isn't silent.Test
TestTabModeYoloSurvivesPersistdrives the real save path (a yolo controller →currentTabMode→persistedTabMode) and the load side, proving yolo round-trips; plan still persists, normal doesn't.Closes #3517