Skip to content

fix(desktop): switching tabs no longer throws away the Fleet view - #26

Merged
ralyodio merged 1 commit into
mainfrom
worktree-fix-tab-state-loss
Aug 30, 2026
Merged

fix(desktop): switching tabs no longer throws away the Fleet view#26
ralyodio merged 1 commit into
mainfrom
worktree-fix-tab-state-loss

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

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. 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/7 still 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:

  • It never stores a sudo password. There is no field for one, and a test asserts the written blob contains no such string.
  • Every read falls back field by field. 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.

Checks

508 tests plus 9 new ones for the draft. Typecheck and pnpm smoke:desktop green.

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

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
@ralyodio
ralyodio merged commit f1d4d6d into main Aug 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant