Skip to content

fix: make registry blocks pass lint errors#564

Merged
miguel-heygen merged 1 commit intomainfrom
fix/registry-block-lint-clean
Apr 29, 2026
Merged

fix: make registry blocks pass lint errors#564
miguel-heygen merged 1 commit intomainfrom
fix/registry-block-lint-clean

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented Apr 29, 2026

Problem

Closes #559.

The catalog flowchart block emitted HyperFrames' own template_literal_selector lint error out of the box after hyperframes add flowchart. After the registry cleanup pass, the installed block also still carried the composition_file_too_large warning, so the issue repro was not fully lint-clean for users.

What this fixes

  • Rewrites flowchart selector construction from template interpolation to explicit string concatenation.
  • Adds data-start="0" to registry block roots that were missing it.
  • Adds class="clip" to invisible driver elements that already carry timing attributes.
  • Initializes window.__timelines before ui-3d-reveal registers its timeline.
  • Stamps installed registry block compositions with a harmless provenance comment.
  • Skips only the large-file advisory for registry source blocks and registry-installed blocks, while keeping the warning for plain user-authored large compositions.
  • Re-runs the registry and installed-flowchart lint passes with no Catalog block flowchart triggers HF lint rule template_literal_selector #559 lint errors or file-size warnings.

Root cause

flowchart used a hardcoded selector constant but then interpolated it through template literals, which still trips template_literal_selector. Separately, registry catalog files are curated distribution artifacts; treating those source or installed third-party blocks exactly like user-authored compositions made the 300-line authoring advisory show up for content users did not write.

Verification

Local checks

  • Full registry block source scan through lintHyperframeHtml(..., { isSubComposition: true }) -> files=39 composition_file_too_large=0 errors=0
  • Fresh /tmp/hf-flowchart-installed-qa project using a local registry server, then hyperframes add flowchart and hyperframes lint -> 0 errors, 0 warnings
  • Installed compositions/flowchart.html starts with <!-- hyperframes-registry-item: flowchart -->
  • bun run --filter @hyperframes/core test src/lint/rules/composition.test.ts -> 36 passed
  • bun run --filter @hyperframes/cli test src/commands/add.test.ts -> 11 passed
  • bun run lint
  • bun run --filter @hyperframes/core typecheck
  • bun run --filter @hyperframes/cli typecheck
  • bun run build:hyperframes-runtime
  • bunx oxfmt --check on changed files
  • git diff --check
  • Pre-commit hook passed for the committed files.

Browser verification

  • Created /tmp/hf-flowchart-qa embedding the patched flowchart.html.
  • Opened Studio at http://localhost:5194 with agent-browser.
  • Played the flowchart timeline and verified the block renders without browser errors.
  • Screenshot: qa-artifacts/issue-559/flowchart-2s.png
  • Recording: qa-artifacts/issue-559/flowchart-playback.webm

Notes

The large-file advisory still applies to plain user-authored compositions over 300 lines. The exemption is limited to registry source files shaped like registry/blocks/<block>/<block>.html and installed block files carrying the registry provenance marker.

@miguel-heygen miguel-heygen force-pushed the fix/registry-block-lint-clean branch from f567637 to d7c6b77 Compare April 29, 2026 15:02
Copy link
Copy Markdown
Collaborator

@jrusso1020 jrusso1020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — addresses both issue #559 (flowchart template-literal selectors) and the registry-block false-positive concern I flagged on #523.

Two-pronged exclusion strategy for composition_file_too_large / timeline_track_too_dense:

  1. Path-based skip when filePath matches registry/blocks/<name>/<name>.html — for hyperframes-oss source files
  2. Magic-comment marker <!-- hyperframes-registry-item: <name> --> injected by the installer when fetching block composition files; lint rule scans first 512 bytes for this marker

This is the right shape — durable across moves, explicit, and survives copy-paste of installed blocks. Test coverage in composition.test.ts exercises both paths (source skip, installed skip, normal file warn) and add.test.ts verifies the marker is actually injected during install.

Issue #559 fix: flowchart.html and 18 sibling registry blocks updated to add data-start="0" on roots, class="clip" on timed elements, and most importantly the flowchart block swaps `${S} #node-X` template literals for S + " #node-X" string concatenation. Net: registry blocks are now lint-clean out of the box.

Tests: @hyperframes/core 563/563 + @hyperframes/cli 180/180 pass.

— Review by Rames Jusso

@miguel-heygen miguel-heygen merged commit 328bba0 into main Apr 29, 2026
44 of 54 checks passed
@miguel-heygen miguel-heygen deleted the fix/registry-block-lint-clean branch April 29, 2026 15:53
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.

Catalog block flowchart triggers HF lint rule template_literal_selector

2 participants