Skip to content

fix(desktop): report a failed remote connect once, on the machine's row - #1335

Merged
huichen merged 6 commits into
mainfrom
pr/huichen
Oct 24, 2026
Merged

huichen merged 6 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

What and why

A failed remote connect was reported twice: the page caught the rejection and
showed it under the pairing form, while the re-read wrote the same sentence into
peer.error and the machine's own row showed it again. The row is the right
place — it sits with the machine the sentence is about — so the section line now
steps aside when a row already says it. A list-read failure, which has no row,
still shows on the section line.

The branch also carries three commits whose content already landed on main
through #1334 (theme inks, the mobile folded-row touch target and its docs); the
effective diff of this PR against main is the desktop change below.

Commits

Verification

  • git diff --stat origin/main...origin/dev-huichen → 2 files, 37 insertions, 1 deletion (RemotePeersView.tsx, RemotePeersView.test.tsx)
  • npm run lint in desktop/ → eslint 0 errors (one pre-existing jsdoc/no-multi-asterisks warning in the untouched recentOrder.ts), tsc --noEmit clean
  • npx vitest run src/features/remote-peer/RemotePeersView.test.tsx → 37 passed, including the new "shows a failed connect once, on the machine's own row"

Notes

The behaviour change is presentational only: the red line under the pairing form
is suppressed while a peer row already carries the same message.

`bg-<family>-soft text-<family>` is how the app draws chips, callouts and error
rows (47 call sites), but the palette floors only checked each ink against
`surface`. On its own tint the pair measured 3.43:1 (dracula dark danger) to
4.49:1 (nord light warning) in 49 of 140 renditions, so a third of the themes
shipped small text below AA wherever it mattered most.

Each ink now clears 4.5:1 on its soft fill, with hue and saturation fixed: the
ink moved by at most 4% HLS lightness (e.g. futureos danger #dc2626 -> #d92323),
and where that was not enough the tint moved instead (its own value, never an
identity colour; e.g. dracula's danger-soft #5d303a -> #402128). Floors cover the
five soft pairs so the contract cannot drift back, and the regenerated
`[data-palette]` rules plus the `@theme` mirror carry the values.

Three call sites painted a semantic ink straight on a dim shared surface, which
no palette change can fix because that surface is shared by every family. They
now sit on the family's own soft fill, which is the pair the contract covers:
the peers list's held/error lines, the rail's "show more", and the settings
dialog's test-build hint. A rendered sweep of 42 desktop scenes reports no
semantic ink below AA; the only remaining sub-AA text is `ink-muted`, which the
palette holds at a 3:1 de-emphasis floor on purpose.
`hitSlop` is how a 26px chip and a 20px step row reach the 44pt platform
minimum, but `react-native-web` does not implement it, so neither a capture nor
the harness's `TOUCH` probe can see the result — the previous assertions compared
each component against a formula duplicated at the call site, which cannot catch
a wrong drawn height.

The two heights and the slop derived from them now live in one module with no
imports beyond the layout tokens, `slopToTouchTarget` derives any folded control's
slop from `layout.touchTarget` (rounding up, so an odd gap cannot land at 43), and
one test holds both rows to the floor. The screenshot guide says why a capture
cannot judge this and what to do instead of widening the drawn box.

The dark-window theme picker also gets its own `ready`: its assertion needs the
`dark` class that `lib/theme.ts` applies after reading the pinned preference, so
readiness now includes it instead of relying on a 1600ms wait that a cold bundle
loses. The assertion still fails in a light window (checked by booting one).

Verified: mobile tsc + eslint clean, 53 jest suites / 800 tests pass, and
`settings-themes-dark` captures green with its `ready` firing at 1.5s.
`scenarios.d/` only exists once someone writes a fragment, so both guides named a
glob that `make check-docs` resolves in a clean checkout and failed on. The
directory now carries a `.gitkeep`, the guides point at the directory, and the
gitignored audit fragments are explained where the mechanism is described.
A connect that could not reach the other computer rejected *and* landed in
`peer.error` on the re-read, so the section line under the pairing form and
the row under the machine printed the same sentence one above the other.
The row is where it belongs — it sits with the machine the sentence is
about — so the section line steps aside while a row already says it, and a
list-read failure (which has no row) still shows there.
@huichen huichen changed the title fix(desktop): say a failed connect once, on the machine's own row fix(desktop): report a failed remote connect once, on the machine's row Oct 24, 2026
@huichen
huichen enabled auto-merge (squash) October 24, 2026 05:17
@huichen
huichen merged commit 079194f into main Oct 24, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch October 24, 2026 05:21
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