Skip to content

Wait for /new session switch in Playwright e2e - #1

Merged
Shadowfetchapps merged 2 commits into
mainfrom
cursor/fix-e2e-new-task-selection-d786
Sep 20, 2026
Merged

Shadowfetchapps merged 2 commits into
mainfrom
cursor/fix-e2e-new-task-selection-d786

Conversation

@Shadowfetchapps

@Shadowfetchapps Shadowfetchapps commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Main Checks / verify failed on Playwright e2e (run 35506536999). new-task shortcuts and deletion keep task selection usable failed at expect(toDelete).not.toBe(first).

/new did create a session, but it cleared the composer first and only wrote shadow:selected after activateSession. The empty prompt made the UI look switched while localStorage still held the old id.

This restores the product contract: sending /new commits the new session id as soon as createSession returns, does not persist /new as a draft, and lets openSession clear the composer. The original assertion — empty prompt means selection already changed — holds again. The test still waits for the “Opening task…” overlay before delete so palette actions do not run mid-switch.

Root cause

0.19.0 made session activation async. /new emptied the composer before that activation finished, so selection lagged the visible idle composer.

Verified locally

  • npm --prefix ui run build
  • npm --prefix ui test — 5 passed
  • cd ui && npm run test:e2e — 7 passed
  • new-task shortcuts and deletion keep task selection usable — passed 3 times (full suite + 2 isolated reruns)

Do not merge from this agent.

Open in Web Open in Cursor 

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 15987de7-c7e7-40b9-8c2e-a273f6163639


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.

Sending /new clears the composer before activateSession writes
shadow:selected, so the new-task test was reading the old id during
the Opening task overlay. Wait for that switch like the delete path.

Co-authored-by: Bob Corbin <ShadowfetchLinux@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/fix-e2e-new-task-selection-d786 branch from 16c08cb to 92f05f8 Compare September 20, 2026 11:13
Sending /new used to empty the prompt immediately, then activate the
session and only then write shadow:selected. The e2e contract — and
the UI — treat an empty composer as "already on the new task".

Commit the selected id when createSession returns, skip persisting
/new as a draft, and let openSession clear the composer so selection
is in place before the prompt looks idle.

Co-authored-by: Bob Corbin <ShadowfetchLinux@users.noreply.github.com>
@Shadowfetchapps
Shadowfetchapps marked this pull request as ready for review September 20, 2026 15:59
@Shadowfetchapps
Shadowfetchapps merged commit 63eabf3 into main Sep 20, 2026
2 checks passed
@Shadowfetchapps
Shadowfetchapps deleted the cursor/fix-e2e-new-task-selection-d786 branch September 28, 2026 23:47
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