a2ui-project / a2ui-project/a2ui
Lit renderer - hintedStyles assumption causes additionalStyles to be ignored
- Dominant language
- TypeScript
- Stars
- 16.4k
- Forks
- 1.3k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 134
Description
### Description
areHintedStyles() expects ["h1", "h2", "h3", "h4", "h5", "h6", "caption", "body"] and uses .every() to check if additionalStyles.Text is a hinted styles object.
This requires all 8 keys including h6 to be present. In practice, themes rarely define h6 styles (the HintedStyles interface doesn't even declare it). When any key is missing, the check returns false and the entire object is passed to styleMap() as a flat Record — but the values are nested objects, so nothing gets applied.
### Location
lit/src/0.8/ui/text.ts [Line 125 - 132]
### Suggested fix
Change .every() to .some() and remove h6 from the expected list so any recognized key triggers hinted mode
Contributor guide
Research direction
The bug is in lit/src/0.8/ui/text.ts lines 125-132. Start by reading the areHintedStyles function and understanding how it validates the additionalStyles.Text object. The fix involves changing the .every() method to .some() and removing 'h6' from the expected keys list. Test the change by running any existing tests for the text component or creating a small example to verify that styles are now correctly applied when h6 is missing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100