Skip to content

feat(remote-peer): rename a machine from its row, and grey out its settings - #1325

Merged
huichen merged 13 commits into
mainfrom
pr/dev-huichen
Oct 23, 2026
Merged

huichen merged 13 commits into
mainfrom
pr/dev-huichen

Conversation

@huichen

@huichen huichen commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Renaming a machine and picking its icon were the only two things on the remote
machine's settings page that never reach that machine: remote_peer_set_label
writes the local credential book. So they now live on the machine's own row, and
the row is where you would look when the machine is switched off.

What changed

Inline editing (RemotePeersView.tsx)
PeerRow gains a pencil button (aria-label = new key editLabel) beside the
name and badge, opening a small dialog with a name field and the existing
PeerIconPicker grid. Saving sends one patch carrying only the fields that
actually changed, goes through setRemotePeerLabel, then re-reads the list so
the row shows the new value. The label control keeps working while the machine
is offline — the one control on the row that does.

RemotePeerSettings.tsx loses the "this computer only" section, along with
onUpdateLabel and the state behind it. Two surfaces for one value meant one of
them could show the old name after the other had changed it, and a local field
among the remote rows read as one more remote setting — one that greyed out with
the rest whenever the host was not connected.

Settings button
Disabled condition becomes busy || held || !peer.connected (revoked implies
not connected). The hint reuses settingsOfflineHint for the new offline case
and sits on the wrapping <span title>, as takeOverHint already does, because
a disabled button receives no pointer events.

i18n
zh/en/remotePeer.json add editLabel ("修改名称与图标" / "Edit name and icon");
drop localSection and the now-dead iconSectionHint. The dialog reuses
nameHint, nameLabel, namePlaceholder, icons.label, save, saving,
cancel. Checked the other references to the removed section: only these two
locale files and three tests; docs/ has none; mobile uses its own
desktops.nameHint (the phone's local naming, a different thing) and is untouched.

Verification

  • tsc --noEmit: passes
  • eslint over src/**, shot/**, vite.shot.config.ts: 0 errors; one
    pre-existing warning in recentOrder.ts, unrelated to this change
  • vitest run (desktop, full): 375 files / 5220 tests pass
  • New tests: disables Settings on a machine that is not connected (greyed +
    hint text + click opens nothing), renames a machine from its own row while it is offline (offline rename + icon -> one {icon, name}patch, list re-read, dialog closed),saves a label only once something has changed, reports a label the local book refused`; the "only machine-level actions on
    the row" button list was updated.

[profile.local] (added in 464b75b) keeps release optimisation but drops
ThinLTO and reuses the incremental cache. It had no make wrapper, so using it
meant remembering the exact cargo invocation and package name.

Add two targets that are pure additions; no existing target changes:

    build-cli-local:     cargo build --profile local -p future-cli
    build-desktop-local: cargo build --profile local -p futureos

They exist for local verification only and deliberately stay out of
`install*` and `package-desktop`: what ships must keep coming from the
unchanged `release` profile. They also do not wrap the frontend build or the
Tauri bundling `build-desktop` does — they produce the Rust binaries under
target/local/ only.

Measured in a fresh worktree (cold target directory, sccache warm):
build-cli-local 244 s cold, 4.5 s after a one-line edit; build-desktop-local
4 m 42 s cold, 20.6 s after a one-line edit. `cargo build --release` on the
same one-line edit takes ~137 s for the CLI, almost all of it ThinLTO.
The closed magnifier was 28px and the field that replaced it 32px, so clicking it grew the row 4px: the list below jumped and the compact device picker beside it re-centred 2px down. The field now takes the glyph's height, which is also the switch band's and the picker's.
…show

The crash-log unit tests render and append by hand, so a hook that is never
installed — or installed before the home can be resolved — still looked
covered. The new case runs this same test binary as a child with its own
`FUTURE_HOME`, panics in it, and asserts the file exists with `file:line`, the
payload, the startup step and exit code 101 — the code Windows reports as no
crash at all, and the reason the file has to be there.

Also fixes `the_crash_log_is_a_sibling_of_the_host_log`, which read the
process-global home twice: a sibling fixture publishing its own `HOME` between
the reads made it fail in the full suite while passing alone. It now holds
`HomeGuard`'s lock, the same way the other home-comparing fixtures do.
A launch that panics leaves `<root>/app/logs/crash.log`; the troubleshooting
section named only `desktop.log` and `desktop.prev.log`, so the file a reader
needs after "it never came up" was undocumented.
…ation

`make install` already builds `future` and `futureos` together — through
scripts/build/build-desktop.mjs, so they share one dependency graph and one
feature unification — but it runs the release profile, and release carries
`lto = "thin"`, which makes every edit recompile the graph under LTO.

`build-local` gives the same selection on the LTO-free `local` profile:

    cargo build --profile local -p future-cli -p futureos --bin future --bin futureos

One invocation matters for the same reason it matters in build-desktop.mjs:
selecting both packages at once keeps shared crates compiled once and keeps
feature unification aligned with the shipping build, instead of two runs that
disagree and recompile each other's dependencies.

It writes target/local/{future,futureos} only. It does not install into PREFIX,
stage the Desktop sidecar, build the frontend or bundle — `make install*` and
`make package-desktop` keep owning those, unchanged.

Measured in a fresh worktree: 327 s cold for both binaries; afterwards a
one-line CLI edit rebuilds both in 3.7-3.8 s and a one-line Desktop edit in
3.4 s.

No platform-specific syntax: the target is the same three lines on Windows,
macOS and Linux, and `profile.local` lives in the root Cargo.toml.
…ttings

The name and the icon are this machine's own record of a paired computer —
`remote_peer_set_label` writes the local credential book and never reaches
the desktop — so editing them belonged on the row that shows them, not on a
page that is otherwise entirely "read the host, write the host". There they
read as one more remote setting, and were unusable exactly when someone
renames a machine: while it is offline.

Edits now open from a pencil beside the name and save one patch with only
what changed, then re-read the list so the row shows it. The dialog is the
only place these two values are edited; the settings page's copy is gone, so
two surfaces can no longer disagree about one name.

With nothing local left on it, that page needs a live connection to be worth
opening at all, so the row's Settings button is also disabled when the
machine is not connected — with the reason on the wrapping span, the same way
the takeover hint works, because a disabled button receives no pointer events
of its own.
…keys

The shortcuts page listed seven categories in taxonomy order, three of them one
or two rows long, with the Vibe panel's thirty-odd keys in the middle of the
scroll. Sections now follow frequency instead: conversation and navigation
first, the small groups sharing a heading (panels + terminal; palette +
Settings), and the panel last, closed until asked for.

A section heading folds its rows and reports how many keys are behind it, and
how many of them have been changed — a folded section must not be able to hide
the customisation this page exists to report. A search opens every section
before it filters, so a match is never folded away and read as 'no matches'.

The cheat sheet walks the same sections, so the sheet and the page that edits it
list the keyboard in one order.
@huichen
huichen merged commit 0d52e68 into main Oct 23, 2026
10 checks passed
@huichen
huichen deleted the pr/dev-huichen branch October 23, 2026 14:56
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