Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
freddymeta
added a commit
that referenced
this pull request
Aug 7, 2026
Review finding (cixzhang, #4540): the inter-row gap sat as margin-block on the row box (contentWrapper) as calc(--tree-list-row-gap / 2) top and bottom, assuming half+half sums to a full gap. It does not — neither the row wrapper (position:relative) nor the <li> (margin/padding:0) establishes a BFC, so the block margins collapse out and adjacent rows collapse to max(g/2,g/2)=g/2. The lever delivered HALF its configured value (2px default rendered 1px) and half leaked above the first row / below the last. Move the gap onto rowWrapper as padding-block: padding cannot collapse, so the full gap renders; rowWrapper carries no theme target, so the paintable tree-list-item stays a pure paint seam (layout off the paint target, per the theming-target guidelines in #4774); and the <li>s stay contiguous so the guides still bridge. Retune the guide heights: the gap now lives inside the <li> (padding), so verticalFull no longer adds the gap (100% already covers it, +1px hairline bridge) and verticalLast clamps 100% - gap/2 to end at the row bottom. Tests: assert the APPLIED verticalFull/verticalLast class on a row s own connector (not a global-stylesheet regex, which passed regardless), and assert the gap rides padding-block on the row wrapper and NOT margin-block on the paint target. Verified the new geometry test fails on the pre-fix margin placement. Changeset corrected: (1) no longer claims hierarchical trees are unchanged, and (2) states the 2px default shifts every tree (matching List/DropdownMenu).
freddymeta
added a commit
that referenced
this pull request
Aug 10, 2026
… gap (#4540) * feat(treelist): flush a fully flat tree + themeable inter-row gap A leaf reserves the chevron-alignment column whenever the tree contains any expandable item (a caret exists somewhere to align labels under), so every row in a hierarchical tree renders exactly as before. Only a fully flat tree — no expandable items at all — drops the empty chevron column and renders its rows flush. The reserve decision is a whole-tree property (computed once at the root), not a per-group one: an all-leaf group nested under an expandable parent still reserves the column so its rows stay indented past the parent's label. Also adds a themeable --tree-list-row-gap (default 0px) for an inter-row gap; the connector guides span the gap automatically and no longer overhang the last row. * feat(treelist): default the inter-row gap to a subtle 2px Set --tree-list-row-gap's default to var(--spacing-0-5) (2px) so rows have a light separation out of the box, instead of 0px. A theme can still widen or close it via the tree-list target; the guide connectors span the gap as before. * test(treelist): use generateThemeTestCSS for the row-gap theme assertion The row-gap test called generateThemeCSSFlat, a helper that no longer exists after the rebase onto main (main renamed the theme-CSS helper). Point it at generateThemeTestCSS, the surviving helper, so the row-gap CSS assertion runs. * refactor(treelist): rename internal prop treeHasExpandableItems -> hasExpandableItems Satisfies the @astryx/boolean-prop-naming lint rule (strict mode in CI promotes it to an error), which requires boolean props to start with is/has. Internal prop on TreeListItemInternalProps only — no public API change. * fix(treelist): move row gap to collapse-proof padding on the row wrapper Review finding (cixzhang, #4540): the inter-row gap sat as margin-block on the row box (contentWrapper) as calc(--tree-list-row-gap / 2) top and bottom, assuming half+half sums to a full gap. It does not — neither the row wrapper (position:relative) nor the <li> (margin/padding:0) establishes a BFC, so the block margins collapse out and adjacent rows collapse to max(g/2,g/2)=g/2. The lever delivered HALF its configured value (2px default rendered 1px) and half leaked above the first row / below the last. Move the gap onto rowWrapper as padding-block: padding cannot collapse, so the full gap renders; rowWrapper carries no theme target, so the paintable tree-list-item stays a pure paint seam (layout off the paint target, per the theming-target guidelines in #4774); and the <li>s stay contiguous so the guides still bridge. Retune the guide heights: the gap now lives inside the <li> (padding), so verticalFull no longer adds the gap (100% already covers it, +1px hairline bridge) and verticalLast clamps 100% - gap/2 to end at the row bottom. Tests: assert the APPLIED verticalFull/verticalLast class on a row s own connector (not a global-stylesheet regex, which passed regardless), and assert the gap rides padding-block on the row wrapper and NOT margin-block on the paint target. Verified the new geometry test fails on the pre-fix margin placement. Changeset corrected: (1) no longer claims hierarchical trees are unchanged, and (2) states the 2px default shifts every tree (matching List/DropdownMenu).
cixzhang
force-pushed
the
lint-theme-targets
branch
from
August 12, 2026 16:17
823de50 to
e7e7a45
Compare
cixzhang
force-pushed
the
lint-theme-targets
branch
from
August 14, 2026 02:16
e7e7a45 to
3306fac
Compare
Encode the mechanically checkable part of the wiki's "Principles for authoring theming targets" as three rules, split by the severity they can realistically ship at: - @astryx/theming-target-shape — a target must sit on an element that paints. Flags a target on a layout-only box, on a paint-free wrapper around a composed Astryx component, and on an element with no styles at all. Uses #4758's stylex-style-source.js to read style objects across modules. - @astryx/theming-target-name — {parent}-{position}-{component}: an appearance word in the component slot, a missing position segment, and state used as a name suffix. - @astryx/themeprops-reflection — themeProps() read as `.className` (drops the data-* reflection) and hand-authored state data-*. Shared analysis lives in theming-target.js: which themeProps() calls land on an element, which stylex.props() arguments it applies, and whether those declare paint, layout, or neither. Not wired into eslint.config.js yet — prototype for review.
… rules
Adds the checks the theme-target inventory turned up as live bugs, plus
the RuleTester suites and the README section with measured counts.
- themeprops-reflection: `clobberedByLaterProp` (a `className` written
after the spread overwrites the target — ChatSendButton.tsx:121 and
RichTextEditor.tsx:527 render no theme class at all) and
`bypassedThemeProps` (MoreMenu builds the class with stableClassName,
so it can never carry state).
- theming-target-shape: state checks narrowed to RUNTIME state, so a
size table that only moves padding is not a finding (principle 2
requires size on the target whatever it changes); root targets moved
behind `checkRootTargets` (55 of them are layout primitives).
- theming-target-name: the component-slot check applies to leaf
components only, and never to a component's own root target —
principle 3 makes `{component}-option` correct on a row primitive.
- 66 RuleTester cases across the three rules.
Measured on packages/ with the defaults: 19 findings total
(5 layoutOnlyTarget, 4 wrapperTarget, 3 appearanceInComponentSlot,
3 classNameOnly, 2 clobberedByLaterProp, 2 bypassedThemeProps).
…w guide The criteria stay canonical in the wiki (Theming Infrastructure → "Principles for authoring theming targets"); the repo cites them rather than restating them. - README: each check's row names the principle it enforces, plus a section on what is NOT lintable (P6, P7, P3 convergence, P5) — lint checks the shape of a target, a human decides whether it should exist. - copilot-instructions.md: a reviewer/agent checklist for adding a target (does it paint? is the layout value declared? is it attached to the component? is the name compositional? is there a named consumer?), with the blocking items called out and the wiki linked as the source of truth. - Each rule's file header cites the wiki page and the principle number.
Principle 4 was the one principle with no mechanical check, and its own worked example — "a dedicated -label target that only wraps the fallback span ... silently misses custom-rendered content" — turns out to be detectable without any guess about design intent. - targetOnRenderPropFallback: a target on the element a `render*` callback renders in place of. That is principle 4's named anti-pattern; the callback's output never carries the target. - inheritableOnRenderPropFallback: inheritable typography/color on such a fallback, where hoisting it to the row target covers both paths. - inheritablePropertyOnChild (opt-in, checkInheritableHoisting): the broad form — any inheritable property on an untargeted descendant of a target. 111 hits, most of them correct code (a Banner title and description SHOULD differ), so it stays off as an exploration aid. The narrow render-prop form is 0 on main and fires on #4628. The render-prop predicate is intent-independent by construction: the divergence between the two render paths is in the AST.
…edge The README said a rule/wiki divergence should be resolved in the wiki's favor. That is a standing licence for drift, written while both sides are being authored. Replaced with the reconciliation: every divergence found while encoding the principles was resolved on one side or the other (audit in the PR description), and a future one is a bug to fix, not a precedence question. Also documents the two new principle-4 checks and the measured reason the broad inheritable-hoisting form stays off (111 hits, most correct), and adds "could the parent target reach it by inheritance?" to the reviewer checklist.
…rule gaps
The theming-target checklist and the plugin README both described the
authoring criteria in a way that let the banner-icon case be resolved
backwards: checklist item 5 ("prefer inheritance") read as licensing a
per-status color on the wrapper with <Icon color="inherit">, which
contradicts item 3 ("never mint a wrapper to hold a target") and the
wiki's principle 1 ("the target belongs on the glyph, not the wrapper").
Inheritance has a precondition: it only arrives if the child does not set
the property directly on its own element. Every composed Astryx component
with a color/size prop does exactly that, so principle 4 is silent there
and principle 1 decides — the target goes on the component instance,
where a same-element rule in @layer astryx-theme beats the component's own
base styles by layer order. Measured in Chrome, not reasoned about; the
tables are in the PR description.
Also records the three rule-level gaps that applying this criteria
surfaces (wrapperTarget's paint precondition, the shape rule skipping
Astryx components, and missingPosition colliding with the shipped
banner-icon name). No rule behaviour changes here.
Fixes two Banner line references that main has since shifted.
…d empty-state names
Rebasing onto main turned up two false positives against code that landed
since: `focusOutlineProps.focusVisible(…)` forwards its arguments to
stylex.props(), so five targets on focusable elements read as `unstyledTarget`
(proposed `error`), and `{selector,multi-selector,typeahead}-empty-state` read
as `stateSubTarget` though "empty state" names a region, not a state of
another target. Re-measured every count in the README against current main.
The rubric's §2 has moved since these rules were written: it now carries
numbered checks with their own severities and exceptions, and T6, T7, T26,
T27 and T12 say exactly what a theming target must do. So the rules no
longer need to propose criteria — they can automate the ones that exist,
and the proposed wiki text goes away with them.
Every remaining check names its rubric id in its message, so a report reads
as "T6: ..." and the author can look the rule up. Anything that could not
name an id is gone: the {parent}-{position}-{component} shape (no published
rule states it, and it fires on the unrenameable banner-icon), the
layout-only root target (T7 exempts a component's root outright, the
state-seam-only-moves-layout check, and the broad inheritable-hoisting
exploration.
That leaves underDeclaredState as the one worth having: T6 is a BLOCK the
rubric detects by grep, records as the single most frequent theming finding,
and has no lint rule. It ships at warn — its 17 hits are a real backlog.
MSG
)
The tables were taken eleven days ago. Rebasing moved every one of them: T6 under-declared state 17 -> 20, layout-only targets 6 -> 7, wrapper targets 4 -> 2, bypassed themeProps 7 -> 9, className-only 4 -> 3. clobberedByLaterProp is now 0: the RichTextEditor call site it counted moved into packages/richtext and was rewritten through mergeProps on the way, so the check ships as a pure regression guard with nothing to fix.
cixzhang
force-pushed
the
lint-theme-targets
branch
from
August 25, 2026 21:11
3306fac to
31e3756
Compare
Contributor
Author
|
Closing this prototype. Three large rules that are registered and documented but disabled are maintenance surface without enforcement. A future rule should start from one concrete regression, ship narrowly, and be enabled in the same change. |
This branch was successfully deployed
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 this is
ESLint rules that automate the mechanically checkable part of the Component Audit Rubric's §2. Registered on the plugin, in neither shipped config, not wired into
eslint.config.js— turning one on is a one-line change once we agree on the tier.This PR used to be two things: proposed wiki text defining theming-target criteria, plus lint encoding it. The proposal is gone. The rubric now carries numbered §2 checks with their own severities and exceptions — T6, T7, T12, T26, T27 — so there is nothing left to propose. Every check here names the rubric id it automates, in the message text, so a report reads
T6: theme target 'x-option' is on an element whose styles vary with…and the author can look up exactly what was applied.Anything that could not name a rubric id was removed, rather than kept as a proposal:
missingPosition— the{parent}-{position}-{component}shapebanner-icon: a shipped public target with a codemod behind it, unrenameablelayoutOnlyRootTarget(55 hits)stateVariesOnlyLayoutinheritablePropertyOnChild(108 hits)Also gone: the
.github/copilot-instructions.mdchecklist this PR added. It restated rules the rubric owns, which is the duplication that caused a day of drift fixes last week. What is left there is the two facts a reviewer cannot get from the rubric alone — that T6 and T7 have no enforcer, and that these rules are in neither config, so a greenpnpm lintsays nothing about a new target.The one worth having
underDeclaredStateautomates T6, which the rubric marks BLOCK, detects by grep, records as "historically the single most frequent finding", and has no lint rule for. It catchesfooStyles[prop]insidestylex.props()with nopropin the siblingthemeProps()call — a style-driving prop a theme cannot reach.Its 20 hits are a real pre-existing backlog (Calendar, Code, CommandPaletteItem, FileInput, InputGroup, Link, MobileNav, MultiSelector, …), each needing a human call about which prop belongs on the target. Hence
warn: aterrorit fails CI onmain.Measured on current
maintheming-target-shape/underDeclaredStatewarntheming-target-shape/layoutOnlyTargetwarntheming-target-shape/wrapperTargetwarntheming-target-shape/unstyledTargeterrortheming-target-shape/targetOnRenderPropFallbackwarntheming-target-shape/inheritableOnRenderPropFallbackwarntheming-target-name/appearanceInComponentSlotwarntheming-target-name/stateSubTargeterrorthemeprops-reflection/bypassedThemePropswarnthemeprops-reflection/classNameOnlywarnthemeprops-reflection/clobberedByLaterProperrorthemeprops-reflection/droppedStateReflection,handAuthoredStateerrorCounts re-run against
mainfor this revision, not carried over. Every one of them moved over the eleven days this branch sat: T6 went 17 to 20, layout-only 6 to 7, wrapper 4 to 2, bypassedthemeProps7 to 9, className-only 4 to 3.The live bug it was written for is gone
clobberedByLaterPropcounted exactly one hit when this branch was cut:RichTextEditorwroteclassName={className}after thethemePropsspread, sowith no consumer
classNamethe theme class resolved toundefined. That filehas since moved to
packages/richtextand was rewritten throughmergePropsonthe way, and #4781 — the fix
this section used to point at — is closed. The check now measures 0 and ships as
a pure regression guard.
MoreMenu's hand-built target is still open in#4782; it is 2 of the 9
bypassedThemePropshits.Risk
None to consumers: no component source changes, and the rules run nowhere. The
underDeclaredStatebacklog is the only thing that would bite, and only if someone enables it aterror.Testing
pnpm vitest run internal/eslint-plugin-astryx— 31 files, 653 tests, green. Counts above produced by running the rules overpackages/{core,lab}/src/**through the ESLint Node API.Rebased onto current
main(41494fc).tsc --noEmitis identical tomainin the same tree, 776 errors either way, all pre-existing.