Repository navigation
feat(remote): Git lane graph on mobile, and queue rows that keep their attachments - #1597
Merged
Merged
Conversation
…Git lane graph The conversation bar spent two of its three trailing slots on things a reader opens once a session — the session's files and its token/amount breakdown — which left the title with whatever width was over. They are now rows in a sheet behind a single three-dot button, on the same line as back. With one menu there is room for what the bar had no way to offer at all: the workspace's Git history. It is drawn the way the TUI's `/git` panel draws it — a lane per column of work, a commit per row, merges opening a column and branches closing back into the trunk — because a reader who has used the terminal panel should recognise the picture, and because a flat changelog cannot show where a line of work forked. The graph is computed on the desktop (`host/src/remote_host/git_graph.rs`, a port of `tui/src/workbench/git_panel.rs` so both surfaces draw one picture) and sent as the gutter string, two characters per lane. The phone colours it: `graphSpans` splits a row into coloured runs, giving a commit and its vertical the lane's colour and a horizontal the commit's own — the TUI's two rules, so one branch keeps one colour from its tip to the junction and one connection does not read as a new branch at every elbow it crosses. Each row also carries a two-point lane stripe at its left edge, which is what makes a page of commits scannable while scrolling without reading any glyph. Whether there is a history at all is answered by the same read that lists it (`isRepo`), not by a probe command of its own, and it is asked every time the menu opens: a workspace that is a plain directory never shows the row, and one where the reader has just run `git init` grows it on the next look. A desktop that does not advertise `git_graph_v1` is never asked. The commit detail is `git show --stat --patch` with `--no-color`, coloured by line role here — git's own ANSI would ride along in the text the reader selects and copies. The commit key is validated as hex before git ever runs, so `HEAD`, `--all` and paths cannot reach the command line. Verified against the real UI: `.screenshots/m-chat-menu.png` (three rows), `m-chat-menu-plain.png` (two, with no Git row), `m-chat-git-graph.png` (three lane colours in the gutter) and `m-chat-git-commit.png` (the patch, additions in green).
A message sent while a reply streams is held by the session, and the queue already reports the files it was sent with. Neither client read them. Desktop: rows carry their files (local paths on this machine; host paths on a paired computer), the panel draws one chip per file instead of an "Attachments: N" line, and an edit re-sends the files with the corrected words instead of quietly dropping the pictures. A host path cannot be opened here, so the remote composer fetches the file into the preview cache and mints a fresh upload before it cancels the row — a failed fetch leaves the row untouched rather than taking it and sending the words alone. Mobile: dropping the last file of a text-less row used to cancel the row and re-send an empty prompt, which the sender refuses, so the whole message vanished with nothing said. Refused now, and pointed at the bin. An empty edit says so instead of closing the editor over an unchanged row.
The send queue's attachment chips could not be captured at all: the fixture handed the panel rows with text and nothing else, so every screenshot of the panel showed the pre-attachment state. `?queueFiles=1` gives the first two rows the files a real send reports — an attachment-only photo first (the row that carried a picture with no words, which used to draw no controls), then a message whose text and photo and document travel together. Two scenarios capture the result in both schemes, and assert what the picture is supposed to show rather than trusting it: three chips named with their sizes, the attachment-only row drawing a chip and a bin but no editor (an empty save would be a removal), the mixed row drawing both controls, and every chip being the element the pointer actually lands on.
huichen
enabled auto-merge (squash)
November 12, 2026 15:28
The history's lanes arrived as the TUI's box-drawing grid and were painted as characters, one glyph per cell. At phone size that reads as a column of broken marks rather than as lines: the strokes were thin, they stopped and restarted at every cell boundary, and a vertical never joined the row above it. Decode the grid into geometry and draw it. `gitGraph.ts` now returns, per row, the vertical threads (with the row edges they reach), the horizontal connections as whole lane-to-lane runs, and the commit — in lane units, so the tests assert the picture without knowing any sizes. `laneDrawing` turns that into pixels: verticals run the row's full height so consecutive rows meet exactly, a turn is one quadratic curve that consumes as much of the vertical as it bends through, and a crossing opens a gap rather than drawing a junction the host never meant. Two colour rules come from the TUI's `paint_graph` and are what make the picture readable rather than merely coloured: a thread wears its own lane's colour, and a connection wears the *commit's* colour, so one connection stays one colour as it crosses lanes. A merge draws a ring and a plain commit a disc. Two rendering bugs the tests caught: turns were declared as one value while the decoder produced two (`up`/`down`), so every corner silently came out square; and a commit alone in its lane emitted a zero-length thread, which a round cap paints as a second dot on top of the real one. Also drop the header from both pages, list and patch. They are one continuous surface, and a bar over them cost a row of a phone screen to repeat what the page already was. What is left is the way out, top-left: back to the list from a patch, out from the list. Refresh moved to pull-down, and the commit's author and date moved into the patch page's body, where the header used to say them. The screenshot scenarios now assert strokes rather than monospace runs: 117 strokes in 8 lane colours with 6 curves, no box-drawing glyph on screen, and content starting 108px from the top with no header above it.
…ling
`git rev-parse --show-toplevel` prints the path in Git's own spelling — forward
slashes on Windows — while `fs::canonicalize` reports the extended-length form
(`\\?\C:\...`). The listing's `path` went out in the first form while the test
expected the second, so the Windows job failed on the same directory twice:
left: "C:/Users/runneradmin/AppData/Local/Temp/.tmpqHGVZL"
right: "\\\\?\\C:\\Users\\runneradmin\\AppData\\Local\\Temp\\.tmpqHGVZL"
The fix is in the production path, not in the assertion. A client renders this
string verbatim (as it does the session file listing's paths), so it is
normalised once at that boundary by `reported_root`: the directory's canonical
form with the Windows verbatim prefix removed, i.e. the same pair the stored
workspace paths and `remote_host::session_files` already use. `git` itself keeps
running in Git's own spelling, so a Windows path past MAX_PATH keeps the
extended-length form it needs; only the reply is rewritten, so a client is never
handed `\\?\C:\...`, and a repository reached through a symlinked spelling now
reports the one directory it is.
The test only observes that: it still proves the reply names the repository root
rather than the nested workspace it was asked about, and now also states the rule
the reply has to hold — the reported root never carries the extended-length
prefix. Both assertions are exercised off Windows, where a Windows-spelled path
can still arrive from a paired desktop.
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.
What this does
Brings the workspace's Git history into the mobile conversation: a new host read command returns the lane graph, and the phone draws it the way the TUI's
/gitpanel does — one lane per column of work, one commit per row, merges opening a column, with the lanes painted as lines rather than spelled out in text. Making room for it meant folding the conversation bar's three trailing buttons into a single menu, which also brings that bar back to one row. Alongside it, a message held while a reply streams now carries the files it was sent with, in both clients.Commits
Verification
Run in a detached worktree at the branch tip with the pinned toolchain (rustc 1.99.1) and
ulimit -n 8192:cargo fmt --all -- --check→ cleancargo clippy -p future-host -p future-remote-protocol --all-targets -- -D warnings→ cleancargo test -p future-remote-protocol→ passcargo test -p future-host --lib→ 2241 passed, 0 failed, 14 ignored (before the last two commits)cargo test -p future-host --lib git_graphat the branch tip → 12 passed, 0 failed, including the Windows-path test that was red on the first CI attemptdesktop:npx tsc --noEmitclean,eslint src/features/agent src/features/remote-peerclean,vitest run154 files / 2293 tests passedmobile:tsc --noEmitclean at the branch tip (link-farm worktree);jest src/features/chatpasses the newgitGraph,GitGraphPanel,ChatTopBarandChatScreensuites, whileuseFileDownloadanduseSkillRecommendationfail identically atorigin/mainunder Node 26 (ReferenceError: clearTimeout is not defined) — the local environment, not this branch. Mobile jest could not be re-run at the final tip becausejest-expois not present in this machine's installednode_modules.scripts/screenshots/scenarios.jsonparses as JSONUser-visible changes
885ce1b77.885ce1b77and701de8a73.Attachments: Nline, and an edit dropped the files. Revert948c2253a.Notes
The Git graph read is a host-side command addition (
gitRefonget_git_commit, plus the graph listing), regenerated into both the TypeScript and Rust protocol sources;packages/remote-protocol/fixtures/protocol.jsoncarries the new fixture.The reported repository root is normalized to the file system's own spelling, so a Windows host no longer returns the extended-length
\\?\C:\...form that the client could not match against its workspace paths.