feat(viewer): push-time panes-density readability lint#185
Open
ivanmkc wants to merge 2 commits into
Open
Conversation
A structurally-valid view can still render unreadably small when too much heavy content is stacked into one layout — the screwbits trigger case (`rows`, 5 panes, 4 heavy: markdown→flow→component→vegalite→component), where each pane gets a sliver of the viewport. Nothing caught this. Fold density findings into the existing geometryReport so the server and CLI surface them through the same severity-tagged `findings` channel as the flow-geometry checks — no parallel module, no new response shape, no CLI change. (The approved spec predates the geometry-findings system and proposed all of that plumbing separately; this reuses it, honoring the spec's own "single source of truth / no duplicated lint logic" principle.) Warn-only checks, calibrated against the shipped gallery: - rows: ≥4 heavy panes OR weight >10 (screwbits warns; c4-architecture and the explainers — rows, ~3 heavy — stay clean) - columns: >3 panes; grid: >8 tiles - nested panes: any pane whose content is itself a panes payload - standalone flow: >30 nodes A "panes density" calibration guard asserts no shipped example trips a finding, keeping the thresholds honest.
Carry the original approved design onto the implementation branch and record how it actually landed (folded into the existing geometry-findings system, thresholds recalibrated against the gallery corpus).
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.
What
A structurally-valid view can still render unreadably small when too much heavy content is stacked into one layout — the screwbits trigger case (
rows, 5 panes, 4 heavy: markdown→flow→component→vegalite→component), where each pane gets a sliver of the viewport. Nothing caught this.This adds a static, push-time, warn-only density lint that covers every push path (CLI, ADK listener, raw
POST /push).How it landed (adapted from the approved spec)
The approved design predates the severity-tagged geometry-findings system that now exists (
geometryReport→Finding{severity,code,message}; server returns200 + {warnings, findings}/204/422underx-termchart-strict; CLI prints findings). That system already provides all the plumbing the spec proposed as new — so rather than build a parallelreadability.tsmodule + new response shape + CLI change, the density checks are folded intogeometryReportand emitted asFindings. This also honors the spec's own principle: "single source of truth … no duplicated lint logic across packages."server.tschange (already callsgeometryReportand returns findings)push.tschange (CLI already surfaces findings viaprintGeometry)rows-overstuffed,columns-too-many,grid-too-many,panes-nested,flow-too-many-nodesThresholds (recalibrated against the real corpus)
The spec called its numbers "starting points, not load-bearing constants." The
rowsrule of ">4 weight OR ≥3 heavy" flagged four curated gallery examples (c4-architecture: wt9/3-heavy; the three explainers: wt7/3-heavy), so it was tightened:rowscolumnsgridpanesA "panes density" calibration guard test asserts no shipped example trips a finding, keeping the thresholds honest.
Tests / verification
tsc) — 0 errorsscrewbitsdemo file →rows-overstuffedthrough the exactgeometryReportthe server callsRollout
Lint runs in the viewer server, so the deployed Cloud Run viewer must be redeployed for cloud pushes to surface these warnings; a local dev viewer picks it up immediately. Warn-only — never blocks a push.