Skip to content

feat(git-history): page the commit log; hide the mobile reconnect action when healthy - #1664

Merged
huichen merged 8 commits into
mainfrom
pr/huichen
Nov 21, 2026
Merged

huichen merged 8 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

What

The git-history views could not go past 200 commits, the phone's device sheet always offered a "Reconnect all" action even when every machine was connected, and the phone named its scheduled-tasks row differently from the desktop. This branch makes the history page, hides the reconnect action when there is nothing to reach, and aligns the label.

Commits

  • feat(git-history): page the log instead of stopping at 200 commits
  • fix(mobile): no reconnect action on a connection that is green end to end
  • fix(mobile): name the scheduled-tasks entry without the trailing "settings" word
  • docs(mobile): document that the device sheet has no action on a green connection

Verification

Run locally on the branch tip (a6abe186d), pinned toolchain 1.99.1:

  • cargo fmt --all -- --check — clean
  • cargo check -p future-host — clean
  • cargo test -p future-host --lib — 2336 passed, 0 failed, 15 ignored (451s)
  • cargo check -p futureos (desktop src-tauri) — clean
  • desktop: npx tsc --noEmit clean; npx eslint on the 5 changed files clean; npx vitest run src/features/git-history src/features/remote-peer — 997 passed
  • mobile: npm run typecheck clean; npx eslint on the 8 changed files clean; npx jest --runInBand on the 3 touched suites — 53 passed
  • make check-docs — 425 docs OK, channel matrix 13 rows OK

User-visible changes

  • Git history pages instead of stopping at 200 commits. Before: both the desktop panel and the phone showed the newest 200 commits and printed "the oldest commits are not shown" with no control. After: the desktop panel offers a button that appends the next page, and the phone appends automatically when the list reaches its end (with a footer button as the same request for a screen reader). Page size stays 200; the deepest page starts at 20 000 commits, so a deep read cannot lay out the whole history. A host or peer that predates paging keeps the old "not shown" line rather than a button that cannot advance. Revert 9ad50c8ee.
  • Mobile device sheet: no "Reconnect all" on a green connection. Before: the action was always drawn under the status line, reading as a fault report on a phone whose machines were all connected. After: it appears only when there is something to reach — a machine down, a machine held by another device, a failure to retry, or a pairing to drop. A machine in standby is not green, so taking it back keeps its action. Revert cfc6f5c8a.
  • Mobile machine page: scheduled-tasks row label. Before: it appended the word for "settings" to the row name while the desktop used the short name everywhere. After: both read the same. Revert 049a74144.

Notes

  • The wire protocol is unchanged: the page offset rides the existing offset field of list_git_commits, and git_graph_v1 is untouched, so an older client never sends an offset and an older host answers every request with the first page.
  • Each page is laid out from the top of the history and cut at the offset, not asked for with git log --skip, because a row's lanes depend on the rows above it; paging that way is what keeps the drawing continuous at the seam.

The phone's machine page called the row 「定时任务设置」 while the desktop
already calls it 「定时任务」 everywhere (rail, remote peer page, page title).
Drop the suffix so both read the same, and update the harness cases, the
screenshot scenarios and the docs that matched on the old label.
… end

The device sheet always drew its "Reconnect all" under the status line, so a
phone whose machines were all connected still opened onto a button that reads
as a fault report. Nothing there needs pressing: the transport retries on its
own (1s-30s backoff, then a quiet retry every five minutes), returning to the
foreground and the network coming back recover every runtime, the 15s presence
watchdog revives a socket that went quiet, and the machines the sheet is not
reading are rebuilt every 60s.

`reconnectable` now excludes the "up" state, so the action appears exactly when
there is something to reach: a machine down, a machine held by another device,
a failure to retry, or a pairing to drop. A single machine in standby is not
green, so taking it back keeps its action.
The sheet no longer draws "Reconnect all" under a status line that says every
machine is connected, so the two READMEs stop implying the action is always
there.
The history was one bounded read — `COMMIT_LIMIT = 200` — and both views
printed "the oldest commits are not shown" under the last row with nothing
to press. A repository with a real history therefore ended mid-scroll with
no way further back.

`list` now takes a `skip` and answers one page from there. The log is still
read from the top of the history and cut to the page afterwards rather than
asked for with `--skip`: a row's lanes are what the rows above it left
behind, so a page laid out on its own would start every line of work at
column 0 and the picture would break at the seam. `pages_concatenate_into_
the_single_page_drawing` pins that by paging a merge fixture two commits at
a time and comparing the result with the one-page drawing. The read is
bounded by `SKIP_CEILING` (20 000), which is what keeps a deep page from
reading and laying out the whole history.

The phone appends a page when the list reaches its end (with a footer
button as the same request for a screen reader), and the desktop's panel
appends on a button of its own; both dedupe by sha, because a commit landed
between two reads shifts the page's start. A host or peer that predates
paging answers the second request with the first page again — nothing new,
`truncated` still true — so the client stops there and keeps the old "not
shown" line instead of offering a button that cannot advance.

The request carries the offset in the protocol's existing `offset` field;
`git_graph_v1` is unchanged, since an older client simply never sends it.
@huichen
huichen enabled auto-merge (squash) November 21, 2026 03:27
@huichen
huichen merged commit 0dfa5f4 into main Nov 21, 2026
23 checks passed
@huichen
huichen deleted the pr/huichen branch November 21, 2026 03:42
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