a2ui-project / a2ui-project/a2ui

Lit renderer - hintedStyles assumption causes additionalStyles to be ignored

未关闭 适合新手
#602 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
component: lit renderer P2 type: bug
主要语言
TypeScript
星标
16.4k
派生
1.3k
平均合并
2 天 13 小时
30 天内合并 PR
134

描述

### 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

贡献指南

打开贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
frontend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
冷清
描述清晰度
描述清楚
新手友好度
75/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。