Skip to content

feat(core): add fullscreen button component - #459

Merged
mihar-22 merged 5 commits into
mainfrom
feat/fullscreen-button
Feb 6, 2026
Merged

feat(core): add fullscreen button component#459
mihar-22 merged 5 commits into
mainfrom
feat/fullscreen-button

Conversation

@mihar-22

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

Copy link
Copy Markdown
Member

closes #273

Summary

Adds FullscreenButton component across core, html, and react packages, building on the fullscreen feature from #458.

  • FullscreenButtonCore: Shared business logic with state management for fullscreen toggle
  • FullscreenButtonElement: Web Component for html package
  • FullscreenButton: React component with proper TypeScript types

Implementation

  • Uses FullscreenState and selectFullscreen from feat(core): add presentation feature #458
  • Button state picks types from FullscreenState: fullscreen (boolean), availability (FeatureAvailability)
  • Data attributes derived automatically from state keys: data-fullscreen, data-availability — no explicit mapping needed
  • toggle() wrapped in try-catch (fullscreen requests can fail)
  • Follows same patterns as MuteButton and PlayButton

Files

  • packages/core/src/core/ui/fullscreen-button/ — Core logic and tests (15 tests)
  • packages/html/src/ui/fullscreen-button/ — Web Component
  • packages/html/src/define/ui/fullscreen-button.ts — Custom element registration
  • packages/react/src/ui/fullscreen-button/ — React component

Testing

  • 15 unit tests for FullscreenButtonCore
  • All 125 core tests pass

Depends On

@vercel

vercel Bot commented Feb 5, 2026

Copy link
Copy Markdown

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 6, 2026 3:38am

Request Review

@mihar-22 mihar-22 changed the title feat(packages): add fullscreen button component feat(core): add fullscreen button component Feb 5, 2026
@@ -0,0 +1,6 @@
export const FullscreenButtonDataAttributes = {
/** Present when fullscreen mode is active. */
fullscreenActive: 'data-fullscreen',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggest: In MC we went with a boolean isfullscreen, with "is" because it reads a more clearly when you're in the fullscreen button context. Any reason not to do that here? Could also be fullscreen-active to match the prop.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good callout! I think data-is-fullscreen would be inconsistent with what we have. None of our existing data attrs use an is- prefix. Play button uses data-paused, Mute button uses data-muted. Base UI follows the same convention – Toggle uses data-pressed, Checkbox uses data-checked. Short state words, no prefix.

By that convention, data-fullscreen feels right. It names the specific state the same way the others do. The -active suffix would also be redundant; presence of the attribute already implies active, same as data-paused or data-pressed.

I've also updated the state to align: fullscreenActivefullscreen on FullscreenState, and the button state simplifies to just fullscreen and availability in the fullscreen button context, data attributes naturally reflect this way.

@mihar-22
mihar-22 force-pushed the feat/fullscreen-button branch 2 times, most recently from 29183f7 to acbbdad Compare February 6, 2026 03:15
Base automatically changed from feat/presentation-feature to main February 6, 2026 03:24
@mihar-22
mihar-22 force-pushed the feat/fullscreen-button branch from acbbdad to bd2a26f Compare February 6, 2026 03:28
@netlify

netlify Bot commented Feb 6, 2026

Copy link
Copy Markdown

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 84c9650
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69856232087bb8000842aa65
😎 Deploy Preview https://deploy-preview-459--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.

Add FullscreenButton component across core, html, and react packages:

- FullscreenButtonCore: shared business logic and state management
- FullscreenButtonElement: web component for html package
- FullscreenButton: React component with proper types

Data attributes: data-fullscreen (boolean), data-availability
Follows same patterns as MuteButton and PlayButton.
- Wrap toggle() in try-catch (fullscreen can fail)
- Add JSDoc to props interface
- Add JSDoc to state interface
- Add JSDoc to data attributes
- PresentationState -> FullscreenState
- fullscreenActive -> fullscreen
- selectPresentation -> selectFullscreen
- Data attr key: fullscreenActive -> fullscreen
- Update tests, html element, and react component
@mihar-22
mihar-22 force-pushed the feat/fullscreen-button branch 2 times, most recently from e7f20d2 to 160e729 Compare February 6, 2026 03:37
- fullscreenAvailability -> availability on FullscreenButtonState
- Pick types from FullscreenState instead of re-declaring
- Remove FullscreenButtonDataAttributes (state keys map directly)
@mihar-22
mihar-22 force-pushed the feat/fullscreen-button branch from 160e729 to 84c9650 Compare February 6, 2026 03:38
@mihar-22
mihar-22 merged commit 3c4152f into main Feb 6, 2026
4 checks passed
@mihar-22
mihar-22 deleted the feat/fullscreen-button branch February 6, 2026 03:39
@github-actions github-actions Bot mentioned this pull request Feb 6, 2026
@github-actions github-actions Bot mentioned this pull request Feb 26, 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.

UI: Fullscreen Button Component

2 participants