Repository navigation
Let the design lint check one section of a running app for crowded rows, cramped help text, loud notes and small tap targets - #4138
Merged
Conversation
…ng, flush help copy, loud notes and small targets (GST-1741 PR 1) Adds an opt-in, render-only app profile to gstack-design-lint: its own scheduler (lib/design-lint/render-app.ts) and probes (lib/design-lint/render-probe-app.ts on window.__gstackLintApp), five app-only rules at ask (row-crowding, copy-flush-under-list, note-in-row-weight, small-hit-area, section-overflow), --within matched through open shadow roots, readiness and state assertions, a LINT_APP verdict with exit 0 clean / 1 open / 4 incomplete / 3 usage, --waivers, URL redaction everywhere and private trace files for probe errors. Behavior change: --url with no browser now exits 4 with RENDER_UNAVAILABLE under every scope. Page and component output is otherwise byte-identical to e58be61 (test/design-lint-scope-guard.test.ts). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…cases (GST-1741 PR 1) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…noise never fires a threshold (GST-1741 PR 1) Measured against six real qm builds from the probe: the shipped access list (flex rows, no border) slipped past row-crowding, and 8px padding read as 7.99px and fired. Rows that set an avatar, text and control side by side now count as a list of rows; thresholds ignore the last 0.05px. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Redact secret-looking #fragment parameters like query ones; keep two --url states whose redacted names match as two states (name~2) and refuse only the same URL twice; a trace that cannot be written keeps the state PROBE_ERROR instead of crashing to exit 1; a section selector the browser refuses no longer holds the soft readiness wait, and a NOT_READY without --wait-for names the section. Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/specialist-batched#2 reader=testing Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…41 PR 1) Names for --url states are given out from the set of names already used, so /p, /p#x and /p~2 measure as three states. Review-loop exception a-7c954c6c661f. Review-Finding: p2/outside-voice#1 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
2 tasks done
2 tasks done
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.
gstack's design lint can now measure one section of a running app screen (
gstack-design-lint --scope app) and flag the spacing mistakes agents make when they build new UI: crowded two-line rows, help text jammed under a list, status notes as loud as the names beside them, and tap targets under 32px on phones. It serves the README's promise of "a designer who catches AI slop" during Build and Review, not only on finished pages.What changed
gstack-design-lint --scope appis a new, opt-in profile that measures one section of a running app screen and says whether its rows, help copy, notes and row controls are spaced right:ask:row-crowding,copy-flush-under-list,note-in-row-weight,small-hit-area(375px),section-overflow. They run only under--scope app; page and component output and exit codes are byte-identical to main (hashed golden of 14 runs).lib/design-lint/render-app.ts, probes inrender-probe-app.tsonwindow.__gstackLintApp): one render per state, measured at each--viewport(default 1440x900 and 375x812), through open, slotted and nested shadow roots, confined to--within.cleanexit 0 only when every state × viewport was measured;openexit 1 for any unwaived app finding, whatever its tier;incompleteexit 4 with a code (NO_BROWSER, UNREACHABLE, TIMEOUT, NOT_READY, STATE_MISMATCH, WITHIN_NO_MATCH, CLOSED_SHADOW, PROBE_ERROR, ASSET_MISSING), each with a fix line and a docs anchor. Exit 3 is usage only.--state-file(versioned, per-stateexpectselector) and--waivers(rule + locator + reason), both validated before any render. URL credentials are redacted from text, JSON, stderr and traces.--urlwith no browser now printsRENDER_UNAVAILABLEand exits 4 instead of exiting 0 having measured nothing.--renderover files keeps today's skip.#fragmentparameters (like#access_token=) are now redacted like query ones; two--urlstates whose redacted names match stay two states (name~2, picked from the names already in use) and only the same URL given twice is refused; a trace file that cannot be written keeps the statePROBE_ERRORinstead of crashing with exit 1; a section selector the browser refuses no longer stalls the readiness wait. The design-lint usage block and the project map now mention--scope app.Why
qm#3186 shipped three spacing defects (crowded two-line rows, help copy flush under a list, a status note at full weight in a row).
gstack-design-lint --renderon that page printed 697 findings and none of the three. A follow-up change adds an opt-in/design-review --buildloop that calls this profile.Six qm builds from the earlier probe show how it reads on real builds, compared per section with the preregistered scorer (independent code and thresholds).
--scope appThe false-positive corpus (12 repo pages,
test/fixtures/ui-spacing/corpus.json) gives zero app findings; negative controls (nav list, table, card grid, a correct list) carry deliberate trigger bait.Blast radius
Opt-in flag; no skill prose, no reviewer prompts, no /ship or /review change. The only change outside
--scope appis the--url-with-no-browser exit (now 4), listed in the changelog fragment.test/design-lint-app-profile.test.tsneeds a browser and fails loudly in CI without one; it runs about 50 s on a 4-core machine.Approvals
Approved: yes. The plan was approved before the build started; the record ids are under Internal references at the end.
Summary
The lint gets an app profile that only measures inside one section, with five spacing rules and a single verdict a build loop can act on. Review found a token leak through URL fragments and three smaller failure-path bugs, and all four are fixed with tests.
Test Coverage
Every changed runtime file has a changed test that names it.
The full free suite (1631 test files) passed in CI run 42407191649 on the pushed code.
Focused local runs on the reviewed code were all green: the app contract tests, the browser app-profile tests, the module-size and scope-guard tests, typecheck, and the test type check.
Pre-Landing Review
Each issue review found is listed below as fixed or skipped, or under Review notes. None is open.
lib/design-lint/app-input.ts: tokens in a URL fragment (#access_token=) printed in full in text, JSON, stderr and trace files. Found by the security checklist and confirmed by running the CLI.lib/design-lint/app-cli.ts: two--urlstates that differ only in a redacted value were refused as duplicates.lib/design-lint/render-app.ts: a trace file that could not be written crashed the run with exit 1, which means "open".lib/design-lint/render-app.ts,render-probe-app.ts: a--withinselector the browser refuses stalled readiness and reportedNOT_READYwith "selector undefined".lib/design-lint/app-cli.ts: the newname~2suffix could collide with a URL path that already ends in~2, so two states shared a name and the state count came out low. Found by the outside reviewer (another model family), the specialist and the adversarial reviewer; fixed and checked again with no findings.lib/design-lint/render-app.ts: the reachability check before rendering can mark a login-protected dev route unreachable and can spend a single-use URL token. The check is part of the spec; narrowing it to connection failures is a follow-up.Review notes
Below the blocking bar; recorded here and not fixed in this PR.
lib/design-lint/app-input.ts:44: a URL that passes the http(s) check but thatnew URLrejects (for example port 99999) keeps its query and fragment secrets in the printed state name. Such a URL cannot load; refusing it up front is the follow-up.lib/design-lint/app-input.ts:34-49: redacting a fragment re-encodes a hash-router route in printed output. Navigation still uses the real URL.lib/design-lint/render-probe-app.ts:394: an explicit--wait-forthe browser refuses reportsNOT_READY(exit 4) with a fix line about slow pages.lib/design-lint/render-app.ts:176: the soft-waitNOT_READYdetail names the section for any wait timeout.Exploratory QA
Six CLI checks on the code as pushed before review: bad selector, app-only flag without
--scope app, bad viewport and file paths under--scope appeach exit 3 with a reason and a fix line; an unreachable--urlexits 4 with the password and?token=redacted. The same run printed a#access_token=value in full (the first blocking issue above); after the fix it prints#access_token=REDACTED. Limits: these checks were logged by hand, not through the QA evidence recorder, and in-browser measurement is covered by the app-profile tests rather than a separate check.Design Review
Static only (no preview declared). The changed frontend files are test pages that are wrong on purpose, so the design checklist found nothing to report. The external design detector is not installed.
Eval Results
No prompt-related files changed, so evals were skipped.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. Docs already match the branch, so nothing was edited.
Scope: 34 committed files from e58be61 to 32af9a0 (the design-lint
--scope appprofile,--urlexit 4 with no browser, five app rules). The candidate has no staged, unstaged or new files.Documentation health:
Documentation Debt
--scope app: it has reference docs and a usage example in docs/design-lint.md, but no skill workflow (/design-review, /design-html) says when to run it, so the how-to step is missing.Test plan
bun test test/design-lint-app-contract.test.ts: greenbun test test/design-lint-app-profile.test.ts: green (browser)bun test test/module-size-ratchet.test.ts test/design-lint-scope-guard.test.ts: greenbun run typecheck: clean;bun run typecheck:test: none newbun run test): 1631 files passed in CI run 42407191649 on 32af9a0; the macOS regression job passed in the same runInternal references
Approved: yes (record r-8464717ba4b1). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: approved: run-20261107060947
Plan check: approved run-20261107060947 row=a-80e4c1654af2
REVIEW_LOOP: passes=2 blocking_found=4 deferred=0 noted=2 fixed=7 scope=frozen ledgers_read=8 fix_checks=2 dispatches=10
Gate edits: none detected (25 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)