Skip to content

fix(desktop): a profile restores both panes where you left them - #28

Merged
ralyodio merged 1 commit into
mainfrom
fix/profile-restores-both-panes
Aug 30, 2026
Merged

fix(desktop): a profile restores both panes where you left them#28
ralyodio merged 1 commit into
mainfrom
fix/profile-restores-both-panes

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

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, each pane on the wrong side, with the arrow reset to left-to-right.

Fix

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, 'left' or 'right' — and loading puts each pane back where it was, arrow included.

Migration 005 adds 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 direction only ever changes as a side effect of a run, and sourcePane records the arrangement the last run used, which is the one on screen.

Caught by the type checker

The CLI's profiles save builds 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:

  1. Flip the arrow so the right pane is the source
  2. Save as pull-from-web01 — stored row reads sourcePane: right
  3. Disturb the layout (flip back to left-to-right)
  4. Load the profile
  left pane:   This computer
  right pane:  web-01
  arrow points right-to-left again: YES

Before the fix, step 4 put web-01 on the left.

517 tests, typecheck and pnpm smoke:desktop green.

Independent of #27 (the server manager) — both branch off main and touch different parts of page.tsx.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UeSWg1Czsb2Lwxj8vHUnA4

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
@ralyodio
ralyodio merged commit a1a71bf 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