Type a path on the SFTP pane, and put a file right without deleting it
ci / build and test (pull_request) Successful in 2m30s
ci / desktop nightly (pull_request) Skipped
ci / android head (pull_request) Successful in 7m21s
ci / api image (pull_request) Successful in 23s
ci / build and test (push) Successful in 2m28s
ci / android head (push) Successful in 3m27s
ci / desktop nightly (push) Successful in 53s
ci / api image (push) Successful in 36s

Three things the file browser could not do. Somewhere to go had to be walked
to, a file that landed under the wrong name could only be removed and sent
again, and the listing went on showing the directory as it was before this
application put something in it.

◆ THE PATH IS A BOX NOW, not a TextBlock printing where the pane was. A
breadcrumb only reaches what is under the directory already listed, so crossing
a host's filesystem cost a click and a round trip a level, and a path somebody
already knew could not be entered at all. Enter goes; Escape puts back what the
pane is really showing.

What is typed may be absolute, relative to the directory showing, or start at
~ — the four shapes a shell takes, because somebody typing into a box is typing
what they would type into a shell. SftpPath.Resolve turns all of them into one
absolute path, and it resolves them here rather than handing a relative path to
the server: the server would resolve it against the session's own working
directory, which is not necessarily the directory the breadcrumb above the box
is showing. `..` is collapsed textually, which differs from cd through a
symbolic link; the alternative is a realpath round trip before anything lists.

The box holds its own value rather than RemotePath itself. Binding it straight
to the path would navigate on every keystroke — `/`, then `/v`, then `/va` — a
round trip and a failed listing per character. Every other way of moving writes
the real path back into it; a refused listing deliberately does not, because
the path that did not resolve is the one worth having in front of you.

◆ RENAME AND MOVE, and DELETE moves to join them. It had been sitting in the
pane header beside UP and REFRESH — two things that move the pane and one that
destroys a file, in one row — and the three that act on the selected row are
now together in a row of their own, under the name of the row they are about.

One SFTP rename underneath both new operations and two separate questions on
the screen, because the answer is a different kind of thing each time: a rename
takes a name and must not take a path, a move takes a directory and must not
take a name. One box asking for a destination path would be fewer controls and
a worse question — the two mistakes it invites are exactly the ones the split
makes impossible. Each form opens on the answer that changes nothing, so what
gets edited is the half somebody came to change.

Three refusals are made here, and they are the ones a server's message would
not explain: a separator in a name (no such file, about a directory nobody
meant to name), a destination equal to the source (success, and a file that did
not move), and a directory into itself (EINVAL, true and useless). Everything
else is the server's — a name already taken, a path that is not there, a mount
that cannot be crossed — and arrives in the status line in its own words.
Neither is painted in the deletion card's red: a rename is undone by renaming
back, and spending that red twice makes it stop meaning anything.

◆ THE LISTING REFRESHES ITSELF when a transfer lands in it. Both panes, since
an upload lands on the host and a download lands here and either leaves the
pane that is showing that directory a step behind. Only the directory actually
on screen: a queue moving a hundred files elsewhere must not be a round trip
per file for a listing nobody is looking at.

It waits rather than interrupting. Another operation running would have two
listings racing for one collection, and re-listing under an open question is
how the row somebody answered about stops being the row that gets acted on — so
the staleness is remembered and settled at the end of the operation or when the
question is dismissed. It says nothing either way: nobody asked for it, and the
status line at that moment is carrying the news about the transfer. The
selection survives, re-found by path, which is what makes an unasked-for
refresh safe to run under somebody's pointer at all.

◆ THE LAYOUT SUITE FOUND A REAL FAULT and the fix is where the height goes. The
rename form did not fit the 204 pixels the session shell's own sidebar leaves
this pane — MKDIR and the listing were pushed off the bottom. The form is
shorter now (the placeholder says what the box wants, so there is no field
label above it), and the item row and the breadcrumb step aside while any of
the three questions is up, which is what the phone head already did with its
own buttons.

Measuring also settled something the markup had been claiming and is not true:
at that width the listing collapses to nothing under any of the three cards,
the deletion card included, and has done since the sidebar arrived. So "the row
it is about is still on screen" is retired from the deletion card's remark, and
the full path each card carries is what identifies the row instead. Recorded
where it is drawn rather than left to be rediscovered.

TESTS. SftpPath.Resolve gets the four shapes, ~ with and without a home to
expand it to, a blank box, and climbing past the root. ShellFlowTests gets nine
against a session that records what it was asked to do — which path was
renamed, which directories were listed — rather than against the sentence this
code writes about itself: the path box absolute and relative, rename in place,
the separator refusal, a move by relative path, the no-op refusal, the three
questions displacing each other, and the three rules the automatic refresh
follows. The local half is in TransferQueueingTests, where a real folder
answers. Two new shapes are measured, and the deletion card's own measurement
moves to the connected state — the only state it can be asked in, and the
narrow one.

What the tests cannot reach is in docs/manual-checks.md as phase 2b: a real
server's cross-device and name-taken refusals, and a soft keyboard, which is
why the phone's path box has a GO button rather than trusting whatever the IME
decided to draw on its return key.
This commit is contained in:
jaap-jan committed 2026-08-21 12:05:33 +02:00
1 parent 2f8daacb60
commit 882f01c515
11 files changed
+1508 -50

No files matched your search

+76
View File
@@ -427,6 +427,82 @@ surface. Use the ← button, or drag the file to the local pane first.
---
## Phase 2b — The path box, and what can be done to a remote row
The rules are automated — `SftpPath.Resolve` in `RemotePathTests`, the three questions and the automatic
refresh in `ShellFlowTests`, both new shapes measured in `ScreenLayoutTests`. What is left here is what
those cannot reach: a real server's own refusals, and a soft keyboard.
Connect the SFTP page to a host first.
### 2.20 Typing a path
Click into the path in the remote pane's header, type `/var/log`, press Enter. Then type `..`, Enter. Then
`~`, Enter.
**Pass:** each one lists, the breadcrumb underneath follows, and the box ends up showing the absolute path
that was actually reached rather than what was typed.
### 2.21 Escape puts the path back
Type nonsense into the box without pressing Enter, then press Escape.
**Pass:** the box goes back to the directory the pane is showing.
### 2.22 A path the server refuses
Type a path that does not exist, and one that exists but is not readable by this account.
**Pass:** the pane stays where it was, the status line at the foot of the screen carries the server's own
message, and the box still holds what was typed so it can be corrected.
### 2.23 Rename
Select a file, press the rename button, change the name, press RENAME.
**Pass:** the listing comes back with the new name and the row still selected. Then try a name that another
file in the directory already has: **the server refuses it and says so, and nothing is overwritten** — this
is the one that matters, because the whole queue's "nothing lands at its final name until it is complete"
promise rests on the same server behaviour.
### 2.24 Move
Select a file, press the move button, type a directory — try an absolute one and a relative one — and press
MOVE.
**Pass:** the file leaves the listing and is in the directory that was typed.
Then try one across a filesystem boundary on the same host — `/tmp` to a path on a separate mount is the
usual pair. **Pass:** the server refuses with its own message about a cross-device link. This cannot be
faked in a test and is the refusal somebody will eventually meet.
### 2.25 The listing refreshes itself after an upload
Upload a file into the directory showing.
**Pass:** it appears in the remote listing without REFRESH being pressed. Then upload into a *different*
directory: nothing on screen changes. Then download a file into the folder the local pane is showing, and
that one appears on the left the same way.
### 2.26 A transfer that lands while a question is open
Start an upload into the directory showing, and while it runs select a row and press DELETE so the question
is up when the transfer finishes.
**Pass:** the listing does not move while the question is on screen, and refreshes the moment the question
is answered or cancelled.
**Failure means:** the row the question was asked about is not necessarily the row that gets acted on.
### 2.27 The phone's GO button
On Android, connect on the Files screen, type a path into the box above the breadcrumb and press GO.
**Pass:** it lists. The keyboard's own return key may or may not commit — that is the IME's choice, which is
why GO exists — but GO always must.
---
## Phase 3 — Host groups and snippets
Two synced item kinds, two ways of drawing a group — the desktop's grid of cards, one level at a time, and