Skip to content

sdk/ui: the page's navigator says the system raea's window runs on - #173

Merged
shinyobjectz merged 1 commit into
mainfrom
windows-navigator
Nov 18, 2026
Merged

shinyobjectz merged 1 commit into
mainfrom
windows-navigator

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

sdk/ui: the page's navigator says the system raea's window runs on

On every system the page's navigator said MacIntel and gave a Mac's user agent, Windows PCs included (raea 0.1.7). Excalidraw, the whiteboard, chooses ⌘ or Ctrl with /Mac|iPod|iPhone|iPad/.test(navigator.platform). On a Windows PC it therefore treated Ctrl+Z, Ctrl+C and Ctrl+V as Mac shortcuts and they did nothing.

userAgent, platform and userAgentData are now getters that read globalThis.__raea_window.os, which the window's preamble sets before the page's bundle runs (engine/page/window chrome.rs):

  • Windows: Win32 and a Windows NT user agent.
  • Linux: Linux x86_64.
  • A Mac, or no window at all (a render): the Mac's values as before.

Proof

  • test/navigator.test.ts covers each system and the regex Excalidraw uses. The sdk/ui suite passes: 69 tests, 0 failures.
  • A page bundle built from raea-feed main with this change carries the Windows user agent. In that bundle, Excalidraw's check reads the global navigator.platform inside a run-on-first-use wrapper, because the feed loads Excalidraw with await import(). It therefore runs after @raea/ui/dom-globals, the entry's first import, has installed the navigator.

Part of the Windows work after raea-feed #93. The release gate and the spec status are in raea-platform.

🤖 Generated with Claude Code

…ot a Mac's everywhere

A Windows PC's page said MacIntel and a Mac's user agent (0.1.7), so a library that picks ⌘ or Ctrl by
navigator.platform (CodeMirror's and ProseMirror's Mod-) took Ctrl+Z, Ctrl+C and Ctrl+V as a Mac's. userAgent,
platform and userAgentData now read globalThis.__raea_window.os (set by the window before the page's bundle) when
asked: Win32 and a Windows NT user agent on Windows, Linux x86_64 on Linux, the Mac's as before with no window (a
render). test/navigator.test.ts.
@shinyobjectz
shinyobjectz merged commit 7ef7acc into main Nov 18, 2026
4 checks passed
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