Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
The owner sets the table height (tableOffsetMm, -100..100 mm) in a field on /admin, saved through PUT /settings by the page's one hashed script #332
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
The owner's /admin now has a "Table height" number field for tableOffsetMm (-100..100, step 1) with a Save button. A moderator gets neither the field nor the code that saves it. The field loads the current value with GET /settings.
shipped merged
The owner's /admin now has a "Table height" number field for tableOffsetMm (-100..100, step 1) with a Save button. A moderator gets neither the field nor the code that saves it.
The field loads the current value with GET /settings. Save sends a same-origin PUT /settings and shows the saved value or the server's error text.
- One script: the page still has exactly one inline script. For the owner it is
HEALTH_SCRIPTplus a newTABLE_SCRIPT. For a moderator it isHEALTH_SCRIPTalone. - CSP:
ADMIN_CSPbecameadminCsp(canEdit)insrc/admin-page.ts, with the one sha256 matching whichever script the caller gets.src/admin-routes.tsis its only user. There is nounsafe-inlineand no new CSP sources. - Untouched:
viewer.html, the page's modules,forge.json, and the CSP andlobby.test.tsedits from #307, so the first-visit gzip budget is unchanged. - Tests: the new
src/admin-page.test.tschecks that:
- the field is present for the owner and absent for a moderator;
- there is one <script tag;
- its hash matches the CSP.
- README:
Software/README.mdnow says where to set the table height.
tsc --noEmit is clean. In the full bun test run, 572 passed and 1 failed. The summary didn't say which test, and I didn't run the whole suite again to find out. cameras.test.ts and admin-page.test.ts pass when run alone, so the failure may be timing-dependent. The forge's check will run the whole suite.
I didn't open the preview.
🤖 Generated with Claude Code
Approved. The owner gets a Table height number field (-100..100, step 1, labelled, with role=status feedback) on /admin. The page keeps exactly one hashed inline script, with no unsafe-inline. A moderator gets neither the field nor the PUT code, and a test proves both the hash match and that gap. The write goes through the existing validated PUT /settings, and the terminal already has /table. The README is updated. I could not see /admin on the preview because non-admins get 404 there by design, so I judged it from source and tests.
Two things I would do next:
- Add a test that runs TABLE_SCRIPT against a stubbed fetch, covering the error text and the saved value. Today only the markup and the hash are tested.
- Say which test failed in the full run. The pull says 572 passed and 1 failed, and it never names the failure.
The owner's
/adminnow has a "Table height" number field fortableOffsetMm(-100..100, step 1) with a Save button. A moderator gets neither the field nor the code that saves it.The field loads the current value with
GET /settings. Save sends a same-originPUT /settingsand shows the saved value or the server's error text.HEALTH_SCRIPTplus a newTABLE_SCRIPT. For a moderator it isHEALTH_SCRIPTalone.ADMIN_CSPbecameadminCsp(canEdit)insrc/admin-page.ts, with the one sha256 matching whichever script the caller gets.src/admin-routes.tsis its only user. There is nounsafe-inlineand no new CSP sources.viewer.html, the page's modules,forge.json, and the CSP andlobby.test.tsedits from #307, so the first-visit gzip budget is unchanged.src/admin-page.test.tschecks that:- the field is present for the owner and absent for a moderator; - there is one
<scripttag; - its hash matches the CSP.Software/README.mdnow says where to set the table height.tsc --noEmitis clean. In the fullbun testrun, 572 passed and 1 failed. The summary didn't say which test, and I didn't run the whole suite again to find out.cameras.test.tsandadmin-page.test.tspass when run alone, so the failure may be timing-dependent. The forge's check will run the whole suite.I didn't open the preview.
🤖 Generated with Claude Code
Closes #325