Skip to content

fix(core): report peer classes without sibling context - #598

Draft
houko wants to merge 3 commits into
mainfrom
fix/peer-class-diagnostics
Draft

houko wants to merge 3 commits into
mainfrom
fix/peer-class-diagnostics

Conversation

@houko

@houko houko commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

A peer-* variant in a span's classes or Screen.HeaderClass parsed successfully but could never match because those contexts have no sibling matcher. The rule failed silently.

Report each unsupported peer class once per context through the graph's bounded diagnostic cache, while preserving the existing unknown-class diagnostics. Run the same check when theme changes reparse spans. Leave shared parsed lists intact, so using the same class string on an ordinary sibling view still works.

The styles guide (English and Chinese), the architecture notes, the agent skill's authoring reference, the Span.Class / Screen.HeaderClass doc comments and the TSX headerClass type doc say where peer variants do not apply and to put a span's peer variant on its Text.

Closes #553.

Verification (rebased onto current main):

  • The new regression fails without the fix (all four expected diagnostics absent) and passes with it.
  • The regression checks unnamed and named peer variants, combined dark and important variants, repeated spans, SpansFunc updates, and reparsing after theme replacement. Each context logs only once; ordinary span/header styles and a Text's own peer-dependent style remain intact.
  • go tool nsgo test ./core (718 passed), go tool nsgo test ./tsx and go tool nsgo test -run 'Layer|Skills|Doc' . (35 passed) pass.
  • go build ./..., go vet ./core ./tsx for linux, windows, android/arm64, js/wasm and darwin, go vet ./core for ios, and go tool nsgo check -target all pass.

This is shared core behavior on every backend (a log line, no rendering change); no platform-specific API changes are needed.

@github-actions github-actions Bot added documentation Improvements or additions to documentation core size/S bug Something isn't working labels Nov 17, 2026
@houko
houko force-pushed the fix/peer-class-diagnostics branch from 8b95dcb to cf60bf9 Compare November 17, 2026 17:54
@github-actions github-actions Bot added the conflict Conflicts with the base branch; resolve it first label Nov 17, 2026
@houko
houko force-pushed the fix/peer-class-diagnostics branch from cf60bf9 to ce6ba53 Compare November 18, 2026 00:48
@github-actions github-actions Bot added size/M conflict Conflicts with the base branch; resolve it first and removed size/S conflict Conflicts with the base branch; resolve it first labels Nov 18, 2026
@houko
houko force-pushed the fix/peer-class-diagnostics branch from ce6ba53 to 10e8683 Compare November 18, 2026 03:02
@github-actions github-actions Bot added tsx and removed conflict Conflicts with the base branch; resolve it first labels Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core documentation Improvements or additions to documentation size/M tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: peer-* variants in span classes and HeaderClass never apply and are not reported

1 participant