Skip to content

When data-hv-text value is full content text, the label and badge are identical and unhelpful #79

Description

@walliai666

Describe the bug

When the AI generates frames, it sometimes uses the element's full visible text as the data-hv-text key (e.g. data-hv-text="决策核心:不是「怎么选」,而是「用什么标准选」"). In the Text Panel, the label (humanizeKey(key)) and the badge (raw key) then both show the exact same long string — which is redundant and makes the panel noisy.

Root cause

humanizeKey() only converts snake_case to Title Case. It has no effect on Chinese or natural-language strings, so label and badge become identical.

The deeper issue is that the key should be a short semantic identifier (e.g. headline, slogan, core_question), not the content itself.

Steps to reproduce

  1. Create a frame using an AI-generated HTML where text nodes are marked like:<h1 data-hv-text="决策核心:不是「怎么选」,而是「用什么标准选」">决策核心:...</h1>
  2. Open the Text Panel for that frame
  3. Observe: the label and the badge both show the full Chinese sentence

Expected behavior

The data-hv-text attribute should carry a short, descriptive key (headline, core_question, etc.)
Documentation / agent prompt guidance should explicitly state: "the value of data-hv-text must be a short snake_case identifier, not the element's text content"
Optionally, the parser could warn (console) when a key exceeds a reasonable length (e.g. > 40 chars), hinting at misuse

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions