Skip to content

perf(overview): prioritize and smooth preview loading - #112

Merged
qeude merged 9 commits into
mainfrom
perf/overview-preview-loading
Sep 29, 2026
Merged

qeude merged 9 commits into
mainfrom
perf/overview-preview-loading

Conversation

@qeude

@qeude qeude commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Prioritize preview captures by selected monitor and distance from the selection.
  • Smooth preview loading with bounded concurrent captures, aspect-preserving sizes, and cross-fades.
  • Reduce redraw work to affected cards and reuse the Core Image rendering context.

Testing

  • Not run (change request content only).

Review in cubic

Note

Prioritize and smooth overview preview loading with capture limits and cross-fades

  • Speeds up first previews: wallpaper loading starts at panel preparation in OverviewPanel.swift, and desktop and window captures run concurrently under a shared two-slot OverviewCaptureLimiter actor in OverviewPreviewCapture.swift
  • Orders capture requests in OverviewController.swift by selected monitor first, then by distance from the selected window, and uses aspect-preserving pixel sizing so large cards are not distorted
  • Adds cross-fades for replaced previews and desktop images, with dirty-region-scoped redraws in OverviewView.swift, and slows the default preview reveal from 0.32s to 0.45s
  • Tracks first-preview and latest-preview latency plus received-preview count in OverviewPresentationState and formats them in the daemon status string
  • Behavioral Change: progressivelyBlurredOverviewPreview now applies variable blur only to the title-band region instead of the whole preview; reveal timing tests in OverviewPreviewTests.swift are updated for the 0.45s default

Macroscope summarized 763be1b.

Comment thread Sources/DefiMacOS/OverviewController.swift
@macroscopeapp

macroscopeapp Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes the production overview capture and rendering pipeline across multiple files, including capture prioritization and concurrency, wallpaper preloading, shared image processing, cross-fades, and dirty-region redraws. The resulting asynchronous coordination and visible existing-path behavior are broad enough to require human review.

No code changes detected at 763be1b. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread Sources/DefiMacOS/OverviewView.swift
Comment thread Sources/DefiMacOS/OverviewPreviewCapture.swift Outdated
Comment thread Sources/DefiMacOS/OverviewController.swift
Comment thread Sources/DefiMacOS/OverviewPreviewCapture.swift
Comment thread Sources/DefiMacOS/OverviewController.swift Outdated
Start the fade link on every replacement, cancel the desktop capture with the
batch, rank cross-monitor previews without comparing panel-local coordinates,
skip off-rect borders during localized redraws, and cap preview concurrency at
three so at most four captures run at once.
@qeude

qeude commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Review feedback addressed in 4397dd4 (also merged main):

  • Fade link on monitor move (Macroscope, cubic): fixed, startPreviewFadeAnimation now runs on every replacement.
  • Desktop capture cancellation (cubic): fixed, one cancellation handler now covers both awaits.
  • Cross-monitor ordering (cubic): fixed, distance ranking only applies on the selected monitor; other monitors keep their order.
  • Border rebuild per fade frame (cubic): fixed, drawWindowBorder skips cards outside the dirty rect.
  • Five concurrent captures (cubic): partly accepted. Preview concurrency is now 3, so at most 4 captures run at once (was 2 previews + serial desktop). I haven't measured GPU/memory impact; the parallel desktop capture is the main latency win.

@qeude

qeude commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Concurrency: you're right, docs/plans/overview.md sets a two-capture bound. Reverted to 2 and window + desktop captures now share one limiter, so desktop capture still overlaps window previews without exceeding it.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread Sources/DefiMacOS/OverviewPreviewCapture.swift
@qeude

qeude commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Cancellation: a worker cancelled while queued now releases its slot and returns without capturing (both window and desktop paths).

…mings

Fade the panel in over 140ms and cross-fade a replaced desktop image, both
skipped for reduced motion. Decode the wallpaper when panels are prepared so
the first open does not show black. Report open-to-first and open-to-last
preview milliseconds in defi status.
@qeude

qeude commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Also in this PR now: panel fade-in on open (140ms), desktop-image cross-fade (250ms), wallpaper preloaded at panel preparation, and overviewFirstPreviewMs / overviewLastPreviewMs / overviewReceivedPreviews in defi status. Measured on one monitor with 6 windows: first preview ~140ms, last ~250ms at the shared limit of 2.

@qeude

qeude commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Also in this PR now: panel fade-in on open (140ms), desktop-image cross-fade (250ms), wallpaper preloaded at panel preparation, and overviewFirstPreviewMs / overviewLastPreviewMs / overviewReceivedPreviews in defi status. Measured on one monitor with 6 windows: first preview ~140ms, last ~250ms at the shared limit of 2.

@qeude
qeude merged commit fb95ca2 into main Sep 29, 2026
4 checks passed
@qeude
qeude deleted the perf/overview-preview-loading branch September 29, 2026 06:55
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.

1 participant