Skip to content

Declare cascade layer order; the banner reason survives truncation - #345

Merged
mattshax merged 1 commit into
mainfrom
layer-order
Sep 25, 2026
Merged

mattshax merged 1 commit into
mainfrom
layer-order

Conversation

@mattshax

Copy link
Copy Markdown
Member

Composer and conversation search (regression from ai-chat 0.5 / ui 0.16). Both packages nest their rules in pw-ui / pw-ai-chat, but the compiled ui stylesheet also emits a top-level @layer base { input, textarea { border; padding; background } }. Declared after the package layers, it outranked their utilities (border-0, pl-8, bg-transparent), so the composer textarea drew a second bordered box and the search input lost the padding that clears its icon. web/src/layers.css, imported first, declares @layer base, pw-ui, pw-ai-chat; so base is lowest. The Studio's own inputs all carry .field or a scoped rule and are unaffected. Measured in headless Chrome after the change: textarea border 0 and transparent; search padding-left 32px. (The leak contradicts the ui README's statement that all rules are layered; worth an upstream fix.)

Banner showed raw JSON. The probe truncated the provider error to 200 characters before extracting the reason, cutting the nested message in half. It now keeps 2,000, and providerReason also accepts a message cut off mid-string (tested with the exact truncated body the banner displayed).

…cation

ai-chat 0.5 and ui 0.16 nest their rules in the pw-ui and pw-ai-chat
layers, except that the compiled ui stylesheet also emits a top-level
`base` layer giving every input and textarea a border, padding, and
background. Declared after the package layers, it outranked their
utilities: the chat composer grew a second border inside its frame and
the conversation search lost the left padding that clears its icon. A
stylesheet imported first now names `base` before the package layers,
making it the lowest. The Studio's own inputs carry their own classes
and are unaffected. Measured after the change: composer textarea border
0 and transparent, search input padding 32px.

The availability banner quoted raw JSON because the probe cut the
provider's error to 200 characters before the reason was extracted,
splitting the nested message. The probe now keeps 2,000 characters and
the extractor also accepts a message cut off mid-string.
@mattshax
mattshax merged commit 9f0c348 into main Sep 25, 2026
2 checks passed
@mattshax
mattshax deleted the layer-order branch September 25, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant