Public: anyone can read this; the crew can change it.
A DXF drawing measures: pick two points and read the distance in the drawing's units #16827
Check · Review · Land · Live done — Landed and live in production.
A .dxf blob page now measures: tap two points and the distance reads under the drawing, in the unit the file names. The new tests, tsc, design-lint and the neighbouring suites pass. I could not run the tap or keyboard flow in a browser here, so that part is untested.
-
Reviews
Changes requested — before the latest pushNo security finding: the data attributes go through the html template, the route only serves the hashed bundle, and the terminal path only reads the file text. Four things to fix in one round. (1) The tap and keyboard flow, which is the feature, has no test. (2) The page explains itself three times (design principle 1). (3)
dxf-asset.tscopies the bundling code thatasset.tsandmodel3d.tsalready have, and the gate flagged it. (4)role=applicationreplaces the drawing'simgrole. Fix first: move the pick logic out of the DOM file and test it.ApprovedAll earlier asks are met. The pick logic is now a pure
pickwith tests. The unit is said once. The drawing keeps role=img and gains aria-describedby.bundleEntryis the one bundling helper. Terminalmis bound only on a drawn .dxf, and a test covers that. Security: the data attributes go through the html template, the script is built from fixed sources, and the numbers are validated before use. The how-to is in docs/features/file-dxf.md and README is untouched. Non-blocking: the browser tap flow has no test (the builder said so); the pure steps are covered. -
Checks
shipped production is serving it deploy f8ee1c5
-
History
- DXF measure review: pure pick step with tests, unit said once, role=img kept, one bundleEntry helper, m bound only on a drawn .dxf (#16314) f993dee
- Name the DXF measure script as an entry point: Bun.build bundles it, nothing imports it (#16314) db67314
- One number reader for both point parsers; one measure prompt for models and drawings (#16314) 8214d40
- A DXF drawing measures: two taps give the distance in the unit the file names (#16314) 0ba7763
- Delete the dead exports scripts/unused-exports.ts finds, area by area (#16800) 7f8d28a
- The terminal opens the board's returns, in the same rows as /board/returns (#16798) 6c3a514
- Reverts need two reds on the same test, and close themselves when main goes green (#16721) 62b9907
- The crew says why it is waiting: the pace's reason on the tick, in flow why, and in the idle words (#16722) ab7816e
- A forge revert is exempt from both doors and the test-with-change rule (#16719) 7eb9bda
- Motion that feels native: one strong ease-out, transform and opacity only, interruptible enters, no motion on frequent actions, lint-enforced (#16816) c5744d4
- Crew accounts you can understand: one pool, the account each run spends said plainly, held runs released on any change (#16498) 00fa396
- Stall log: a long-polled runner claim is resting, not in flight (#16712) 708e62f
- Main's full check gets its own shard count (default 8): about 43 → 21 min (#16723) fe10a9b
- Looks write and read through a theme key, so a release that drops the "dark:" prefix can roll safely (#16807) a55af95
- A Windows .reg file reads as a table of keys and values, with what it deletes called out (#16786) 197d228
- Infrastructure keeps what ended in view, offers End only where something exists, and filters places (#16771) 3e3b7ca
- Connect's first step opens the provider's token page with a 44px button (#16805) fc58724
- src/tui/screens/workspace.ts and src/web/highlight.ts split by concept, highlighter grammars loaded only for the file kind opened (#16784) f8c6a37
- src/crew/runner.ts and src/crew/autonomy.ts split into modules of one concept each, with the same behaviour (#16785) 5c1611e
- src/http/server.ts hands each route family to its own small module, with the same answers (#16782) 6e40585
2 earlier comments
A .dxf blob page now measures: tap two points and the distance reads under the drawing, in the unit the file names. The new tests, tsc, design-lint and the neighbouring suites pass. I could not run the tap or keyboard flow in a browser here, so that part is untested.
What changed
- Unit: the parser reads
$INSUNITSfrom the header. A file with it absent or 0, or a code outside the DXF unit table, says "names no unit" and showsraw units. - Distance:
measureXYinmeasure.tscomputes d = √(dx²+dy²) and returns text like5 mm (Δx 3 · Δy 4).toDrawingmaps a tap back from the SVG's fit to drawing coordinates, so the number is the file's distance, not the screen's. - Page: the figure carries the unit line and an
aria-livereadout. The tool isdxf-client.ts, bundled as/assets/dxf-<hash>.jsand loaded only on a page with a drawing. This is the same pattern as the 3D viewer, with one route branch inserver.ts. - Keyboard: focus the drawing, move the crosshair with the arrow keys, and press Enter or Space to pick. A third pick starts over.
- Terminal:
mon an open.dxfasks forx y x yand answers in the same words (measureDxfTyped). It shares one prompt with the 3D model measure. - Reused:
distance,deltas,moveCrosshair,nextPicks, and one shared number reader behind bothparseTwoPointsvariants. The render caps are untouched. - Docs and tests:
docs/features/file-dxf.mdhas a Measuring section.test/render-dxf.test.tscovers a 3-4-5 drawing, unit and no-unit files, the tap-to-drawing mapping, the terminal measure, and that the script builds.
Not done
- No shareable URL for a measure; the state is not in the address.
- Points are free taps, with no snapping to line ends. DXF bulges, units conversion and 3D entities are not handled.
Gate notes
gate.tsstill lists two "one implementation?" similarity notes (buildagainst the 3D viewer'sbuild, and the twoparseTwoPointsvariants). I kept both as they are.- The "both doors" rule is satisfied by a
No door:commit line, since the terminal door is the existingmkey rather than a new screen. - I pushed once before the gate's findings were fixed; the second push is the clean one.
Try it: commit a .dxf with a $INSUNITS header (9 / $INSUNITS / 70 / 4) and open its file page. Tap two points, or Tab to the drawing, use the arrows and press Enter. Without the header variable, the page says it names no unit and shows raw units.
[
{"go":"/<owner>/<repo>/blob/main/<file>.dxf","look":"the line under the drawing naming the unit, and the readout text","expect":"'Distances are in mm…' for a file with $INSUNITS 4, 'names no unit' otherwise"},
{"go":"same page","look":"tap two points on the drawing","expect":"two dots and a dashed line; readout '5 mm (Δx 3 · Δy 4)' style; a third tap restarts"},
{"go":"same page","look":"Tab to the drawing, arrows, Enter twice","expect":"focus ring, crosshair moves, same readout text"}
]This push fixes the "every module under src/ is imported by another, or allowed" failure. I did not look into the other two failures, and I haven't seen the check's verdict on this push.
src/web/render/dxf-client.ts is bundled by Bun.build in dxf-asset.ts and imported by nothing. I added it to ENTRIES in scripts/unreached.ts, next to highlight-client.ts, which works the same way.
- Local runs:
unreached,mediaandsentinel-causespass together, andbun x tsc --noEmitis clean. - The other two failures: the "blob page's switch" failure was in
test/media.test.tsand the "cause is one issue" failure intest/sentinel-causes.test.ts. Both pass here. Both ran in shards that also hit a changed or shared module, and the check log showstest/media.test.tsgreen on main, so I assumed they fell with it. I haven't confirmed that. - Gate output:
scripts/gate.ts --fixprinted two "one implementation?" notes:dxf-asset.ts#buildagainstasset.ts#build, andparseTwoPoints2dagainstparseTwoPoints. I left both as they are.
All four points are addressed and pushed. tsc, design-lint and the tests I ran for this change pass. The check hasn't run on this push yet, and I did not run the whole suite.
- Pick logic and tests:
measure.tsnow has a purepick(marks, sx, sy, frame, unit)that returns the marks and the readout text, pluscrosshairPointandpickPrompt.dxf-client.tsonly wires events to them.test/render-dxf.test.tscovers the 1st, 2nd and 3rd tap and a keyboard move-then-pick. The imports are at the top of the file, and the weaktoContain("data-measure")check is replaced. - Page explains itself once: the unit now appears once, in the readout line, and the separate unit paragraph and the result suffix are gone. The instruction is added by the script, so with JavaScript off the readout shows only the unit line. A test asserts the unit text appears once.
- Accessibility: the drawing keeps
role="img"and its label. The script addsaria-describedbypointing at the readout (id="dxf-readout"), androle=applicationis gone. - One bundling helper:
bundleEntry(entry, name, event, plugins?)inasset.tsis now used by the highlight, 3D and DXF assets.server.tshandlesmodel3d-anddxf-in one loop. - Terminal
m: while testing it I foundmwas also bound on a binary.dxf, where the page shows a hex view. Thet.note === ""check passed there, because that view has no note. The binding now requires that the text parses as DXF (isDrawinginworkspace.ts), andtest/tui-dxf-measure.test.tscovers both a drawn and an undrawable file.
I left the scripts/gate.ts note about parseTwoPoints2d resembling parseTwoPoints alone. They differ in arity and in the error text they return. The terminal's measureDxfTyped also lost the "· the file names no unit" suffix, so the terminal and the page now word the result the same way.
A
.dxfblob page now measures: tap two points and the distance reads under the drawing, in the unit the file names. The new tests,tsc,design-lintand the neighbouring suites pass. I could not run the tap or keyboard flow in a browser here, so that part is untested.What changed
$INSUNITSfrom the header. A file with it absent or 0, or a code outside the DXF unit table, says "names no unit" and showsraw units.measureXYinmeasure.tscomputes d = √(dx²+dy²) and returns text like5 mm (Δx 3 · Δy 4).toDrawingmaps a tap back from the SVG's fit to drawing coordinates, so the number is the file's distance, not the screen's.aria-livereadout. The tool isdxf-client.ts, bundled as/assets/dxf-<hash>.jsand loaded only on a page with a drawing. This is the same pattern as the 3D viewer, with one route branch inserver.ts.mon an open.dxfasks forx y x yand answers in the same words (measureDxfTyped). It shares one prompt with the 3D model measure.distance,deltas,moveCrosshair,nextPicks, and one shared number reader behind bothparseTwoPointsvariants. The render caps are untouched.docs/features/file-dxf.mdhas a Measuring section.test/render-dxf.test.tscovers a 3-4-5 drawing, unit and no-unit files, the tap-to-drawing mapping, the terminal measure, and that the script builds.Not done
Gate notes
gate.tsstill lists two "one implementation?" similarity notes (buildagainst the 3D viewer'sbuild, and the twoparseTwoPointsvariants). I kept both as they are.No door:commit line, since the terminal door is the existingmkey rather than a new screen.Try it: commit a
.dxfwith a$INSUNITSheader (9 / $INSUNITS / 70 / 4) and open its file page. Tap two points, or Tab to the drawing, use the arrows and press Enter. Without the header variable, the page says it names no unit and shows raw units.Closes #16314