Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #315 +/- ##
==========================================
+ Coverage 88.21% 88.31% +0.10%
==========================================
Files 227 238 +11
Lines 36147 38047 +1900
Branches 2324 2538 +214
==========================================
+ Hits 31886 33603 +1717
- Misses 4257 4439 +182
- Partials 4 5 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
geonnave
force-pushed
the
site-editor
branch
2 times, most recently
from
October 2, 2026 11:14
eb01952 to
0b52a93
Compare
This was referenced Oct 2, 2026
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
… page Any web page in the browser can send requests to 127.0.0.1 with a valid Host header, and behind a permissive CORS policy read the replies, so the Host check alone let it save site.toml; a server bound beyond loopback took any Host. The peer address, Origin and Sec-Fetch-Site are checked. AI-assisted: Claude Opus 5.5
…ng tables A patched file is read back and must give the model that was sent, so a layout the patcher does not follow is refused rather than written. AI-assisted: Claude Opus 5.5
…adable files AI-assisted: Claude Opus 5.5
AI-assisted: Claude Opus 5.5
…e saving AI-assisted: Claude Opus 5.5
This was referenced Oct 15, 2026
This branch has not been 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.
A site is set up today by writing
site.tomlby hand and checking it by starting a controller and looking at the console. This adds a small editor for a site pack, launched before LH2 calibration:dotbot site new NAME [--field 2m]writes the pack into the nearest of the two site homes:sites/NAME/beside the project'sdotbot.tomlwhen one is in use, else~/.dotbot/sites/NAME/, sodotbot site use NAMEfinds it at once. It starts as the siteconfig initwrites (a field with floor round it and a staging strip below) and opens the editor on it. It is not made the active site.dotbot site newchecks the name (16 ASCII characters, as a calibration push needs; not already a known site) and that the page is built and the port free before it writes anything.dotbot site edit [SITE]opens the editor on a pack, by name (default: the active site, wherever its pack is) or by a pack folder's path.Both start a FastAPI app on
127.0.0.1(free port by default,--portto pick one; it answers only a client on this machine (the peer address is checked, not just theHostheader), addressing it as127.0.0.1orlocalhost, from the editor's own page or from no page at all (curl): a request whoseOriginorSec-Fetch-Sitenames another site gets a 403, so neither a DNS-rebinding page nor a page on another site open in the same browser can read or save the pack) with no controller, broker or robot, print the URL, open a browser throughwebbrowser(soBROWSERis honoured) unless--headless, and stop on Ctrl-C or the page's Done button.The file stays the first-class surface. The page never sees TOML:
GET /api/sitereturns a model plus a revision (SHA-256 of the file bytes), andPUTsends the model with the revision it started from. The server parses the file with tomlkit and assigns only the keys that changed, so comments, blank lines, key order and keys the editor does not model ([connection]) survive; a rename keeps the area's place and comment, a new area follows the file's own style (table or inline), and a save with nothing changed writes nothing. The result is validated asSiteSection(422 and the file untouched on failure), written to a sibling temp file and renamed over. A file changed on disk since the page loaded it gets a 409 and the page offers Reload, so the editor and vim can be used side by side; saves are serialised, so two tabs on one revision get one 200 and one 409. A symlinkedsite.tomlis written through to its target. Every patched file is read back and must give the model that was sent, so a layout the patcher cannot follow is refused (422) rather than written: areas split by another table, written as dotted keys or as an inlineareas = {...}, or a comment with a line break in it. Deleting an area keeps the full-line comments heading the next table, and a new area goes above them.POST /api/previewbacks a "View TOML" button showing the file as Save would write it.The page is a second vite entry of
console-web(site-editor.html,src/siteEditor/), built into the samedist/and so shipped in the wheel with the console. It reuses the console'sframe.ts,grid.ts(grid, rulers),zoom.tsgeometry,areaColor.tsandtokens.css, so a site looks the same as on the live map. Areas are drawn with the Area tool or "+ Add area", moved and resized with eight handles, snapped to 50 mm by default (a snap menu offers off/10/50/100/250/500 mm; Alt drags free). The inspector's numbers are what Save writes. Live checks mirror the schema (at most one field, unique names, no comma, which the area resolver reads as anx,y,w,hliteral) and warn about an area outside the extent, a field over 5 m (asconfig initdoes), and aa+barea that is not the bounding box ofaandb. When the site has calibration files (in the pack or under~/.dotbot/calibrations/<site>/), a note says so and changing the anchor or the extent asks for confirmation, namingcalibrate-lh2 collectandreframe; area edits never ask. Wall, Obstacle and Charger are shown disabled until their tables exist insite.toml.Plan: rendered copy https://claude.ai/artifact/LHUXjhx1nMWifC2oGRBayt, source https://github.com/DotBots/dotbot-workspace/blob/main/plans/site-editor/plan.html (both internal).
Validation: pytest for the round trip (byte-identical write-back of unchanged models on table-style, inline-style and commented-value files; move, add, delete, rename, comment edit, schema refusals) and the server (409, 422, no-op save, atomic write, preview) and the two commands (full pytest 1771 passed); vitest for snapping/resizing, checks, the API client and the editor (drag, save with the loaded revision, Reload on 409, the calibration confirm, Save blocked by a failing check);
npm run lint,typecheckandbuild; wheel containsdist/site-editor.htmland its assets. Also: the loopback, Origin and Sec-Fetch-Site guard, concurrent saves, a symlinked file, refused layouts and comment injection, comments heading tables kept on delete and add, renames from any header spelling and a swap,site newwriting nothing when it cannot serve; vitest 843 passed, including a click that selects an off-grid area without snapping it. Smoked headless against a copy of a real two-by-four-metre pack: dragging an area by 150 mm and saving changed exactly one number in the file, every comment kept. Nothing here needs hardware.dotbot/console-web/src/siteEditor/SiteEditor.tsxdotbot/tests/test_site_editor.pydotbot/console-web/src/siteEditor/Canvas.tsxdotbot/tests/test_site_toml.pydotbot/site_toml.pydotbot/console-web/src/siteEditor/Inspector.tsxdotbot/site_editor.pydotbot/console-web/src/siteEditor/edit.tsdotbot/cli/site_cmd.pydotbot/console-web/src/siteEditor/edit.test.tsdotbot/console-web/src/siteEditor/siteEditor.test.tsxdotbot/console-web/src/siteEditor/api.tsdotbot/console-web/src/siteEditor/api.test.tsdotbot/console-web/src/siteEditor/types.tssite-editor.html,vite.config.ts,main.tsx,main.pyDocs (
doc/cli/, README) follow in this PR after review. Stacked on it, in merge order: #326 (place a spin calibration), #327 (undo, nudges, backdrops), #328 (walls and obstacles), #329 (objects), #330 (the editor as a console panel).