Public: anyone can read this; the crew can change it.
Merge scanJsxTag and scanHtmlAttributes into one tag-attribute scanner #17088
Check · Review · Land · Live done — Landed and live in production.
scanJsxTag and scanHtmlAttributes now share one attribute scanner. tsc is clean, the highlight tests pass (87, snapshots unchanged) and scripts/gate.ts passes. I did not run scripts/design-lint.ts or the wider suite; the forge's check runs the full suite on the push.
-
Reviews
ApprovedThe merge keeps both tokenisations exactly. Space,
>,/>,=and quoted strings are shared.jsxswitches{stopping the scan, backslash escapes in strings, identifier-style names, and punctuation for stray characters. The oldscanHtmlAttributesis gone and has no other caller. There is one way to scan a tag's attributes now, and the pull adds no dependency and no door. Existing highlight tests in test/highlight.test.ts cover the JSX attribute path (Card, title, onClick), and the HTML path is covered through the snapshots, so no new test is needed for a refactor that changes no tokens.Two things I would do next:
- Add one test that pins the JSX/HTML difference directly:
a\"binside an attribute string stays one string in JSX and ends at the second quote in HTML. Today only the mergedjsxflag holds that rule. - Replace the boolean parameter with two named exports, or an options object, so call sites read
scanTagAttributes(line, i, out, { jsx: true })rather than a baretrueorfalse.
This touches only highlighter internals and no page markup, so the design principles are not engaged. Run
bun scripts/design-lint.tsbefore landing, since the pull is under src/web/. - Add one test that pins the JSX/HTML difference directly:
-
Checks
shipped production is serving it deploy 63ed874
-
History
- Direction: one tag-attribute scanner for HTML and JSX (#16802) 2e88753
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:k254qu54mj is past its budget: trevato/forge: "on production's size > a cold home answers from the picture, within a few passes over the runs" failed … (#17069) 641b5c0
- Remove "asks": what needs a person is an issue or a pull request assigned to… (#17023) 8fc1791
- A maintenance finding shows who last touched it (#17015) 4380ea9
- Every hosted forge streams its SQLite and git to a bucket continuously and restores from it (#16887) ffeeaa5
- The home's list of what needs the owner is driven by four keys: up, down, enter, back (#17061) 5668ae0
- Machines send heartbeats and new forges go to the emptiest one, from a route table the router reads (#17031) 0dc8388
- An edge-kept finding hands the owner the exact edge cache rule to paste, on the issue and on /maintenance (#17054) 471ab87
- The System screen shows each forge's snapshot stream lag, worded to pass the quiet-page rules (#17053) be89dac
- Release reused an image built from an older commit: v0.7.646 shipped without the fix it was cut for (#17028) 1aaad2d
- A lockfile reader lists every dependency a repository pins, from bun.lock and package-lock.json (#17064) c06ff90
- Flaky test: surfaces adversarial: web > N+1: needsYouCard does not cost more as agent pulls span more distinct repos (#17062) b6ae866
- A deployed forge runs its own forge repository, which follows the forge it wa… (#17060) 8c2aad9
- web ui setup: the first push to mel/proj was refused once on the check host, cause unknown (#17052) 12f4d33
- Sentinel: Crew runs in trevato/forge keep failing at the push or the sandbox (#17051) 1ab91fe
- The atlas of abstractions: the forge as one typed object graph; see each abstraction's lifecycle, merge apps (schema + data), an idea garden for demos, one shell for all apps (#16939) ff20161
- A global component registry (shadcn registry format): every app installs owned copies, updates arrive as pulls, a gallery with usage, MCP install; the app template rebuilt on it (#16959) fe0dfb9
- Fewer merge conflicts: split the files every pull touches, and show collisions in the queue (#17029) 692d75f
- Each home figure tile opens the board that draws it, at the tile's range, and shows its change against the previous period (#17017) 8a4e70e
- /flow shows the merge queue against its targets: pull check p50 under 8 min, main's full check under 30 min, 60 landed an hour, 90% of queue gates green (#17018) f6b58d2
scanJsxTag and scanHtmlAttributes now share one attribute scanner. tsc is clean, the highlight tests pass (87, snapshots unchanged) and scripts/gate.ts passes. I did not run scripts/design-lint.ts or the wider suite; the forge's check runs the full suite on the push.
What moved
- New scanner:
scanTagAttributes(line, from, out, jsx)lives in a newsrc/web/highlight/tagattrs.ts. - Shared parts: whitespace,
>and/>,=, and quoted strings are handled once. - What
jsxswitches:- A
{stops the scan so the code scanner can take the expression. - Strings honour backslash escapes.
- Attribute names are an identifier with
-and:. - Any other character is emitted as punctuation.
- In HTML mode a name is any run up to a space,
=or>.
- A
- Callers:
scanJsxTagingeneric.tsstill scans the tag name, then calls the shared scanner.scanHtmlinhtml.tscalls it directly.scanHtmlAttributesis deleted.
What I chose not to do
- I didn't change tokenisation. The two modes are still different, as before, so a merge that changed tokens would be a behaviour change.
- I added no tests, because no behaviour changed. The existing highlight tests and snapshots cover both paths, and the commit says
No test:.
How to try it
Open /docs on the preview and look at a code block containing HTML or JSX. It highlights exactly as before.
I didn't run bun scripts/similar.ts, so the pull doesn't list what I reused; the new function is the two merged.
The commit carries the Direction, No door, No test, No look and Try lines the gate asked for.
🤖 Generated with Claude Code
scanJsxTagandscanHtmlAttributesnow share one attribute scanner.tscis clean, the highlight tests pass (87, snapshots unchanged) andscripts/gate.tspasses. I did not runscripts/design-lint.tsor the wider suite; the forge's check runs the full suite on the push.What moved
scanTagAttributes(line, from, out, jsx)lives in a newsrc/web/highlight/tagattrs.ts.>and/>,=, and quoted strings are handled once.jsxswitches:{stops the scan so the code scanner can take the expression.-and:.=or>.scanJsxTagingeneric.tsstill scans the tag name, then calls the shared scanner.scanHtmlinhtml.tscalls it directly.scanHtmlAttributesis deleted.What I chose not to do
No test:.How to try it Open
/docson the preview and look at a code block containing HTML or JSX. It highlights exactly as before.I didn't run
bun scripts/similar.ts, so the pull doesn't list what I reused; the new function is the two merged.The commit carries the
Direction,No door,No test,No lookandTrylines the gate asked for.🤖 Generated with Claude Code
Closes #16802