Skip to content

fix(desktop): persist yolo composer mode across reload#3546

Merged
esengine merged 2 commits into
main-v2from
fix/persist-exec-mode
Jun 8, 2026
Merged

fix(desktop): persist yolo composer mode across reload#3546
esengine merged 2 commits into
main-v2from
fix/persist-exec-mode

Conversation

@esengine

@esengine esengine commented Jun 8, 2026

Copy link
Copy Markdown
Owner

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). But persistedTabMode only 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), persistedTabMode now keeps plan and yolo; normal stays the un-persisted default. A restored yolo tab still shows the status-bar YOLO indicator, so it isn't silent.

Test

TestTabModeYoloSurvivesPersist drives the real save path (a yolo controller → currentTabModepersistedTabMode) and the load side, proving yolo round-trips; plan still persists, normal doesn't.

Closes #3517

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
@esengine esengine requested a review from SivanCola as a code owner June 8, 2026 08:06
@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 8, 2026
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.
@esengine esengine merged commit 7fffa2f into main-v2 Jun 8, 2026
9 checks passed
@esengine esengine deleted the fix/persist-exec-mode branch June 8, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 没有自动记住执行模式

1 participant