fix(desktop): switching tabs no longer throws away the Fleet view - #26
Merged
Conversation
Reported as "if i click away i lose all my data", and that is exactly right.
Making Fleet a tab in v0.2.9 turned the body into a ternary:
{tab === 'transfer' ? ( …panes… ) : <FleetView />}
React unmounts the branch that is not rendered, so switching to Transfer
destroyed everything in the Fleet view — a half-written script, the servers
you had ticked, the output of a run still in flight — and switching back gave
you a blank editor. Clicking a tab to check a path is not a reset, and this
was a regression I introduced.
Both views stay mounted now, and the inactive one is hidden. Verified by
driving the built renderer: type a three-line script, tick two servers, set
"at once" to 7, click Transfer, click Fleet — all three come back.
The same complaint applies to quitting the app, so the Fleet editor now keeps
an unsaved draft in the window's own storage: script, interpreter, sudo,
pacing, timeout and the ticked servers. That is the safety net under "Save
these settings", not a replacement for it — the saved command is still the
deliberate act.
Two things the draft deliberately does not do. It never stores a sudo
password; it has no field for one, and there is a test asserting the written
blob contains no such string. And every read falls back field by field, so
last week's shape after a schema change, a half-written value, or storage that
throws outright gives a blank editor rather than a broken window.
A restored selection is filtered against the servers that actually exist, and
missing ones are dropped quietly — this is a draft, not a saved list, and
there is nothing for a run to get wrong yet.
508 tests plus 9 new ones for the draft.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UeSWg1Czsb2Lwxj8vHUnA4
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.
Reported as "if i click away i lose all my data", and that is exactly right.
Making Fleet a tab in v0.2.9 turned the body into a ternary:
React unmounts the branch that is not rendered. So switching to Transfer destroyed everything in the Fleet view — a half-written script, the servers you had ticked, the output of a run still in flight — and switching back gave you a blank editor.
Clicking a tab to check a path is not a reset. This was a regression I introduced.
Fix
Both views stay mounted; the inactive one is hidden.
Verified by driving the built renderer: type a three-line script, tick two servers, set at once to 7, click Transfer, click Fleet — script intact,
2/7still ticked,At once 7, Run on 2 servers.The same complaint applies to quitting the app
So the Fleet editor now keeps an unsaved draft — script, interpreter, sudo, pacing, timeout, ticked servers — in the window's own storage. That is the safety net under Save these settings, not a replacement: the saved command is still the deliberate act.
Two things the draft deliberately does not do:
Checks
508 tests plus 9 new ones for the draft. Typecheck and
pnpm smoke:desktopgreen.Worth knowing separately: the reporter was running 0.2.1, which has no Fleet at all — so none of the save UI from v0.2.8–v0.2.13 was on their machine. That was the bulk of "I saw no way to save profiles". This PR fixes the real defect underneath it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UeSWg1Czsb2Lwxj8vHUnA4