Skip to content

sessions: polish scheduled-message previews and inline editing - #348704

Open
Elijah King (eli-w-king) wants to merge 7 commits into
mainfrom
eli/agents/scheduled-message-hover
Open

Elijah King (eli-w-king) wants to merge 7 commits into
mainfrom
eli/agents/scheduled-message-hover

Conversation

@eli-w-king

@eli-w-king Elijah King (eli-w-king) commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Adds a preview to the scheduled-message clock in the sessions list, with each message, the time remaining, and Edit, Send Now, and Cancel Schedule actions.

Scheduled messages keep their inline editor, now with Cancel and a timed Send split button such as "Send Today at 3:07 PM". The primary button saves for that time; the dropdown changes the time. Hover or focus the relative timestamp to see the exact local date and time, without seconds or a time-zone suffix.

This builds on #348610 and preserves its New Session composer, Send Now, model configuration, and scheduling fixes. Editing stays inside the scheduled prompt and never replaces the main composer's draft.

Try it

  1. Enable chat.automations.enabled and sessions.sendLater.enabled, then schedule a message in an existing chat.
  2. Hover over or click that session's clock. The clock stays in place when the row's actions appear.
  3. Choose Edit to return to the original message. Use the timed Send button to save, its dropdown to reschedule, or Cancel to leave the schedule unchanged.
  4. Hover or keyboard-focus a scheduled message's timestamp to see its exact local send time.

The preview also opens with Enter or Space when the clock is focused. Tab reaches the message actions, arrow keys move between them, and Escape closes the preview.

Show scheduled messages and their relative send times from the session clock, with the existing Edit, Send Now and Cancel Schedule actions. Reveal the original chat for inline editing without replacing its composer draft.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 21:29
@vs-code-engineering

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: abe19dbe Current: e4eb608a

Changed (5)

sessions/artifactIntegrations/PullRequestCommentsInformation/Light
Before After
before after
sessions/sessionsList/SessionsList_ScheduledHoverActions/Light
Before After
before after
sessions/sessionsList/SessionsList_ScheduledHoverActionsCompact/Light
Before After
before after
chat/widget/chatWidget/PendingMessages/Scheduled/Light
Before After
before after
chat/widget/chatWidget/PendingMessages/ScheduledNarrow/Light
Before After
before after

@vs-code-engineering

This comment has been minimized.

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 scheduled-message preview has unresolved lifecycle and input-handling defects: row refreshes dismiss it, parent hover and touch handling interfere with activation, and Escape fails to restore keyboard focus.

4 open issues
What changed in this PR

Adds scheduled-message previews to the sessions list, building on #348610’s Send Later workflow so users can inspect and manage scheduled messages without first opening the chat.

Changes:

  • Adds clock-triggered previews with message text, relative send times, and Edit, Send Now, and Cancel Schedule actions.
  • Updates Edit to navigate to the original chat when needed while preserving the composer draft.
  • Adds regression tests and keyboard-accessibility guidance.
File Description
src/​vs/​workbench/​contrib/​sessions/​test/​browser/​scheduledChatsService.test.ts Tests draft preservation and failed Edit navigation.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsView.ts Groups scheduled requests by session for previews.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsList.ts Connects session clocks to preview content and actions.
src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionScheduledRequestsCard.ts Renders scheduled-message cards and action bars.
src/​vs/​workbench/​contrib/​sessions/​browser/​scheduledChatsService.ts Opens the original chat for editing and handles navigation failure.
src/​vs/​workbench/​contrib/​sessions/​browser/​media/​sessionsList.css Styles preview cards and keeps the clock visible beside row actions.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​pendingSessionsList.test.ts Tests preview activation, refreshed actions, and stale-request handling.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsChatAccessibilityHelp.ts Documents preview navigation and available actions.

Review effort: Balanced

@meganrogge Megan Rogge (meganrogge) added this to the 1.148.0 milestone Nov 16, 2026
Use a timed Send split button when editing a scheduled prompt, and reveal local send times on hover or focus. Reuse the visibility-aware time updater and preserve the original composer draft.

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

Megan Rogge (meganrogge) commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

The change looks nice 🤩 ! The comments are worth addressing. I'd suggest having Copilot max do a review as well 😄 once all of your changes are pushed.

Keep hidden scheduled-message toolbars out of pointer hit testing and position visible toolbars within the gap above their own message.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@eli-w-king Elijah King (eli-w-king) changed the title sessions: preview scheduled messages from the sessions list sessions: polish scheduled-message previews and inline editing Nov 16, 2026
@vs-code-engineering

This comment has been minimized.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Sandeep Somavarapu (@sandy081)

Matched files:

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

Ladislau Szomoru (@lszomoru)

Matched files:

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

@vs-code-engineering

This comment has been minimized.

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 scheduled-message preview has unresolved interaction bugs: row hover overrides it, touch taps activate the session, keyboard dismissal loses focus, and row refreshes unexpectedly close it.

5 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity A locked preview prevents opening another session preview

src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsList.ts:1990

While a pinned preview is open, clicking or pressing Enter on another session's clock cannot open its preview. The current hover is locked, and the clock's propagation guards bypass outside-click dismissal. Force-hide the current hover before showing the newly requested one.

Medium severity Click-opened preview is not focused, so Escape cannot dismiss it

src/​vs/​workbench/​contrib/​sessions/​browser/​views/​sessionsList.ts:1996

After opening the preview by clicking the clock, Escape does not close it. This call leaves focus outside the card, while sticky: true prevents HoverService from installing its outside key handlers; the Escape handler lives on the hover itself. Focus the explicitly opened preview so Escape reaches that handler and Tab reaches its actions.

Review effort: Max

Keep the clock target stable across same-session renders, isolate its hover and touch events, and restore keyboard focus on dismissal. Cover the behavior with the real hover service, intersection observers and touch gestures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make native intersection-observer assertions independent of document scrolling from earlier tests.

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

This comment has been minimized.

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 98ac075

The session clock previews scheduled messages, and inline editing replaces Save with timed Send.

Scheduled-message clock preview

Before (main) After (this pull request)
Hovering where the clock was replaces it with Mark as Done; no scheduled-message preview opens.
Hovering where the clock was replaces it with Mark as Done; no scheduled-message preview opens.
The clock opens a preview with the message, remaining time, and Edit, Send Now, and Cancel Schedule actions.
The clock opens a preview with the message, remaining time, and Edit, Send Now, and Cancel Schedule actions.

Scheduled-message inline editing

Before (main) After (this pull request)
Editing the same scheduled message shows a plain Save button beside Cancel, with a separate time picker.
Editing the same scheduled message shows a plain Save button beside Cancel, with a separate time picker.
Cancel leaves the schedule unchanged; the timed Send split button saves edits for the displayed time.
Cancel leaves the schedule unchanged; the timed Send split button saves edits for the displayed time.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Five remaining issues reproduced in real, signed-in Windows Code OSS, with PR head 98ac0756be65c87b2bd0b144221dab2ae8f59dd4 merged locally onto pinned main 44d7d77b38739b0f07e3d7344b53e4754e1b269f (clean merge). Each inline comment includes reproduction steps, expected/actual behavior, and a code permalink.

The normal scheduling, inline save/cancel/reschedule, composer-draft preservation, new-session scheduled-draft, and one-time delivery flows worked. Focused Chromium tests passed on both main (85) and the merged candidate (96); the merged client type-check and targeted lint also passed. Three merged Electron layout tests exceeded the default five-second timeout but passed when isolated with a 30-second allowance.

These are separate from the earlier clock-refresh, parent-hover, touch, keyboard-opened Escape-restoration, and compact-chevron comments, whose fixes were verified at this head. No pre-existing or runtime-unverified issue is included below.

indicator.removeAttribute('aria-hidden');
indicator.setAttribute('role', 'button');
indicator.setAttribute('aria-label', localize('showScheduledMessages', "Show Scheduled Messages"));
const showHover = (focus: boolean) => this.hoverService.showInstantHover({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Allow switching between explicitly opened clock previews

Repro

  1. Enable chat.automations.enabled and sessions.sendLater.enabled.
  2. In two existing sessions, A and B, schedule a message for later in each.
  3. Click A's clock to open its preview.
  4. Without dismissing it elsewhere, click B's clock.

Expected: B's scheduled-message preview opens.
Actual: A's preview remains open with A's content; B's clock appears to do nothing. Reproduced in the merged Windows Code OSS build.

The preview is sticky/locked. The clock's mousedown propagation guard prevents the document's outside-click handler from dismissing the current hover, and showInstantHover then refuses to replace a locked hover. Please explicitly dismiss the existing sticky hover before opening a different clock's preview; activating the same clock could toggle it closed. A regression should use the real hover service and two clock targets.

Code: explicit sticky-hover opening

}
store.add(DOM.addDisposableListener(indicator, DOM.EventType.CLICK, e => {
DOM.EventHelper.stop(e, true);
showHover(false);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Make mouse-opened previews dismissible with Escape

Repro

  1. With Automations and Send Later enabled, schedule a message in an existing session.
  2. Click the session's clock to open the preview.
  3. Press Escape without first clicking or tabbing into the preview.

Expected: The preview closes and focus returns to/remains on the clock.
Actual: The preview stays open; focus is still on the clock. Reproduced in the merged Windows Code OSS build. The Enter/Space-opened path does close and restore focus correctly, so this is not the earlier keyboard-opened focus-restoration issue.

The click handler calls showHover(false), leaving focus outside the sticky hover. Sticky hovers do not install the outside key handlers, while the Escape handler is attached to the hover's own DOM subtree. Please focus the explicitly opened preview with a restorable focus target, or provide lifecycle-owned Escape handling for the pointer-opened path. Add a real click-then-Escape regression, not only Enter-then-Escape.

Code: click opens without focus

this.editingRequest.set({ id: automation.id, state }, undefined);
const conversation = automation.conversation ?? handoff?.conversation;
const session = conversation && this.sessionsManagementService.getSession(conversation.sessionResource);
if (conversation && session && ![...this.chatInputs.keys()].some(widget => widget.visible && isEqual(widget.viewModel?.sessionResource, conversation.chatResource))) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Reveal the scheduled row when Edit targets an already-visible chat

Repro

  1. Enable Automations, Send Later, and inline request editing.
  2. In a long existing conversation, schedule a message so its scheduled row is at the bottom of the transcript.
  3. Keep that chat open, focus the transcript, and press Ctrl+Home so the scheduled row is outside the rendered viewport.
  4. Click the session's clock, hover the preview's message row to reveal its actions, and choose Edit.

Expected: The transcript reveals the selected scheduled message and focuses its inline editor, preserving the unrelated main-composer draft.
Actual: No scheduled editor appears and the transcript stays at the top, even though the service has entered editing state. In the live repro there were zero rendered scheduled rows and zero visible scheduled editors after Edit.

The visibility check skips navigation when the chat widget is already visible, but visibility of the widget does not imply visibility of this particular virtualized row. Updating the scheduled requests preserves the non-bottom scroll position. Please reveal and focus the target scheduled row after entering edit mode, including this already-visible-chat path, without replacing the main composer input.

Code: visible-chat shortcut

updateTime(request.description);
}
append(row, $('span.session-scheduled-card-text', { 'aria-hidden': 'true' }, text));
const actions = CARD_ACTION_IDS.map(id => request.actions.find(action => action.id === id)).filter(isDefined);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Keep an action available for a message that is already being edited

Repro

  1. With Automations and Send Later enabled, schedule a message in session A and enter its inline editor.
  2. Leave the edit active and switch to session B.
  3. Click A's clock and hover the message row in its preview.

Expected: The preview still offers a way to return to the active edit or otherwise manage it.
Actual: The message remains in the preview, but every action disappears. The real Windows repro produced zero action buttons, even while the row was hovered.

While requestEditing is active, the service supplies Save / Change Send Time / Cancel Edit rather than Edit / Send Now / Cancel Schedule. Filtering exclusively through CARD_ACTION_IDS therefore produces an empty action bar. Please account for editing-state requests and retain a way back to their editor. If that uses editAction, the same-request early return in startEditing also needs to allow navigation back to the original conversation.

Code: action filtering | Editing-state actions

const scheduledRequests = this.options.scheduledRequests;
const getRequests = () => scheduledRequests?.get().get(getComparisonKey(element.resource)) ?? [];
const run = async (requestId: string, actionId: string) => {
this.hoverService.hideHover(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Preserve keyboard focus when an action removes the last scheduled clock

Repro

  1. With Automations and Send Later enabled, create exactly one scheduled message in an existing session.
  2. Focus its clock with the keyboard and press Enter to open the preview.
  3. Press Tab, then Right Arrow twice to reach Cancel Schedule, and press Enter.
  4. Repeat with another scheduled message, using Right Arrow once to select Send Now instead.

Expected: After the action removes the clock, keyboard focus remains on a surviving control, such as the owning session row/list.
Actual: Both Cancel Schedule and Send Now leave document.activeElement on document.body, so keyboard users lose their place. Send Now itself successfully dispatched the request once; this finding is about focus after the action.

hideHover(true) first restores focus to the clock for a keyboard-opened preview. The action then removes the last scheduled request, the indicator loses its visible class and becomes display: none, and the restored focus target disappears. Please provide a fallback focus target after the action when the clock is gone, without stealing focus if the action deliberately moved it elsewhere. Cover both last-message cancellation and dispatch.

Code: hover closes before the action | Clock visibility update

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Elijah King (@eli-w-king) Please consider feedback.

@rwoll Ross Wollman (rwoll) added the pr-demo A PR demo was recorded for this pull request label Nov 17, 2026

This branch has not been deployed

No deployments
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

Development

Successfully merging this pull request may close these issues.

5 participants