Skip to content

Review 5394

Cindy Zhang edited this page Aug 24, 2026 · 1 revision

#5394 — fix(core): one platform detection, and Unknown is no answer either

Astro-Han (contributor, fork) · MERGED · view on GitHub

Verdict: approve · merged 2026-08-24 18:29 UTC

Head reviewed: d47945d53e40453feb31a974d56fd7b56fd516c7. No prior reviews.

Problem

On an Apple machine whose browser reports userAgentData.platform: "Unknown" — the UA-CH spec's own value for "cannot say" — every Kbd drew Ctrl and every mod hotkey listened for Ctrl. The user reads "Ctrl K", presses ⌘K, nothing happens. #5325 closed the '' spelling of the same hole; Unknown still answered "not Apple".

Solution

A client-hints platform naming nothing — '', whitespace, or Unknown (case-insensitive) — falls through to navigator.platform. The two byte-identical copies of the detection become one internal util both import.

Impact

Apple users of any app built on Astryx inside an embedder that reports Unknown client hints: the hint they read now matches the key that works. Everyone else: nothing. Six of seven client-hints branches measured identical before and after.

API

No API change. isApplePlatform is deliberately absent from utils/index.ts; both removed functions were module-private.

Theme targets

No new theme targets.

Breaking

  • API — no.
  • Visual — one path, and it is the fix: Ctrl on an Unknown-hints Apple device. Narrower, so nothing reflows.
  • Theme — no.

Performance & resources

Same single call per render/keydown, no new effect, no listeners, no layout reads. Bundle marginally smaller (one copy deleted). O(1), no perf test needed.

Visual evidence

Real Chromium, bare story iframe, frames opened with the read tool: shots-5394/BEFORE__-unknown-mac.pngCtrl K; shots-5394/AFTER__-unknown-mac.png⌘ K. The other six branches byte-identical either side.

Risk class

Low-risk — no new surface, no regression (6/7 branches identical), no perf change.

Judgement

approve — no blocking findings. Checks recorded so silence is not read as "did not look": one detection covers everything the two did, measured across all seven branches in a real engine (R1d); no other call site of the same shape exists on main (R3d); dropping the unknown guard turns 2 of 8 tests red, dropping the whole sentinel check turns 4 red; fix(core) + patch changeset is honest (R1f).

The review, as posted

Thanks — good catch on Unknown, and one detection beats two. Verified in Chrome: an Unknown-platform Mac now draws ⌘ and cmd+K fires. Merging as is.

What changed before posting

Posted as drafted.

Clone this wiki locally