feat(demo): add scroll, drag, pressKey, spotlight, annotate, waitForIdle primitives#4786
Merged
gregpriday merged 3 commits intodevelopfrom Apr 2, 2026
Merged
Conversation
…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
261dc5b to
62a4270
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scroll,drag,pressKey,spotlight,dismissSpotlight,annotate,dismissAnnotation, andwaitForIdle--demo-modeDemoOverlay, extendedDemoCursor) handle spotlight and annotation rendering with spring physicsResolves #4777
Changes
shared/types/ipc/demo.ts— new IPC types for all 8 primitiveselectron/ipc/channels.tsandelectron/ipc/handlers/demo.ts— IPC handler implementationselectron/preload.ctsandshared/types/ipc/api.ts— bridge exposuresrc/components/Demo/DemoOverlay.tsx— spotlight + annotation overlay with animated cutouts and callout bubblessrc/components/Demo/DemoCursor.tsx— extended with scroll, drag, and pressKey dispatch logicsrc/components/Layout/AppLayout.tsx— mountsDemoOverlayalongside existing demo cursorsrc/components/Demo/index.ts— exports updatedTesting
Unit tests updated in
electron/ipc/handlers/__tests__/demo.handlers.test.tsandsrc/components/Demo/__tests__/DemoCursor.test.tsxto cover the new primitives.npm run fixpasses clean with no errors.