Skip to content

sessions: improve Send Later scheduling and draft editing - #348610

Merged
Megan Rogge (meganrogge) merged 10 commits into
mainfrom
agents/fix-multiple-issues-in-pr
Nov 16, 2026
Merged

Megan Rogge (meganrogge) merged 10 commits into
mainfrom
agents/fix-multiple-issues-in-pr

Conversation

@meganrogge

@meganrogge Megan Rogge (meganrogge) commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #348482
Fixes #348484
Fixes #348494
Fixes #348497
Fixes #348507
Fixes #348622

Changes

  • Open the time picker directly when Send Later is the only secondary action. Keep the dropdown visibly disabled for empty new-session and in-session inputs.
  • Preserve the conversation's model and configuration when editing scheduled messages, and hide Send Later while editing completed requests.
  • Open scheduled drafts in the editable New Session composer without cancelling the schedule or removing the Drafts entry.
  • Show a themed, text-only "Send in ..." split button. Its primary action saves to the existing schedule and clears back to an empty New Session, even without edits. Only the dropdown opens the time picker. Suppress the send glyph in the disabled state while that picker is open.
  • Offer Send Now in that picker for scheduled drafts. Save current edits before dispatching the existing one-time request, retain input on failure, and keep the first future time focused by default. Keep the scheduled label during dispatch so "No Longer Scheduled" does not flash before the composer clears.
  • Preserve captured attachments and execution settings when saving, reject conflicting schedule changes, retain input after failed saves, and protect unsaved edits during navigation and window shutdown. Ordinary drafts and normal send behavior remain separate.
  • Show relative send times on scheduled messages and scheduled Drafts rows, not ordinary drafts. Reuse the relative-time formatter with minute updates, visibility restoration, and unchanged-label suppression.
  • Preserve picker anchoring when the invoking transcript control is rerendered, including custom calendar navigation.
  • Replace the temporary read-only preview editor with real New Session fixtures and update accessibility help.

Validation

Latest Send Now and CI follow-up validation:

  • Client compilation and changed-file hygiene passed.
  • The following combined Electron regression command passed: 446 tests.
./scripts/test.sh --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentsWindowRegistrations.test.ts --run src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts --run src/vs/workbench/contrib/sessions/test/browser/scheduledChatsService.test.ts --run src/vs/workbench/contrib/sessions/test/browser/scheduledChatTimePicker.test.ts --run src/vs/workbench/contrib/sessions/test/browser/sessionDraftsService.test.ts --run src/vs/sessions/contrib/chat/test/browser/sessionsChatAccessibilityHelp.test.ts --reporter dot
  • Both failing CI jobs had the same stale registration snapshot. Updated only the two entries affected by hiding Send Later during sent-request editing. The exact test also passed in Chromium: 1 test.
node test/unit/browser/index.js --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentsWindowRegistrations.test.ts --browser chromium --reporter dot
  • Live macOS Code OSS validation: Enter saved the draft without dispatching; keyboard navigation explicitly selected Send Now; unsaved text reached the resulting session and received the requested response; one resulting session and no remaining test schedule. Existing scheduled drafts remained untouched.
  • A focused regression test covers the transient label during admission and composer clearing. New CI results were not polled.

Earlier validation:

  • corepack pnpm run gulp compile-client — passed with zero compilation errors.
  • corepack pnpm run valid-layers-check — passed.
  • corepack pnpm run build-fast --client-only — passed; final test output was current.
  • Final combined regression command below — 1,491 passed, 2 pending.
./scripts/test.sh \
  --run src/vs/sessions/contrib/chat/test/browser/newChatWidget.test.ts \
  --run src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPart.test.ts \
  --run src/vs/workbench/contrib/chat/test/browser/widget/chatListRenderer.test.ts \
  --run src/vs/workbench/contrib/sessions/test/browser/scheduledChatsService.test.ts \
  --run src/vs/workbench/contrib/sessions/test/browser/sessionDraftsService.test.ts \
  --run src/vs/workbench/contrib/sessions/test/browser/chat/sharedChatInputComposer.test.ts \
  --reporter dot
  • Original issue-focused command below — 1,356 passed, 6 skipped before the subsequent composer follow-ups.
./scripts/test.sh --reporter dot \
  --run src/vs/platform/quickinput/test/browser/quickinput.test.ts \
  --run src/vs/sessions/contrib/chat/test/browser/sharedChatInputComposerActions.test.ts \
  --run src/vs/workbench/contrib/chat/test/browser/widget/chatWidget.test.ts \
  --run src/vs/workbench/contrib/chat/test/browser/widget/chatListRenderer.test.ts \
  --run src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPart.test.ts \
  --run src/vs/workbench/contrib/sessions/test/browser/scheduledChatsService.test.ts \
  --run src/vs/workbench/contrib/sessions/test/browser/scheduledChatTimePicker.test.ts
  • Canonical formatting and explicit-file hygiene, including oxlint and CSS checks — passed:
(git diff --name-only --diff-filter=ACM -z -- '*.ts'; git ls-files --others --exclude-standard -z -- '*.ts') | xargs -0 node build/lib/formatter.ts --replace --verify
(git diff --name-only --diff-filter=ACM -z; git ls-files --others --exclude-standard -z) | xargs -0 node build/hygiene.ts
git diff --check
  • Component Explorer: all six scheduled-draft fixtures rendered and disposed without errors; standard dark/light/high-contrast and narrow dark/light appearances inspected.
  • Native screen-reader testing and full integration/smoke suites were not run.

Live Code OSS Agents validation (macOS)

Check Result
#348482 Passed: one click opens time presets directly.
#348484 Passed: scheduled inline editing retains the selected model and execution configuration; edits save successfully.
#348494 Passed: Send Later is absent while editing completed requests.
#348497 Passed: scheduled drafts open as editable New Session input, retain their Drafts entry and schedule, and reopen with saved text.
#348507 Passed: preset-to-calendar transition, month navigation, and countdown updates preserve anchoring.
Relative time Passed: countdown updates once across a minute boundary without replacing its control or moving the calendar. Ordinary drafts keep their ordinary descriptions.
Scheduled primary action Passed with unchanged and edited input: saves, clears the composer, retains one scheduled entry, and does not open a picker or send immediately.
Picker appearance Passed: the dropdown opens the picker; its disabled text-only primary shows no stray glyph.
Delivery Passed during original validation: Send Now creates the new session; a rescheduled existing-chat message dispatches automatically and receives a response.

Manual checks

  1. With Send Later enabled and a supported local agent, check empty New Session and existing-chat inputs: the dropdown must look disabled and reject activation. Type a request and use the dropdown to open time presets directly.
  2. Schedule a new-session request. Open it from Drafts: it should appear in the real, editable New Session composer, with a colored "Send in ..." control.
  3. Edit its text or settings and activate the primary "Send in ..." action. Expect an empty New Session, one retained scheduled draft, and no picker or immediate send. Reopen to confirm the saved edits. Repeat without edits.
  4. Use only the dropdown to change the time. While the picker is open, check that the disabled primary has no stray icon. Cancel and confirm the content remains.
  5. In an existing conversation with a non-default model/configuration, schedule and edit a message. Confirm the inline input retains those choices. Edit a completed request and confirm Send Later is absent.
  6. Open the custom calendar and navigate months. Leave it open across a minute boundary: it should stay anchored while the relative countdown updates.
  7. Compare scheduled and ordinary Drafts entries: only scheduled ones should say "Sends in ...". Navigate away with unsaved scheduled edits and confirm they remain available in New Session.
  8. Open a scheduled draft, edit its input, then open the dropdown. Send Now should appear above the future times, but In 5 Minutes should initially be focused. Choose Send Now explicitly: the edited request should send once, the composer should clear without flashing "No Longer Scheduled", and the scheduled entry should disappear. Enter in the composer must still save for later.

Open single send options directly, preserve the conversation model during scheduled edits, hide scheduling for sent-request edits, and keep scheduled drafts intact when opened. Retain picker anchors across rerenders and show minute-refreshed time remaining.

Fixes #348482\nFixes #348484\nFixes #348494\nFixes #348497\nFixes #348507

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 17:55
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 278203b4 Current: 8666b9b2

Changed (24)

sessions/sessionActivityBar/sessionActivityBar/Narrow/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/WorkspaceChat/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/NearlyWide/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/Wide/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/NarrowActivityBarDisabled/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/WideActivityBarDisabled/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/SplitGroup/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ExternalSessionBanner/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ExternalSessionBannerWide/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ChatWithoutWorkspace/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/WithoutLayoutActions/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/NewChanges/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/GitHubReferences/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/MultipleGitHubReferences/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/CheckedGitHubReferences/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/Moved/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/AtBottom/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumn/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnCompact/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnNormalSize/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnNormalSizeCompact/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnNewChanges/Light
Before After
before after
sessions/sessionActivityBar/sessionActivityBar/ChatWindowColumnWithoutLayoutActions/Light
Before After
before after
chat/terminalFullOutput/chatTerminalFullOutput/Expanded no full output/Light
Before After
before after

Added (2)

sessions/chat/newWidget/newChatWidget/ScheduledDraft/Light

current

sessions/chat/newWidget/newChatWidget/ScheduledDraftNarrow/Light

current

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The registration snapshot is stale and causes a test failure, while the preview is blank on first open and Send Later remains available during request editing, producing an error.

3 open issues
What changed in this PR

This PR improves Send Later in the Agents Window, preserving scheduled drafts when opened and refining editing, timing, and preview behavior using shared chat and Quick Input components.

Changes:

  • Opens the time picker directly for a single send option, preserves model settings during scheduled edits, and adds sent-request editing guards.
  • Adds pinned, read-only scheduled-draft previews that follow schedule changes.
  • Adds live countdown labels, preserves detached picker anchors, and expands tests and accessibility help.
File Description
src/​vs/​workbench/​test/​browser/​componentFixtures/​sessions/​scheduledChatEditor.fixture.ts Adds scheduled and completed preview fixtures.
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​scheduledChatsService.test.ts Tests schedule preservation and preview reuse.
src/​vs/​workbench/​contrib/​sessions/​browser/​scheduledChatsService.ts Opens editor previews without cancelling schedules.
src/​vs/​workbench/​contrib/​sessions/​browser/​scheduledChatEditor.ts Adds the read-only scheduled-request editor.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​input/​chatInputPart.test.ts Tests direct and multi-option send actions.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​chatWidget.test.ts Tests model inheritance during scheduled edits.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widget/​chatListRenderer.test.ts Tests countdown updates and stable controls.
src/​vs/​workbench/​contrib/​chat/​common/​model/​chatViewModel.ts Exposes scheduled send timestamps.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatQueuePickerActionItem.ts Runs a lone secondary send action directly.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatWidget.ts Initializes inline edits with conversation model settings.
src/​vs/​workbench/​contrib/​chat/​browser/​widget/​chatListRenderer.ts Refreshes countdown labels without rerendering messages.
src/​vs/​sessions/​services/​sessions/​browser/​sessionsCoreServices.registration.ts Registers the scheduled-request editor.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sharedChatInputComposerActions.test.ts Tests editing-related Send Later visibility guards.
src/​vs/​sessions/​contrib/​chat/​browser/​sharedChatInputComposer.contribution.ts Adds editing guards to Send Later.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsChatAccessibilityHelp.ts Documents previews, countdowns, and updated interactions.
src/​vs/​platform/​quickinput/​test/​browser/​quickinput.test.ts Tests picker positioning after anchor removal.
src/​vs/​platform/​quickinput/​browser/​quickInputController.ts Retains geometry for detached picker anchors.

Review effort: Balanced

Initialize the chat widget as visible when its editor view is created. Let the fixtures exercise the same first-open lifecycle rather than explicitly making the view visible.

Refs #348497

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-code-engineering

vs-code-engineering Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

TylerLeonhardt

Matched files:

  • src/vs/platform/quickinput/browser/quickInputController.ts
  • src/vs/platform/quickinput/test/browser/quickinput.test.ts

Sandeep Somavarapu (@sandy081)

Matched files:

  • src/vs/workbench/contrib/sessions/browser/scheduledChatsService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionDraftsService.ts

Ladislau Szomoru (@lszomoru)

Matched files:

  • src/vs/workbench/contrib/sessions/browser/scheduledChatsService.ts
  • src/vs/workbench/contrib/sessions/browser/sessionDraftsService.ts

Apply the repository formatter to the relative-time conditional so the changed-file hygiene check passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge
Megan Rogge (meganrogge) marked this pull request as draft November 16, 2026 18:22
Keep scheduled requests editable without cancelling their schedules. Save through the primary Send in control and clear the composer; reserve the dropdown for rescheduling. Preserve ordinary drafts, show relative scheduled times, and keep disabled submit controls visually consistent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge Megan Rogge (meganrogge) changed the title sessions: fix Send Later editing and scheduled draft previews sessions: fix Send Later scheduling and draft editing Nov 16, 2026
Preserve saved-draft identity, cancellation and focus handling alongside scheduled draft editing. Capture the normalized scheduled target after restoration completes without allowing startup defaults to overwrite it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-code-engineering

This comment has been minimized.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

Demo of 25b1290

Send Later opens time presets directly and scheduled drafts stay scheduled while being edited.

Send dropdown opens time presets directly

Before (main) After (this pull request)
One click opens a menu containing Send Later; another click is needed to reach time presets.
One click opens a menu containing Send Later; another click is needed to reach time presets.
One click on the send dropdown opens the Send Later time presets.
One click on the send dropdown opens the Send Later time presets.

Scheduled draft opens in the editable composer

Before (main) After (this pull request)
Opening the scheduled draft cancels its schedule, removes its Drafts entry, and restores ordinary input with a normal send arrow.
Opening the scheduled draft cancels its schedule, removes its Drafts entry, and restores ordinary input with a normal send arrow.
The draft stays scheduled; the colored, text-only Send in button saves changes. Reopening confirms the edited text was saved.
The draft stays scheduled; the colored, text-only Send in button saves changes. Reopening confirms the edited text was saved.

Drafts show the time remaining

Before (main) After (this pull request)
The scheduled draft shows an absolute date and time, truncated by the sidebar width.
The scheduled draft shows an absolute date and time, truncated by the sidebar width.
The scheduled draft stays in Drafts and shows Sends in 59 minutes.
The scheduled draft stays in Drafts and shows Sends in 59 minutes.

The change, on this pull request's build:

after.mp4
The same steps on main
before.mp4

Recorded by an agent on a build of this pull request merged with main, signed out, with a mock model. It can be wrong. Workflow run

Tip

Was this useful? React to this comment with 👍 or 👎.
On the VS Code team? Say what was wrong or missing.

@meganrogge Megan Rogge (meganrogge) changed the title sessions: fix Send Later scheduling and draft editing sessions: improve Send Later scheduling and draft editing Nov 16, 2026
Align the snapshot with the sent-request editing guards in the command palette and send dropdown.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Offer immediate sending in the scheduled draft time picker while preserving the future-time default and save-for-later primary action. Save current edits before dispatch, retain input on failure, and avoid flashing a terminal label while the composer clears.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical scheduled-draft restoration and preview-state bugs can overwrite or discard user edits, silently change execution settings, and block normal navigation when a request is no longer scheduled.

5 open issues
3 resolved since last review

Review effort: Max

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore complete descriptor settings, guard asynchronous restoration, and track edits even when restoration fails. Retain local changes when a schedule becomes unavailable and report rejected submit overrides without clearing input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@meganrogge
Megan Rogge (meganrogge) marked this pull request as ready for review November 16, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-demo A PR demo was recorded for this pull request

Projects

None yet

6 participants