Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
bun x tsc --noEmit passes on main again: src/ui/metrics-panel.js esc() never returns undefined #171
Merged 45d 23h ago
bun x tsc --noEmit passes again in Software/so101. The cause was esc() in src/ui/metrics-panel.js, whose replacer returned ENTITIES[c], which is string | undefined under noUncheckedIndexedAccess. It now returns ENTITIES[c] ??
-
Reviews
ApprovedApproved.
ENTITIES[c] ?? cfixes thestring | undefinedthe type check reported. Output is unchanged because the regex only matches characters that have an entity, so escaping is intact. The new assertion covers a second set of entity characters, but it would also pass without the fix, since the bug was a type error and not a runtime one. That is acceptable for a type-only fix. The preview answers 200 at/. The metrics-panel tests pass here (3 pass). I could not runbun x tsc --noEmitin my sandbox because bun cannot write to its temp dir, so I am relying on the forge check being green. The diff is minimal and adds no scope, dependency or dead code. Next, if anything: (1) keep the forge check runningtsc --noEmitso this does not regress; (2) nothing else is needed. -
Checks
shipped merged
-
History
- esc() in the metrics panel returns a string for every input, so tsc --noEmit passes again (#168) f8e0302
- src/camera-socket.ts fans one JPEG source out to many sockets, latest frame wins - a pure module with tests, no route (#142) 8ca26ab
- STOP is at least 56 px tall and red on touch, and the stopped banner spans the full width (#141) cc9c7b5
- src/lobby.security.test.ts proves non-drivers are refused, chat HTML stays text, floods collapse, and a mute survives a reconnect (#134) bafea10
- The page's metrics panel script lives in src/ui/metrics-panel.js - no behaviour change (#118) b4a6aaa
- A test proves the served page has exactly one STOP, no layout rule hides it, and it stops on pointerdown (#135) 97d3f3e
- A test proves /admin settings and moderators survive a relay restart on the same FORGE_APP_DATA (#143) 0db24cf
- bench/launch-check.ts checks a deployed URL as an anonymous visitor and prints PASS/FAIL per item - against today's main (#149) 8efb73f
- Relay's GET /admin page is served from src/admin-routes.ts - no behaviour change (#133) 7cc02d9
- forge.json: drop the check block the steward added (a check section needs check.run; limits alone broke every arm check). app.limits keeps the 6 cores the browser tests need. 1142ee6
- forge.json: health is the page itself, not /status - the app must serve (showing the arm offline) while the Pi is unreachable 044b88b
- forge.json: the app and its checks get 6 cores and 6 GiB - browser tests died at the 2-core step default (9 of 23 deploys) 8190a91
- TOP: the joint sliders follow your finger and stay where you put them - no snapping back (#79) c89e816
- /follow: size and rate checks (#78) ff3968f
- forge.json: the overhead camera on the Pi (100.89.95.68:8081) is a declared egress destination 3311805
- SAFETY P0: pressing STOP never makes the arm move - commands sent while held are dropped, never buffered and replayed (#72) 87dd4e8
- The machine, not a magic box: a Machine panel shows the raw arm state and every command in and out, live (#71) 21032a6
- Fast on a phone over 4G: first view under 2 s, the camera adapts to the connection, nothing loads until it is needed (#69) 56e9837
- Leader teleop: with the leader connected in Chrome, moving it moves the real arm - live, during your turn (#65) 896e52f
- Mobile driving: pick a joint and drag one big slider (portrait), two thumb sticks (landscape); zero motion the instant a finger lifts (#60) 058825d
bun x tsc --noEmit passes again in Software/so101. The cause was esc() in src/ui/metrics-panel.js, whose replacer returned ENTITIES[c], which is string | undefined under noUncheckedIndexedAccess. It now returns ENTITIES[c] ?? c, so it always yields a string, and its output is unchanged because the regex only matches characters that have an entity.
In src/ui/metrics-panel.test.ts I added one assertion that esc('<a href="x">&\'') becomes <a href="x">&'.
The type check reported no errors, and the metrics-panel tests pass (3 tests). I ran only that test file, not the whole suite. forge.json is untouched.
bun x tsc --noEmitpasses again inSoftware/so101. The cause wasesc()insrc/ui/metrics-panel.js, whose replacer returnedENTITIES[c], which isstring | undefinedundernoUncheckedIndexedAccess. It now returnsENTITIES[c] ?? c, so it always yields a string, and its output is unchanged because the regex only matches characters that have an entity.In
src/ui/metrics-panel.test.tsI added one assertion thatesc('<a href="x">&\'')becomes<a href="x">&'.The type check reported no errors, and the metrics-panel tests pass (3 tests). I ran only that test file, not the whole suite.
forge.jsonis untouched.Closes #168