Skip to content

Prioritize current combined diff rows and drop obsolete queued loads - #35594

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/monaco-visible-load-queue-2
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/monaco-visible-load-queue-2

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​180 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​180
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​75 $\color{#cf222e}{\Huge{\mathbf{−}}}$​22 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​53

ELI5

After scrolling through unloaded combined-diff rows, the row currently on screen can wait behind requests for rows already passed. Load the current expanded row next and skip obsolete automatic requests before they reach the Git transport.

What Changed

  • Prioritize pending expanded rendered rows, using request order to break ties.
  • Drop unissued mounted-row and automatic-reload requests after they leave the rendered range or collapse.
  • Retain the initial six-row prefetch, explicit navigation, deferred loads, manual retries and explicit expansion requests across scrolling.

The concurrency cap remains 1. This changes renderer queue admission only: no active I/O cancellation, backend/process/cache changes, wire changes or new UI controls.

Why

The serial completion policy protects Monaco mount work, but FIFO admission makes a newly visible row wait for obsolete viewport requests. Keeping the cap while prioritizing the current viewport removes that queued waste without a new fetch/mount concurrency policy.

The tests are deterministic and exercise queue admission order; no latency, frame-rate, CPU or Git subprocess improvement is claimed.

Linked Issue

Partial fix for #35479; leave the issue open. #35570 separately scopes status invalidation. Metadata-only whole-view resets, backend batching/caching, and full local/remote cold/warm throughput/frame measurements remain separate work. Open #35048 handles cancellation of issued reads; its actual patch does not change this pending scheduler.

Visual Proof

N/A — this changes queue admission before content publication, with the same controls, interactions and rendered content. No rendered responsiveness claim is made.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Linux, Node 24.22.0, private dependency tree, short private TMPDIR, ORCA_BACKGROUND_LAUNCH=1.

  • combined-diff-load-scheduler.test.ts: a rendered viewport row loads before earlier queued rows, an explicit offscreen request is kept, and a viewport-only request that left the rendered set is dropped.
  • combined-diff-viewport-load-order.test.tsx: through the real registry, loader, retry and scheduler, an automatic reload that scrolls offscreen while queued is not fetched, and the row reloads when it is rendered again (no stale content left behind).
  • Both tests fail with the four production files restored to main. The one-line combined-diff-stale-analysis-work-budget.test.tsx update marks its row as rendered, which viewport-only loads now require.
  • ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2: 22/22 checks passed on the rebased head.

No Electron app launched. Windows/macOS/SSH were considered through unchanged routing and transport; no runtime performance evidence was collected there. Folder workspaces use the same queue; mobile does not use this combined viewer scheduler.

Review

Production scheduler, registry, loader and retry changes reviewed before publication. Six perf-scan questions covered: admission before expensive work, single viewer ownership, renderer/host boundary, bounded viewport scans and progress, unchanged host routing, and release of obsolete pending work. Active issued reads remain with their existing owner.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Additive loader/registry overlap with #35048 needs normal integration. No new processes, timers, subscriptions, caches, payload formats or host-specific paths.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — changed gate passed; full platform builds remain for CI

@OrcaWin
OrcaWin force-pushed the OrcaWin/monaco-visible-load-queue-2 branch from b261806 to 0225eeb Compare October 29, 2026 04:35
@OrcaWin
OrcaWin marked this pull request as ready for review October 29, 2026 04:44
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 837704f8-b077-4ad1-88d7-f777787d511b
Commits

Reviewing files that changed from the base of the PR and between 22e1af1 and 0225eeb.

Files selected for processing: 7
  • src/renderer/src/components/editor/combined-diff/load-sections/combined-diff-load-scheduler.test.ts
  • src/renderer/src/components/editor/combined-diff/load-sections/combined-diff-load-scheduler.ts
  • src/renderer/src/components/editor/combined-diff/load-sections/combined-diff-section-load-registry.ts
  • src/renderer/src/components/editor/combined-diff/load-sections/combined-diff-stale-analysis-work-budget.test.tsx
  • src/renderer/src/components/editor/combined-diff/load-sections/combined-diff-viewport-load-order.test.tsx
  • src/renderer/src/components/editor/combined-diff/load-sections/use-combined-diff-section-loader.ts
  • src/renderer/src/components/editor/combined-diff/load-sections/use-combined-diff-section-retry.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The PR gives rendered, expanded combined-diff rows priority without changing the serial load limit.

  • Combined-diff loading serves rendered rows first and drops stale queued requests.

No actionable issues were found. Tests were reviewed but not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Request a section] --> B{Viewport-only request?}
  B -->|Yes| C{Rendered and expanded?}
  C -->|No| D[Drop pending request]
  C -->|Yes| E[Keep pending request]
  B -->|No| E
  E --> F[Wait for the active load]
  F --> G[Prune obsolete viewport requests]
  G --> H[Pick earliest rendered expanded row]
  H --> I[Otherwise pick earliest retained request]
  I --> J[Load one section]
Loading

Reviews (1) · Last reviewed commit: "Prioritize rendered combined diff reads ..." · Reviewed by Greptile

@OrcaWin
OrcaWin merged commit 8e7ec1a into main Oct 29, 2026
68 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.

1 participant