Skip to content

feat: toggle playback from preview canvas - #26

Merged
eddiejaoude merged 2 commits into
eddiejaoude:AyobamiH-canvas-playback-togglefrom
AyobamiH:feat/preview-canvas-playback-toggle
Aug 15, 2026
Merged

eddiejaoude merged 2 commits into
eddiejaoude:AyobamiH-canvas-playback-togglefrom
AyobamiH:feat/preview-canvas-playback-toggle

Conversation

@AyobamiH

Copy link
Copy Markdown
Contributor

Description

Adds direct playback control to the preview while continuing to use the existing playback state.

  • click/tap the preview to toggle play and pause;
  • add a keyboard-accessible preview playback control;
  • keep the existing playback bar and keyboard shortcuts working;
  • prevent nested interactive controls from triggering an additional playback toggle;
  • keep PreviewCanvas unchanged so rendering remains separate from playback interaction.

Related issue

Closes #19

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / maintenance
  • Other

How has this been tested?

Verified locally with:

npm ci
git diff --exit-code -- package-lock.json
npm run format:check
npm run lint
npm run test:unit
npm run build
npx playwright install --with-deps chromium
npm test
npx playwright test e2e/playback.spec.ts --repeat-each=10 --workers=1
npx playwright test e2e/playback.spec.ts --repeat-each=10 --workers=4
npx playwright test e2e/playback.spec.ts --ui
git diff --check upstream/main...HEAD

Results:

* formatting passed;
* lint: 0 errors, 1 existing warning;
* unit tests: 3 passed;
* production build passed;
* full Playwright suite: 27 passed;
* playback stress: 50/50 serial and 50/50 parallel;
* Playwright UI: 5/5 playback tests passed with visual inspection of preview/shared-state and keyboard activation flows;
* manual mouse and keyboard playback checks passed.

## Screenshots

**Playwright UI:** 5/5 playback tests passing — preview click/shared state, keyboard activation, and existing Space/R controls verified.

https://github.com/user-attachments/assets/078f8bb9-08cc-4fa1-951a-eb91ef45cc34


**Preview/playback shared state**
Playwright E2E demonstrating preview click, playback-bar synchronization, nested control handling, and a passing shared-state test.

https://github.com/user-attachments/assets/6ecb0366-33a4-4a5e-9524-deb6cd2a2a6d


**Keyboard accessibility**
Playwright E2E demonstrating keyboard focus plus Space and Enter activation on the preview playback control, with the test passing.


https://github.com/user-attachments/assets/f8f2e6e8-dbdb-4737-ada2-4ea6a79bf0dd


## Checklist

* [x] My code follows the style of this project
* [x] I have tested my changes locally
* [x] I have updated documentation where needed
* [x] My pull request targets the `main` branch
* [x] I have read the [[Contributing guide](https://chatgpt.com/CONTRIBUTING.md)](../CONTRIBUTING.md)

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@AyobamiH is attempting to deploy a commit to the Jaoude Studios Team on Vercel.

A member of the Team first needs to authorize it.

@eddiejaoude

Copy link
Copy Markdown
Owner

Thank you 🙏 . I will integrate this PR this weekend.

@eddiejaoude
eddiejaoude changed the base branch from main to AyobamiH-canvas-playback-toggle August 15, 2026 08:04
@eddiejaoude
eddiejaoude merged commit 0a343e2 into eddiejaoude:AyobamiH-canvas-playback-toggle Aug 15, 2026
0 of 3 checks passed
eddiejaoude added a commit that referenced this pull request Aug 15, 2026
PR #26 was authored against the DOM PreviewCanvas renderer and merged
after the WebGL-only consolidation deleted it, leaving App.tsx importing
a missing module (build broke on TS2307) and wrapping the toggle surface
around the retired renderer instead of WebGLScene.

- App: drop the dead PreviewCanvas import; wrap PreviewPlaybackSurface
  around the live WebGLScene + BrandOverlay.
- e2e/app: pausePreview now pauses idempotently via the "Preview
  playback" button's aria-pressed — clicking the surface now toggles
  playback, so the old focus-nudge click would have un-paused instead.
- e2e/playback: add a test asserting a surface click freezes/resumes the
  real clock (not just aria-pressed); extend the R-restart poll timeout
  so the starved-clock case under full-suite parallelism isn't flaky.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

[Feature]: Toggle playback by clicking the preview canvas

2 participants