Repository navigation
Conversation
…sk's monitors (experimental, off by default) A linked ClawBox's desktop shown in a tab of another box's kiosk laid itself out from GET /setup-api/monitors of the box that serves it: the wrong box's monitors, or available:false, so it was stretched over the kiosk's whole row as one screen. A second experiment, switched on in Settings -> System update -> Advanced options (box preference ui_linked_boxes_screens, off by default, built like ui_linked_boxes: event, extension storage, ten languages), lets the kiosk extension (1.8.0) carry the kiosk's own monitors to the page: - the kiosk's own desktop script reads its box's /setup-api/monitors (same origin, owner's session) when the worker asks; - a page of another box asks the worker every 3 s while it is shown; the worker answers only a page on the origin of one of the owner's linked boxes, and hands over geometry only, rebuilt value by value (connector names for ids, never make, model or serial); - the page reads it from <html data-clawbox-viewer-screens>, validated as strictly as recallMonitorStatus and more, rebuilt, and lays itself out with the same screensFromStatus rule; it reads its own box's monitors not at all. Settings -> Monitors on a box shown that way draws the kiosk's monitors read-only under one line saying they are arranged on the box that runs the screen, instead of this box's own outputs. Off, a box's own kiosk desktop, a desktop in an ordinary browser tab, Jetson boxes and /updating's recall are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ing, the page's validator refuses a repeated monitor id, one flag saver Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TASK-2771 — a linked box's desktop in the kiosk is laid out by the kiosk's monitors
Draft. Experimental, off by default. Needs a real two-monitor check (steps below) before it leaves draft.
The problem
On an x64 ClawBox whose screen is the "ClawBox Desktop" session with two monitors, Ctrl+Shift+2 (Linked ClawBoxes) shows the other box's desktop in a tab of the kiosk Chrome — stretched over both monitors as ONE screen. The desktop lays itself out from
GET /setup-api/monitorsof the box that serves the page (use-monitor-layout.ts→desktop-screens.ts); inside another box's kiosk that answer is the wrong box's monitors, oravailable: false.What this does
A second switch, Settings → System update → Advanced options → "Linked ClawBoxes use this ClawBox's monitors (experimental)" (box preference
ui_linked_boxes_screens, default off, built exactly likeui_linked_boxes: preference,clawbox:linked-boxes-screens-flagevent, extension storage, all ten languages, i18n scan clean). It does nothing unless Linked ClawBoxes is on as well.With it on, the kiosk extension (1.8.0) carries the kiosk's own monitors to the linked box's page:
/setup-api/monitors(same origin, owner's session) when the worker asks (readMonitors). The second switch is read in the same request as the first.viewerScreens) the moment it is shown and every 3 s while it stays shown (one read at a time, nothing while hidden) and writes the answer into<html data-clawbox-viewer-screens>.sender.url) is on the origin of one of the owner's linked boxes in its session-bound copy of the list, only while the second switch is on, and nothing if the list is forgotten, runs out, or drops that box while the desktop reads. It hands over geometry only, rebuilt value by value (cleanScreens): the connector name as id (a monitor's own id carries make, model and serial), where each monitor that is on sits and how big, which is main, the row's size, mirror. Frames, the extension's own pages, the kiosk's own origins and other sites get nothing.parseViewerScreens,useViewerMonitors) validates the mark at least as strictly asrecallMonitorStatus(plus: ≤ 8 KB, ≤ 16 monitors, printable ids ≤ 64 characters and no repeats, every number finite and bounded) and rebuilds it; a mark that fails is no mark. A valid one goes through the samescreensFromStatusrule as the box's own layout — windows maximise/snap per monitor, shelf/chat/icons/notices/modal scrims on the main monitor, a window that is not laid over the kiosk's whole row is one screen — re-applied on every change and resize, in adisplay-mode: browserwindow too. The page then never reads its own box's monitors; a kiosk with no layout is one screen, not the box's own.ViewedMonitorsinstead of the panel: the kiosk's monitors, read-only (connector, size, main), under one line saying they are arranged in Settings → Monitors on the ClawBox that runs this screen. The box's own outputs are not read, drawn or changeable there (the panel is not mounted: no poll, no brightness read, no Apply).Unchanged: switch off (all pages), a box's own kiosk desktop, a desktop in an ordinary browser tab, Jetson boxes,
/updating(itsrecallignores the mark). Docs:docs/agents/desktop.md,docs/agents/settings.md,docs-site/whats-new.mdx(4.3 "Smaller things").Tests and checks run (on
4065c82ef)node_modules/.bin/vitest run --config vitest.config.ts kiosk-extension use-monitor-layout desktop-screens box-switcher monitors-panel settings-update-section settings-monitors-row desktop-linked-boxes-flag i18n-sweep-catalogue translations visible-interval public-hygiene shell-regex-hygiene --maxWorkers=2→ 18 files, 836 tests passed.readMonitors; worker side: gate by origin /sender.url/ switch / list gone or out of date / list forgotten or box removed mid-read, geometry-only output, bad numbers, no desktop tab, deadline, worker→page round trip), extension source pins + RELEASES1.8.0,parseViewerScreenstable + hook (own→viewed→own, no own read, one screen cases,/updating's recall), Settings → Monitors viewed branch, the new switch.origin/betasources:workspaces.js→ 14 tests fail,background.js→ 6,SettingsApp.tsx→ 3; green with the change.eslinton every touched file: 0 errors (6 warnings already on beta).tsc: the whole-project run runs out of memory on this build box (3 GiB heap). Atscover every touched.ts/.tsxfile and what they import has no error in them; its only errors are 6 that exist on beta (node:sqlite×5,js-yamltypes ×1).bun run i18n:scan→ 0 missing / 0 identical / 0 untranslated;bun run gen:translationsregenerated the chunks (2 lines per locale).NOT verified
chrome.chrome.tabs.query({ windowType: "normal" })finds the desktop in that session.offset.jsmoves the page's fixed boxes down) is not compensated: per-monitor maximised windows may sit 40 px low/overhang the bottom, exactly as one-screen maximised windows already do there.tscwere not run.Manual check (needs two monitors on box A; any second box B on this branch, reachable from A)
</>button).🤖 Generated with Claude Code