Skip to content

feat(html): add thumbnail element#646

Merged
mihar-22 merged 2 commits intomainfrom
opencode/lucky-wolf-html
Feb 28, 2026
Merged

feat(html): add thumbnail element#646
mihar-22 merged 2 commits intomainfrom
opencode/lucky-wolf-html

Conversation

@mihar-22
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 commented Feb 27, 2026

Ref: #501
Stacked on: #643

Summary

<media-thumbnail> custom element and TimeElement simplification.

@videojs/html

<media-thumbnail> element

Tag media-thumbnail
Property time: number
Shadow DOM <img part="img">
Sizing max-width / max-height on host → auto-scales proportionally
Data attrs data-loading, data-error, data-hidden
<media-thumbnail time="10"></media-thumbnail>
media-thumbnail { max-width: 200px; max-height: 150px; }

TimeElement (incidental)

Simplifies DOM update — constructor sets up children once, toggles hidden instead of add/remove per update.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
vjs-10-demo-react Ignored Ignored Preview Feb 28, 2026 0:46am

Request Review

@mihar-22 mihar-22 changed the title feat(html): add thumbnail element with CSS constraint-based sizing feat(html): add thumbnail element Feb 27, 2026
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch from ca1c696 to 03baf98 Compare February 27, 2026 21:14
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf branch from f745af9 to 2666ebb Compare February 27, 2026 21:18
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch 2 times, most recently from c4dc25a to 4682c93 Compare February 27, 2026 22:15
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf branch from 846bbf7 to b69a38d Compare February 27, 2026 22:30
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch from 4682c93 to b16c6aa Compare February 27, 2026 22:30
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf branch from b69a38d to 129c833 Compare February 27, 2026 22:46
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch from b16c6aa to d4949aa Compare February 27, 2026 22:46
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf branch from 129c833 to 41d0881 Compare February 27, 2026 23:00
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch from d4949aa to 6826bae Compare February 27, 2026 23:00
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf branch from 41d0881 to c94a108 Compare February 27, 2026 23:07
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch from 6826bae to 4e2b05b Compare February 27, 2026 23:07
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf branch from c94a108 to f0eae6a Compare February 27, 2026 23:10
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch from 4e2b05b to 1a0b1f9 Compare February 27, 2026 23:10
Base automatically changed from opencode/lucky-wolf to main February 27, 2026 23:19
Add <media-thumbnail> custom element that uses shadow DOM with
overflow:hidden container and transform:translate() positioning.
Reads CSS max-width/max-height constraints via getComputedStyle
and auto-scales proportionally.

Also simplifies TimeElement DOM updates — sets up children once
in constructor, toggles hidden instead of add/remove per update.
@mihar-22 mihar-22 force-pushed the opencode/lucky-wolf-html branch from 1a0b1f9 to 4326592 Compare February 28, 2026 00:46
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 28, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 4326592
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69a23ad962e3b70008339df8
😎 Deploy Preview https://deploy-preview-646--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Package Size Diff %
@videojs/core 8.21 kB 0 B ░░░░░░░░ 0%
@videojs/element 1.60 kB 0 B ░░░░░░░░ 0%
@videojs/html 11.43 kB +851 B ████████ +7.8% 🔺
@videojs/icons 3.79 kB 0 B ░░░░░░░░ 0%
@videojs/react 9.69 kB 0 B ░░░░░░░░ 0%
@videojs/store 1.94 kB 0 B ░░░░░░░░ 0%
@videojs/utils 2.54 kB 0 B ░░░░░░░░ 0%

Total: 39.21 kB · +851 B · +2.2%


Entry Breakdown

Subpath sizes are the additional bytes on top of the root entry point, measured by bundling root + subpath together and subtracting the root-only size.

@videojs/core
Entry Base PR Diff %
. 3.86 kB 3.86 kB 0 B 0%
./dom 4.36 kB 4.36 kB 0 B 0%
total 8.21 kB 8.21 kB 0 B 0%
@videojs/element
Entry Base PR Diff %
. 817 B 817 B 0 B 0%
./context 823 B 823 B 0 B 0%
total 1.60 kB 1.60 kB 0 B 0%
@videojs/icons
Entry Base PR Diff %
./react 2.27 kB 2.27 kB 0 B 0%
./html 1.52 kB 1.52 kB 0 B 0%
total 3.79 kB 3.79 kB 0 B 0%
@videojs/store
Entry Base PR Diff %
. 1.29 kB 1.29 kB 0 B 0%
./html 468 B 468 B 0 B 0%
./react 199 B 199 B 0 B 0%
total 1.94 kB 1.94 kB 0 B 0%
@videojs/utils
Entry Base PR Diff %
./array 104 B 104 B 0 B 0%
./dom 760 B 760 B 0 B 0%
./events 227 B 227 B 0 B 0%
./function 197 B 197 B 0 B 0%
./object 119 B 119 B 0 B 0%
./predicate 265 B 265 B 0 B 0%
./string 110 B 110 B 0 B 0%
./style 185 B 185 B 0 B 0%
./time 478 B 478 B 0 B 0%
./number 158 B 158 B 0 B 0%
total 2.54 kB 2.54 kB 0 B 0%

ℹ️ How to interpret

Sizes are minified + brotli, measured with esbuild.
Package totals are computed as root size + marginal subpath costs.
Subpath marginal cost = (root + subpath bundled together) − root alone.

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

@mihar-22 mihar-22 merged commit 8457b12 into main Feb 28, 2026
12 checks passed
@mihar-22 mihar-22 deleted the opencode/lucky-wolf-html branch February 28, 2026 01:02
This was referenced Feb 28, 2026
@github-actions github-actions bot mentioned this pull request Mar 10, 2026
@luwes luwes mentioned this pull request Apr 11, 2026
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.

1 participant