Skip to content

perf: faster cold start and lists; fix e2e-views nightly - #2

Merged
cursor[bot] merged 2 commits into
masterfrom
cursor/perf-runtime-hotspots-bbe7
Sep 16, 2026
Merged

cursor[bot] merged 2 commits into
masterfrom
cursor/perf-runtime-hotspots-bbe7

Conversation

@wangqiqi

@wangqiqi wangqiqi commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Why

LanPM already has virtual chat lists, lazy group views, and a 2000-message memory window. Remaining runtime cost was still on the first-window path and the chat module graph: emoji-mart, react-markdown, and highlight.js were parsed for every cold start / chat paint, and composer keystrokes rebuilt the virtual list.

This PR also fixes GitHub Actions run 34779106284 (e2e-nightly / verify:e2e-views) on the same branch.

P2P, IPC, i18n, and AES-GCM/TOFU behavior are unchanged.

CI fix (verify:e2e-views)

Evidence (job 103782704966, step 8 ~line 338):

TimeoutError: locator.click: Timeout 30000ms exceeded.
waiting for getByTestId('nav-tab-board')
locator resolved to <button … data-testid="nav-tab-board">
<rect … pointer-events="auto" …> subtree intercepts pointer events
at fixtures/setup.ts:127 clickBottomNavTab
at views-tab-smoke.spec.ts:21

The board tab was in the DOM. Antd Tour’s SVG mask from DiscoverCoachmark intercepted the click. Discover E2E already dismisses that overlay; views smoke did not. After mock catalog defaulted off, LANPM_E2E=1 also stopped seeding demo-project, so a zero-group first-run Tour was likely on screen.

Fix:

  • LANPM_E2E=1 seeds demo-project again (overrides LANPM_NO_DEMO)
  • TopBar closes the coachmark once any group exists (Tour must not cover chrome)
  • clickBottomNavTab / setup dismiss leftover .ant-tour before clicking nav-tab-*
  • Nightly (and other workflows) bump actions/checkout and actions/setup-node v4 → v5 so Actions stops forcing the Node 20 runtime onto Node 24

Performance (kept)

1. App startup / cold start

createWindow() first; scheduleDeferredStartup() runs file repairs, AI patrol/probe, meeting reminders, and screenshot init on setImmediate. electron-screenshots loads on first capture. Setup wizard is React.lazy.

2. Chat rendering / message list

Memo + useMemo rows on ChatVirtualMessageList; overscan 8 → 4. emoji-mart / Markdown / CodeBlock / voice / chat modals load only when needed.

3. Long-list scrolling

No virtuoso (SPRINT-60 NO-GO). Board KanbanCard memo; files previewers lazy + content-visibility: auto.

4. Memory / RSS

Heavy modules stay out of RSS until used. loadMessages trims through CHAT_MEMORY_WINDOW (2000).

Verify (this VM)

Green:

  • npm run typecheck
  • Perf guards from the first commit (verify:chat-perf* · verify:list-scroll · verify:core-views-perf · verify:measure-perf · …)
  • CI fix: vitest seed + coachmark unit tests · verify:ci-e2e-nightly · verify:discover

Not run here: Electron GUI verify:e2e-views / measure:perf (Electron dist not installed in this agent image; electron package reports “failed to install correctly”). Re-run on a desktop or let e2e-nightly workflow_dispatch:

xvfb-run -a npm run verify:e2e-views

Out of scope

  • No P2P/IPC/i18n/crypto changes
  • No rewrite, no virtuoso
  • No version bump / tag (CHANGELOG [Unreleased] only)
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 16, 2026 13:35
Move file-path repairs, AI schedulers, meeting reminders, and the
screenshot module off the first-window path so ready-to-show is not
blocked by unused work. Lazy-load emoji-mart, markdown/highlight,
chat modals, and file previews; memoize the virtual message list so
composer typing does not rebuild rows.

Co-authored-by: kenneth <zhou24388@163.com>
verify:e2e-views timed out clicking nav-tab-board because antd Tour's
SVG mask intercepts pointer events. LANPM_E2E now seeds demo-project,
TopBar closes the coachmark once groups exist, and tab clicks dismiss
any leftover overlay. Also bump checkout/setup-node to v5 (Node 24).

Co-authored-by: kenneth <zhou24388@163.com>
@cursor cursor Bot changed the title perf: faster cold start, chat list, and long-list rendering perf: faster cold start and lists; fix e2e-views nightly Sep 16, 2026
@cursor
cursor Bot merged commit e585dc0 into master Sep 16, 2026
3 checks passed
@cursor
cursor Bot deleted the cursor/perf-runtime-hotspots-bbe7 branch September 16, 2026 13:54
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