fix(desktop): a profile restores both panes where you left them - #28
Merged
Conversation
A profile stored `source` and `destination`, and loading put the source into the LEFT pane always. But with the arrow pointing right-to-left the source *is* the right pane — so a profile saved that way came back **mirrored**, with each pane on the wrong side and the arrow reset to left-to-right. `source` and `destination` still carry the transfer's meaning and always will: that is what `diskpush profile run` acts on, and it must not depend on how a window happened to be arranged. So the arrangement is recorded alongside it — `sourcePane`, one of 'left' or 'right' — and loading puts each pane back where it was and the arrow the way you had it. Migration 005 adds the column defaulting to 'left', which is what every existing row was implicitly assumed to be, so nothing already saved changes behaviour. Worth knowing while reading this: the rail's direction buttons both set the direction AND start the transfer, so `direction` only ever changes as a side effect of running. `sourcePane` therefore records the arrangement the last run used, which is the one on screen. The type checker caught the CLI's `profiles save` building a profile without the new field. It passes 'left': a profile made from a terminal has no panes, and source-on-the-left is how the app will open it. Verified by driving the built renderer end to end: flip the arrow so the source is the right pane, save, disturb the layout, load it back — left pane "This computer", right pane "web-01", arrow still right-to-left. The stored row reads `sourcePane: right`. 517 tests. 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.
A profile stored
sourceanddestination, and loading put the source into the left pane always. But with the arrow pointing right-to-left the source is the right pane — so a profile saved that way came back mirrored, each pane on the wrong side, with the arrow reset to left-to-right.Fix
sourceanddestinationstill carry the transfer's meaning and always will: that is whatdiskpush profile runacts on, and it must not depend on how a window happened to be arranged.So the arrangement is recorded alongside it —
sourcePane,'left'or'right'— and loading puts each pane back where it was, arrow included.Migration
005adds the column defaulting to'left', which is what every existing row was implicitly assumed to be. Nothing already saved changes behaviour.Worth knowing while reading this
The rail's direction buttons both set the direction and start the transfer — there is no way to flip the arrow without running. So
directiononly ever changes as a side effect of a run, andsourcePanerecords the arrangement the last run used, which is the one on screen.Caught by the type checker
The CLI's
profiles savebuilds a profile too and didn't set the new field. It now passes'left': a profile made from a terminal has no panes, and source-on-the-left is how the app will open it.Verified end to end
By driving the built renderer, not by reading:
pull-from-web01— stored row readssourcePane: rightBefore the fix, step 4 put
web-01on the left.517 tests, typecheck and
pnpm smoke:desktopgreen.Independent of #27 (the server manager) — both branch off
mainand touch different parts ofpage.tsx.🤖 Generated with Claude Code
https://claude.ai/code/session_01UeSWg1Czsb2Lwxj8vHUnA4