Skip to content

feat(demo): add scroll, drag, pressKey, spotlight, annotate, waitForIdle primitives#4786

Merged
gregpriday merged 3 commits intodevelopfrom
feature/issue-4777-add-missing-demo-primitives
Apr 2, 2026
Merged

feat(demo): add scroll, drag, pressKey, spotlight, annotate, waitForIdle primitives#4786
gregpriday merged 3 commits intodevelopfrom
feature/issue-4777-add-missing-demo-primitives

Conversation

@gregpriday
Copy link
Copy Markdown
Collaborator

Summary

  • Adds 8 missing demo primitives needed for realistic IDE demo videos: scroll, drag, pressKey, spotlight, dismissSpotlight, annotate, dismissAnnotation, and waitForIdle
  • All primitives follow the existing pattern (IPC channel, main handler, renderer exec command, preload bridge method) and are gated behind --demo-mode
  • Integrates with the existing pause/resume system; new overlay components (DemoOverlay, extended DemoCursor) handle spotlight and annotation rendering with spring physics

Resolves #4777

Changes

  • shared/types/ipc/demo.ts — new IPC types for all 8 primitives
  • electron/ipc/channels.ts and electron/ipc/handlers/demo.ts — IPC handler implementations
  • electron/preload.cts and shared/types/ipc/api.ts — bridge exposure
  • src/components/Demo/DemoOverlay.tsx — spotlight + annotation overlay with animated cutouts and callout bubbles
  • src/components/Demo/DemoCursor.tsx — extended with scroll, drag, and pressKey dispatch logic
  • src/components/Layout/AppLayout.tsx — mounts DemoOverlay alongside existing demo cursor
  • src/components/Demo/index.ts — exports updated

Testing

Unit tests updated in electron/ipc/handlers/__tests__/demo.handlers.test.ts and src/components/Demo/__tests__/DemoCursor.test.tsx to cover the new primitives. npm run fix passes clean with no errors.

…dle primitives

- Add 8 new payload interfaces in shared/types/ipc/demo.ts
- Add 16 new IPC channel constants (8 invoke + 8 exec) in channels.ts
- Add 8 new main process handlers in demo.ts (including annotate ID pre-generation)
- Add 8 new preload bridge methods and API type signatures
- Add scroll (spring physics), drag (dual-stack pointer+mouse), pressKey, waitForIdle exec handlers in DemoCursor.tsx
- Create DemoOverlay.tsx with spotlight (SVG mask) and annotate (positioned callouts) handlers
- Mount DemoOverlay alongside DemoCursor in AppLayout
- Update handler count tests from 14 to 22, add annotate roundtrip and scroll forwarding tests
- Filter infinite CSS animations in waitForIdle to prevent permanent timeout
- Remove unused durationMs from DemoScrollPayload (spring uses fixed physics)
- Fix dismissAnnotation to use strict undefined check instead of falsy check
- Cast playState to string for pending check (not in TS AnimationPlayState union)
- Add null guard for SVG rect ref inside spring animation closure
- Fix dismissAnnotation to use strict undefined check
- Apply prettier formatting
@gregpriday gregpriday force-pushed the feature/issue-4777-add-missing-demo-primitives branch from 261dc5b to 62a4270 Compare April 2, 2026 04:30
@gregpriday gregpriday merged commit 48f2757 into develop Apr 2, 2026
3 checks passed
@gregpriday gregpriday deleted the feature/issue-4777-add-missing-demo-primitives branch April 2, 2026 04:31
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.

Add missing demo primitives: scroll, drag, keyboard, spotlight

1 participant