Skip to content

Conversation

@richiemcilroy
Copy link
Member

@richiemcilroy richiemcilroy commented Oct 1, 2025

  • Merge click bursts with sustained pointer movement to build longer auto-zoom segments and ignore the stop recording click
  • Debounce cursor shapes under one second back to the default pointer across recording metadata so rapid hovers stay consistent.
  • Bump size of the cursor automatically if auto zoom segments are auto generated

Cursor hovering before:

Cursor.Before.mp4

Cursor hovering after:

Cursor.After.mp4

Summary by CodeRabbit

  • New Features

    • Automatic zoom segments now generated from both cursor movement and clicks.
    • Cursor size increases for recordings with auto-zoom to improve visibility.
  • Improvements

    • Smarter merging and filtering of zoom intervals for clearer timelines.
    • More reliable cursor tracking that stabilizes short-lived cursor shape changes.
  • Bug Fixes

    • Trailing end-of-recording clicks ignored to prevent unintended zooms.
    • Jitter tolerance reduces false-positive zooms.
    • Graceful handling when cursor data is missing.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2025

Warning

Rate limit exceeded

@richiemcilroy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 0bfc158 and c241cb8.

📒 Files selected for processing (3)
  • apps/desktop/src-tauri/src/recording.rs (5 hunks)
  • crates/project/src/cursor.rs (3 hunks)
  • crates/project/src/meta.rs (4 hunks)

Walkthrough

Adds movement-aware zoom segment generation using clicks and cursor moves, exposes a public generator, stabilizes short-lived cursor shapes via a debounce and pointer-ID detection in metadata loading, and updates the editor to enlarge the cursor when zoom segments are produced.

Changes

Cohort / File(s) Summary
Zoom generation & recording config
apps/desktop/src-tauri/src/recording.rs
Add movement-based zoom segment generation alongside click-based logic; per-cursor move tracking, interval collection, merging/filtering, deadline trimming, and conversion to ZoomSegment; expose pub fn generate_zoom_segments_from_clicks(...); integrate zoom segments into generated project config.
Editor UI: Zoom track
apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
After successful zoom-segment generation, conditionally call setProject to set cursor size to 200 when returned segments are non-empty.
Cursor events stabilization
crates/project/src/cursor.rs
Add pub const SHORT_CURSOR_SHAPE_DEBOUNCE_MS and CursorEvents::stabilize_short_lived_cursor_shapes(...) to merge/reassign short-lived cursor shapes using optional pointer IDs and duration threshold.
Recording metadata & loading
crates/project/src/meta.rs
Add pointer_cursor_ids() on StudioRecordingMeta and MultipleSegments; on loading cursor events compute pointer IDs and apply stabilization with debounce constant; handle load failures by returning default CursorEvents.
Tests & imports
apps/desktop/src-tauri/src/recording.rs (tests)
Add unit tests covering trailing-stop click trimming, sustained activity zoom generation, and jitter tolerance for new zoom logic; add necessary imports (HashMap, VecDeque, CursorMoveEvent, etc.).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Editor UI
  participant API as Tauri Recording API
  participant Meta as Project Recordings Meta
  participant ZG as ZoomGen

  User->>UI: Click "Generate Zoom Segments"
  UI->>API: request generateZoomSegments(recordingId)
  API->>Meta: load recording metadata (pointer IDs, cursor events)
  Meta->>Meta: compute pointer_cursor_ids()
  Meta->>Meta: stabilize_short_lived_cursor_shapes(...)
  API->>ZG: generate_zoom_segments_from_clicks(recording, recordingsMeta)
  ZG->>ZG: collect clicks + moves → per-cursor windows → intervals
  ZG->>ZG: merge/filter intervals → ZoomSegments[]
  ZG-->>API: ZoomSegments[]
  API-->>UI: ZoomSegments[]
  UI->>UI: if non-empty → set cursor size = 200
Loading
sequenceDiagram
  autonumber
  participant Meta as StudioRecordingMeta
  participant CS as CursorEvents
  note over Meta,CS: Stabilize short-lived cursor shapes at load time
  Meta->>Meta: pointer_cursor_ids()
  Meta->>CS: stabilize_short_lived_cursor_shapes(pointerIDs, SHORT_CURSOR_SHAPE_DEBOUNCE_MS)
  CS->>CS: group events by cursor_id, measure durations
  CS->>CS: reassign short-lived shapes to stable IDs
  CS-->>Meta: stabilized cursor events
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • Brendonovich

Poem

I hop through frames with careful sight,
Stitching clicks and moves into light—
Short shapes steadied, jitter tamed,
Zooms that bloom where cursors aimed.
Carrots tall, the stage aglow 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately summarizes the two central improvements—enhanced auto-zoom segment generation and improved cursor stability—using concise language that clearly reflects the primary changes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e7e5d9 and bb90e52.

📒 Files selected for processing (4)
  • apps/desktop/src-tauri/src/recording.rs (5 hunks)
  • apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx (1 hunks)
  • crates/project/src/cursor.rs (3 hunks)
  • crates/project/src/meta.rs (4 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
crates/**/src/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

For desktop IPC, use tauri_specta derive/macros on Rust types/events; do not hand-roll bindings

Files:

  • crates/project/src/meta.rs
  • crates/project/src/cursor.rs
**/*.{ts,tsx,js,jsx,rs}

📄 CodeRabbit inference engine (CLAUDE.md)

Do not add inline, block, or docstring comments in any language; code must be self-explanatory

Files:

  • crates/project/src/meta.rs
  • crates/project/src/cursor.rs
  • apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
  • apps/desktop/src-tauri/src/recording.rs
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Format Rust code using rustfmt and ensure all Rust code passes workspace-level clippy lints.
Rust modules should be named with snake_case, and crate directories should be in kebab-case.

Files:

  • crates/project/src/meta.rs
  • crates/project/src/cursor.rs
  • apps/desktop/src-tauri/src/recording.rs
crates/*/src/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Rust crates should place tests within the src/ and/or a sibling tests/ directory for each crate inside crates/*.

Files:

  • crates/project/src/meta.rs
  • crates/project/src/cursor.rs
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/desktop/**/*.{ts,tsx}: Do not manually import icons in the desktop app; rely on auto-imported icons
In the desktop app, use @tanstack/solid-query for server state management

Files:

  • apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Use strict TypeScript and avoid any; leverage shared types from packages

**/*.{ts,tsx}: Use a 2-space indent for TypeScript code.
Use Biome for formatting and linting TypeScript/JavaScript files by running pnpm format.

Files:

  • apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use kebab-case for filenames for TypeScript/JavaScript modules (e.g., user-menu.tsx).
Use PascalCase for React/Solid components.

Files:

  • apps/desktop/src/routes/editor/Timeline/ZoomTrack.tsx
🧬 Code graph analysis (3)
crates/project/src/meta.rs (2)
apps/desktop/src/utils/tauri.ts (6)
  • CaptionsData (352-352)
  • ProjectConfiguration (419-419)
  • XY (465-465)
  • StudioRecordingMeta (448-448)
  • MultipleSegments (404-404)
  • Cursors (366-366)
crates/project/src/cursor.rs (2)
  • load_from_file (60-63)
  • load_from_file (73-76)
crates/project/src/cursor.rs (1)
crates/rendering/src/lib.rs (6)
  • new (63-133)
  • new (307-344)
  • new (623-968)
  • new (984-989)
  • new (1036-1046)
  • new (1265-1295)
apps/desktop/src-tauri/src/recording.rs (2)
crates/project/src/cursor.rs (5)
  • moves (213-217)
  • load_from_file (60-63)
  • load_from_file (73-76)
  • click_event (296-304)
  • move_event (286-294)
crates/rendering/src/project_recordings.rs (3)
  • Some (197-204)
  • duration (178-180)
  • duration (196-207)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Vercel Agent Review
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Analyze (rust)

@richiemcilroy richiemcilroy merged commit 0ad9096 into main Oct 1, 2025
13 of 15 checks passed
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.

2 participants