chat windows: chat windows of the Agents window on parts, with drag and drop between parts (#345683)
* Chat window: layout model and stacked input-only rules in the workbench
Move two pure models of a chat window to src/vs/workbench/contrib/chatWindow/common,
with their tests, renamed to chat window names:
- chatWindowLayout.ts, from the session grid layout model of I2 (#345075): the layout
modes (Chat only, Editor only, Stacked, Side by Side), the grid topology per mode and
terminal position, the activity bar column, the tab order, and when a layout change
needs a rebuild.
- chatWindowInputOnly.ts, from the stacked input-only rules of I4 (#345077): when the
chat in Stacked collapses to its input, while dragging, on resize and when the window
forces it.
Behaviour and test assertions are unchanged. Nothing uses them yet.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: a chat input can lay its editor out one line tall
ChatInputPart.setSingleLine lays the input editor out exactly one line tall, whatever its content or minimum lines, for
the input-only chat of a chat window. Moved here from #345663, whose only consumer this is.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* editor: the Add Tab entries act on the group of their tabs bar
The Add Tab control runs its entries with the group of the tabs bar, so that they act on that group rather than on the
active one, such as in a chat window whose window does not have focus yet. Moved here from #345663, whose only consumer
this is.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: links in chat markdown open with the opener of the renderer's scope
The chat markdown renderer opens links with the opener service of its scope, such as of the window that shows the chat,
rather than the global one. Moved here from #345663, whose only consumer this is.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the chat composite bar and the card frames follow a chat surface outside the Sessions part
The header's background and the frame ownership of a card apply to a chat surface as to the Sessions part, and the
tests of the Sessions part mark it as a chat surface, as the part's chat background now does. Moved here from #345663,
whose only consumer this is.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: show sessions outside the Sessions part grid
The Agents window can only show a session in the Sessions part grid of its
main window. Add window sessions: ISessionsService.showSessionInWindow shows
one chat of a session outside the grid, in a session view registered with
ISessionsPartService.registerWindowSessionView. A chat shown that way leaves
the tabs of its session in the grid, and the session leaves the grid when that
chat was its only one; closeSession stops showing it.
Active session rule: a session shown in another window becomes active while
that window has focus, unless it is shown passively; the main window's layout
follows its own session. The sessions list, layout controllers, Changes, the
terminal and the agent host provider follow mainWindowActiveSession, which is
the active session while no other window shows a session. The agent host
provider treats sessions shown in other windows as shown, for chat config and
loading.
Nothing shows a session in another window yet, so behavior does not change. A
test covers that the main window follows the active session without other
windows.
Ported from agents/sessions-window-sessions 94f6c110d69, 5ec09ac3f48,
664d4e717db and 4a10fdb1bb8, e08ab865cad.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: let session actions act on a given session
The title bar's Changes, pull request and review actions, the Changes view and
editor, and the Agent Merge context keys always act on the active session, so
they cannot serve a session that is shown but not active. Make them take a
session:
- Actions resolve their session from an explicit argument (by resource,
against the sessions shown in the grid and in other windows), else from the
main window's active session.
- ISessionScope gives a view or editor its session; the Changes view, summary,
picker, changeset selection, editor, resolver and review actions read their
changes through IChangesViewService.getSessionChanges(session).
- Session action context keys are bound per context key service, so a title bar
hosted for a non-active session gets its own scoped keys; their observables
only react to the keys they read.
Without an argument and without other windows every action still targets the
active session, so behavior does not change.
Squashed from agents/session-scoped-titlebar-actions (94b140fb23d, 4000cd23529,
46bf53f9e44, 376161c28b5, 170261683c6, 49ae8b2654e, 0be0e134bef, 258419ba130,
6b76d9d947c, 15b99a7f6e4, 42e61c7cd4d, 9e5e58f7a75, a26d679dd55, 0515ba584b9,
31e44e57cca, f575613f549), with 993cf42ec96, 2f339933667 and 65c2e7c69c1 for
the main window's session.
A Changes editor shows the changes of the chat its source names, from that chat
only: whichever chat or session is active and whichever window has focus, so
that two editors of two chats of a session, in one window or not, each show
their own (ISessionChangesEditorOptions.chatResource,
getChangesEditorChanges). The main window's editor, which names no chat, shows
the chat the main window shows for its session, as its active session or a
session of its grid, never the session another window shows or has focus, as on
main; once the main window does not show its session, such as when the editor
moves into the window a chat of its session opens in, the chat that window shows. Fix Checks sends its prompt to the widget of the chat its session shows.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: let session views be hosted outside the Sessions part, with an input-only chat view
A session view only works inside the Sessions part: it always shows the session
header and the Session Activity Bar, and its chat input always takes the main
window's options. Session views, chat groups and chat views now take
ISessionViewHostOptions, so a host outside the Sessions part can hide the
session header and the Session Activity Bar and configure the chat input
(placeholder, minimum lines, status pills). SessionView exposes its primary chat
view, and Sessions part styles also apply under
.sessions-window-host.
The chat view gains an input-only mode: it shows only the input, with the latest
message and the progress or outcome of its response above it, and switches back
to the conversation when the chat waits for input that only the conversation
can show. Waiting for input, failing and cancelation are announced once to screen
readers, and nothing is read from the chat until input-only is enabled. While
input-only, the input editor is laid out exactly one line tall
(ChatInputPart.setSingleLine, from the workbench parts foundation).
The Sessions part passes no host options and nothing enables input-only mode,
so behavior does not change.
Ported from agents/sessions-window-sessions c0685f56d02, 10fb2354aa6,
5de12de1983, adapted to the Session Activity Bar taking its own column.
Carried for the chat windows on parts without the two input-only context keys
(sessions.chatViewInputOnlyEnabled, sessions.chatViewInputOnly), which nothing read,
and without ChatInputPart.setSingleLine, which the workbench parts foundation
carries.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: share the chat background surface beyond the Sessions part
The Sessions part painted the chat background itself, so nothing else could show
a chat with the Agents wallpaper behind it.
- SessionsChatSurface paints the chat background behind an element and follows the
background service; the codicon confetti, its announcement and its telemetry move
with it. The Sessions part uses it.
- The rules that let the background show through chat surfaces, lift a surface's
`.content` above the background, give its editors the panel background and place
the confetti target match `:is(.part.sessionspart, .sessions-chat-surface)`, keeping
the weight of the `.part.sessionspart` rules they override. The sticky scroll
replica finds the background through the surface.
No visual change.
The wallpaper half of 3825a51e90b (#345561). Its card surface half
(`.agents-card-surface`, `--agents-card-frame-owner`) belongs to the part-grid look
of the workbench parts foundation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: generic window layout keys, the chat window service seam and window state
The first piece of chat windows in the workbench (P9):
- `layoutMode` and `splitLayout`: generic per-window context keys, next to the
panel keys, for how a window shows its chat and its editor parts. They are
bound in a window's own context and unset elsewhere, so that the Layout menu's
entries stay extensible and keybindings can test the mode.
`bindWindowLayoutContext` binds them to a window's state.
- `IChatWindowService` and `IChatWindowProvider`: a chat window shows a chat
in its chat part beside its main part. The provider supplies the content
(the chat's editor, title and scoped services), the chrome (title row and
strip), the look (gap, cards, chat background) and where a chat goes back to.
There are no chat window kinds.
- `ChatWindowState`: the layout rules of chat windows (Stacked / Side by Side
/ Editor Only / Chat Only, the next split arrangement, input-only, terminal
position), what chat windows were last left as, and what is remembered per
chat. It reads the keys chat windows of the Agents window stored them under.
- the opening helpers (one opening per chat at a time, clean up on failure)
and the serialization of a main part's editors for restore.
The layout model (`chatWindowLayout.ts`) gains the split layout type and guards
for stored values.
Nothing registers a provider or the service yet, so nothing changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: layout commands on the generic window layout keys
The layout commands of chat windows (P9), in the workbench: Show Chat Only,
Show Editor Only, Show Chat and Editor Stacked / Side by Side, Show Chat, Show
Editor, Stacked and Toggle Chat Conversation, with the rules chat windows of
the Agents window have (the last part shown cannot be hidden; Stacked changes
the arrangement while both show, else only how both show next). Changing the
layout is announced to screen readers.
- Their checked state reads the generic `layoutMode` and `splitLayout` keys.
- They apply where a window has layout modes (`layoutMode` is set), in the
Agents window (`IsSessionsWindowContext`) while AI features are enabled.
- They act on the chat window that has focus (`IChatWindowService.activeWindow`)
instead of on a window handle passed by the toolbar that runs them.
The Agents window loads the contribution; regular VS Code does not. The menus
and buttons that show these commands come with the Agents provider.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: restore the chat windows open when the window last closed
The restore rules of chat windows of the Agents window (P9), driven by the chat
window provider:
- the chat windows open when the window last closed open again, without focus,
with the editors of their main part and their terminals, once the provider
registers and while it restores (`restoreEnabled`), such as while chat
windows are enabled and AI features are not hidden;
- until then, and while restoring is pending, the stored ones are kept;
- a chat that is gone is not restored (`canRestore`), and a removed chat is
forgotten at once, before the next save (`onDidRemoveChats`).
The storage key and format are those chat windows of the Agents window always
used. Their entries named the session, and its chat only when it was not the
main one; the provider resolves a session to its main chat, so the windows open
before chat windows were built on parts open again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the chat window service and its window, on content parts
`ChatWindowService` opens a chat window for a chat through the registered
provider (P9):
- one window per chat: opening a chat that shows, also as the chat the
provider resolves it to, reveals its window; one opening per chat at a
time; a failed opening takes down what it set up;
- the window is an auxiliary window with its own context, scoped to its
document body, where the generic `layoutMode`/`splitLayout` keys and
`mainEditorAreaVisible` are bound;
- two content parts: the main part, created first so it is the window's main
part, starting with the editors moved from the main window or restored, and
the chat part, showing the chat's editor from the provider. Both take the
window's context and the provider's services;
- Move to Main Window closes the window and hands the chat and the editors of
its main part to the provider;
- the stored chat windows are restored once the provider registers.
`ChatWindow` follows today's rules: its main part shows when an editor opens
in it and the window shows only its chat once its last editor closes (not for
a move, nor while it closes or unloads); closing the chat's editor, the end of
its chat, or closing it closes the window, the chat part first so the chat's
editor does not move to the main window; a main part editor that cannot move
keeps the window open; focus goes to the chat while it shows, else the main
part.
`ChatWindowPartsLayout` places the two parts per layout mode from the chat
window layout model until the window part grid of the workbench takes over.
The service registers in the Agents window only; without a provider nothing
opens.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: chrome hosts for windows of their own
The sessions chrome that a chat window shows outside its chat, carried from the chat windows
work without its chat-window keys and handles:
- the session header can show in a host outside its session view, such as the title bar of its
window (SessionView.setHeaderHost, headerShown), as the window's top row; the title bar hosts it
in place of its title, with the header's actions last at its right (getSessionHeaderHost,
getSessionHeaderActionsHost, setHostsSessionHeader), and can show a fixed title or height;
- the Session Activity Bar can show in a host outside its chat, such as a column of its own
(registerSessionActivityBarExternalHost), also while its chat is hidden (partVisible on the
chat groups);
- the items of a submenu flyout run with the context of their entry;
- the title bars of other windows show the Layout menu of their window (Menus.TitleBarWindowLayout),
whose buttons the user shows and hides with the toolbar's own hide/show state, in place of the
promoted-button keys; it is empty in windows without layout modes;
- in a window with layout modes (the generic `layoutMode` key is set), a checked entry of the
strip's side panel group hides the window's editor parts, in place of the main window's side panel;
- the title bar of an editor window reads no session's keys.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the provider's title row and strip, and the chat's size, in the window
The chrome facet now reaches the window: a provider renders its title row and its strip into
elements of the window that the window places, with an instantiation service that has the
window's services (its content's, and the window's context), and tells the room they take
(`size`). The interim placement of the parts lays them out with the chat window layout model:
- the title row is above the chat while the main part is beside it (Side by Side), else across
the window;
- the strip is a column of its own at the right while the chat is below the main part or hidden
(Stacked, Editor Only), as the layout model's column placement says;
- the chat part's maximum height bounds it, such as a chat that shows only its input, and the
main part takes the rest; parts share the room as the chat windows did, the main part wider and
taller than the chat, in whole pixels.
Interim: the window part grid replaces this placement.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the chat of a session as a view editor
Registers the view editor `sessions.chat`, which the chat part of a chat window shows: a session
view of the window's session, configured as the chat windows showed their chat (its session
header, its Session Activity Bar and its pills, the default input placeholder). It brings its own
title, so its group shows no tabs. Whoever opens its editor gives it what it shows
(registerSessionChatViewHost): the window session, the chat window, and where the session header
shows (the window's title row).
- the view's size constraints are the chat's: 280 by 120 at least, and, while the window stacks the
chat below its main part and the chat shows only its input, at most its input's height, which
its part and the window respect (input only, carried from the chat window's input-only
controller onto the view's constraints);
- the chat follows the window's input-only state, and what the user chooses in the chat is kept for
the window, but not the conversation the chat shows while its input cannot show what it needs;
- its view is hidden while the window shows only its main part;
- the active editor its menus read is the one of the window's main part, as the main window's
chat reads the one of its editor area, so that the Session Activity Bar's entries show checked.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: bind the window's content, and the look of its main part
What the Agents provider needs of the window, kept generic:
- `IChatWindowContent.bind(window, instantiationService)`: called once the window's services exist,
before its parts show anything, such as to show the session of the window and bind its keys on
the window's context;
- the look facet's options of the main part: part options that override the user's settings there
(`mainPartOptions`, enforced live) and the options of its groups (`mainPartGroupViewOptions`),
such as the menus and modern tabs of the main window's editor area;
- a content part takes the options of its groups at creation (`groupViewOptions`, an ordinary
option any part can use);
- a chat window is an auxiliary window: its context sets `isAuxiliaryWindow`, so that what applies
to the main window only, such as its panel and side panel toggles, does not apply there.
Carries the chat window's test for moving the main window's editors into a chat window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the Agents provider of chat windows
Registers the provider of chat windows for the Agents window (SessionsChatWindowProvider), on the
chat window seam of the workbench:
- content: a session or a chat resolves to the chat the window shows (the one asked for, else the
one the session shows in the grid, else its main chat), shown as the `sessions.chat` view editor;
once the window exists the session shows in it as a window session (showSessionInWindow), with its
loaded chat model held across the move (ChatModelHold); the window acts on that session
(ISessionScope) and binds its keys on the window's context (session keys, including
sessionHasWorkspace and isQuickChatSession, hasWorktreeAndRepository, isAgentHostSession); the
session view registers as the window's session view, which focuses its window and its chat; a
focused window activates its session; the title is the chat's, or the session's; the window ends
when its chat is deleted or archived, follows a replaced session, and stops showing its session as
it closes;
- chrome: the title bar as the window's title row, which shows the session header in place of the
chat's title, with its actions centered above the Session Activity Bar's column (only with a custom
title bar); and the column the Session Activity Bar shows in while the chat is below the main
part or hidden;
- look: the gap between cards per density (none in compact), cards, the chat background behind the
chat (SessionsChatSurface), and the main part as the main window's editor area: its menus and
modern tabs, `showTabs: none` as one tab, no group sizing on a double click;
- move to the main window: the chat or session opens there again with the window's editors once
the main window is laid out for it;
- restore: after the main window restored, a chat restores while its session loads within 30s and
the chat is not gone; only while `sessions.chatWindows.enabled` is on and AI features show; the
chats of removed sessions are forgotten.
The editor parts of other windows show whether the main window's editor part shows or not.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: entry points of chat windows, behind sessions.chatWindows.enabled
Registers `sessions.chatWindows.enabled` (experimental, off by default), which gates the entry
points only:
- Open in New Window on a session (sessions list, session header) and on a chat of the sessions
list, and Open Chat in New Window (Command Palette); the chat takes the main window's editors
along only while the main window shows that chat;
- Move to Main Window in the session header of a chat window and the Command Palette;
- the accessibility help of the Agents chat describes chat windows while the setting is on.
In windows with layout modes (the generic `layoutMode` key is set), without chat-window keys:
- the Layout menu (Show Chat, Show Editor, Stacked, checked on the generic keys) and the buttons of
its actions, in the title bar, or in the Session Activity Bar while the strip shows the layout
actions; the user shows and hides the buttons with the toolbar's own hide/show state, Show Editor
showing by default, in place of the promoted-button keys;
- the Changes, Files and Browser entries of the Session Activity Bar and of Add Tab open in the main
part of the window that has focus, checked while it shows them; Changes and Files need a session
with a workspace;
- an empty main part has one close button, which shows only the chat; the main window's Close
Editor Area stays out of these windows;
- Run and Open in VS Code show in the title bar of a window that shows a session with a workspace,
as in the main window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: banners and agent feedback show the session of their window
Carried from the chat windows work, on the session scope a chat window gives its parts:
- the pull request and agent comment banners above a chat's input read the session of their window
(ISessionScope): a chat window's own session, and in the main window its session
(mainWindowActiveSession), which is the active session whenever no chat window has focus;
- agent feedback in the editors of a part other than the main one, such as a chat window's main
part, belongs to the session of that part's window whichever session is active; not for floating
editor windows, which have the main window's session scope.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: on the part grid
A chat window lays out its cells on the workbench's part grid instead of the
interim placement:
- `ChatWindowGrid` arranges the title row, the chat part, the main part and
the strip for the layout mode, as chat windows always did: side by side and
chat only with the title row above the chat's column and the main part
running to the top of the window; stacked and editor only with the title row
across the window and the strip in a column of its own at the right. The
part a mode hides stays in the grid; the grid hides a part with no editors.
- The parts open with the shares they always had (the main part wider and
taller than the chat); the title row and the strip are as large as their
chrome says. Sashes let the user size the parts, and the sizes are kept per
arrangement, so that a mode shows with the sizes it had, and per chat across
reloads (the chat sizes storage chat windows always used).
- The look facet's `className` replaces `cards`: the Agents provider styles
the cards of the grid (`--part-grid-card-*`) as the main window's, with the
main part's card on the editor background and none in compact density; the
gap is the floating-panel gap, 0 in compact density.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the part that holds a window's terminals
A chat window gets a part that holds its terminals, in its part grid, and the
generic per-window keys that describe it:
- `terminalsVisible` and `terminalsPosition` (workbench/common/contextkeys.ts,
next to `layoutMode` and `splitLayout`): whether the window shows the part
that holds its terminals, and where that part sits ('underChat',
'underEditor', 'fullWidth'). They are bound on the window's own context by
the window shell, and unset in windows without such a part.
- `IChatWindow.getOrCreateTerminalsPart()` creates the part the first time,
as a cell of the window's part grid at the terminal position: below the
chat, below the main part, or across the bottom of the window; across the
bottom of the chat and the main part while stacked (the strip runs past
it), and below the strip in editor only. Like every part, it hides while it
has no editors; `terminalsVisible` follows the cell. What it shows is what
the feature that shows terminals opens in it.
- `IChatWindow.setTerminalPosition()` moves the part's cell in the grid
(`PartGrid.moveCell`), keeping its height; changing the layout mode
rebuilds the grid with the part where the topology puts it.
- The terminals keep their height as the window is resized: the other parts
take what it grows or shrinks by. Tall terminals give way first in an
arrangement they did not show in yet, so that the chat and the main part
keep their heights. The terminals' sizes are remembered per arrangement
and across them, with the window's other sizes.
- `IChatWindow.onWillClose` fires as the window closes (once its chat and
main parts closed) or as its window unloads, before the part that holds its
terminals closes, so that terminals can leave the window still running.
- The part takes the look's main part options (tabs as in the main part).
- Restoring: a window stores whether it showed its terminals, and opening it
with `showTerminals` creates the part for the terminals feature to fill.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: terminals in chat windows, in the part that holds them
The sessions terminals open the terminal of a chat window's session into the
part of the window that holds its terminals (ChatWindowTerminals, created by
ChatWindowTerminalsContribution), rather than through a terminal host that
the window calls:
- Shown, a window shows the terminals it showed, else a terminal of its
session that no other chat window shows, else a new one in the session's
working directory. The terminal is created at the view column of the
window's part, directly in the window, so that nothing flashes in the main
window, and is not moved again.
- The panel leaves a terminal to the chat window while it shows there
(SessionsTerminalContribution.setShownInChatWindow): it is neither made
visible nor the panel's active terminal for the session.
- Hidden, the window's terminals go back to the background of the panel,
still running, so that the part that holds them is empty and hides; focus
in them stays in the window. Closing their last terminal hides the part
too, and a move does not: both are the part grid's rule for a part without
editors. As the window closes (`IChatWindow.onWillClose`) its terminals are
released the same way, back to their session.
- New Terminal or Split in the part makes the new terminal the window's; a
terminal opened in the window's main part moves to the part that holds the
terminals; a terminal handed to a window, such as the terminal of a task,
shows beside the others.
- A window restored with its terminals shows them again: the window creates
the part that holds them as it opens, and the terminals fill it.
- A file opened from a terminal opens in the main part of the window it is
opened from (TerminalLocalFileLinkOpener): when the active group is in
another part of its window than the window's main part, such as the part
that holds a chat window's terminals, the file goes to the window's main
part. Elsewhere, including the modal editor part, nothing changes.
- `IChatWindow.terminalsPart` is an `IContentPart`, which has its element.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the terminal commands of chat windows
The commands of a chat window's terminals, in the Agents window, while AI
features are enabled and in a window with layout modes, on generic keys only
(`IsSessionsWindowContext`, `chat.enabled`, `layoutMode`,
`terminalsVisible`, `terminalsPosition`, `activeEditor`):
- Toggle Terminal in Chat Window (workbench.action.chatWindow.toggleTerminal)
with the panel and terminal keys (Cmd+J, Ctrl+`), above the main window's
rules for them wherever the focus is in the chat window, and never sent to
the shell (terminal skip-list). Checked by `terminalsVisible`. It is the
Terminal entry of the Session Activity Bar of a chat window.
- The Terminal entry of Add Tab (workbench.action.chatWindow.addTerminal):
adds a terminal to the terminals that show one, else shows them.
- Terminal Position (Full Width, Under Editor, Under Chat) in the More
Actions of the terminals and in the context menu of their tabs, recognized
by the active editor of the group, a terminal; checked by
`terminalsPosition`; unavailable while Stacked.
- Toggle Editor in Chat Window (workbench.action.chatWindow.toggleEditorByKey)
with the side panel key (Cmd+Alt+B): hides the main part, leaving the chat,
and shows it again as it showed with the chat; also skipped by the shell.
The commands act on the window of the editor group they are invoked from,
such as the terminals' title, else on the chat window that has focus
(`resolveChatWindow`). The terminals of chat windows are a service of the
Agents window (IChatWindowTerminalsService), which the commands use and a
contribution creates at startup, so that restored windows show their
terminals again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the Changes editor is the same in every window
The Changes editor of a chat window, which shows in the window's main part, now offers what the main window's offers and acts on the session of its window:
- Its actions are in the "…" of its tab row in every window. Its title actions read MainEditorAreaVisibleContext as each part binds it (the main window for its editor area, a chat window for its main part) in place of excluding auxiliary windows; the Create Pull Request bar shows by the existing per-window keys (IsSessionsWindowContext, !CustomViewVisible, DesktopLayout, SessionIsCreated).
- Each changeset operation is registered once, with the command ids of the main window, while any scope shows it. Two generic per-scope keys, sessions.changesetOperations and sessions.changesetOperationsEnabled, bound through registerSessionActionContextKeyBinder for every scope that shows a session's Changes, decide where it shows and whether it is enabled. Its run resolves the session from the Changes editor it is invoked from: the file toolbar passes { session, editor }, the title passes its editor context. Open File, Expand/Collapse Unchanged Regions, Mark as Viewed and Collapse/Expand All Diffs act on that editor too.
- The chat window's provider binds the keys of the session it shows, and of its changes, on the window's context with bindSessionScopeContextKeys, as the main window binds those of its own session; no chat window contribution or key is involved.
- A Changes tab is closable while the part that shows it is visible: the main window's editor area for its part, MainEditorAreaVisibleContext of the part otherwise.
- Opening the Changes editor of a chat with a changeset selection finds the session of the window that shows that chat (findSessionByChatOrResource).
Carried from #344666 (CW2 version), without its ChatWindowChangesetActionsContribution and chat window keys.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: type fixes in tests of terminals and Changes
The tests of chat window terminals, of the Changes editor input and of the
Agent Merge actions typecheck: an explicit type for a self-referencing parts
list, the changeset operations the session observables now carry, and a
generic invokeFunction in a test stub.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the part fakes of grid tests can be shown and hidden
The part grid now tells a content part whether it shows (IContentPart.setVisible);
the fake parts of the chat window grid tests take it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: keep the main window's outer insets to the window edges
The cards of a chat window ran to the edges of its window (feedback on 491817);
the main Agents window keeps a gap between its cards and the window edges.
The look facet gains `outerInsets`, which the window's grid keeps to the edges
of the window, also as it changes its arrangement; its cells share what is
inside them. The Agents provider keeps the floating-panel gap to the right,
bottom and left edges, none in compact density, and none at the top, where
the title row is, as the main window's title bar is.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the main window's editors move in before the chat leaves the main window
Open in New Window did not bring the editors the main window showed for the
chat: binding the window's content shows the chat's session in the chat window,
which takes it out of the main window together with the editors the main window
showed for it, before they moved. They now move into the window's main part
first, as chat windows always did.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the session header leaves its window's title row with its chat view
A chat moved between groups showed the session header twice in the title row of
its window: the view editor creates a new view for the chat where it moves to,
and the old view's header stayed in the title row after the view went away. A
session chat view now takes its header out of the host it shows in when it is
disposed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: Run and Open in Editor follow the main window's rule in every Agents window
The title bar's Run and Open in Editor showed in a chat window only while its
session had a workspace and was not a quick chat (SessionTitleBarActionsShownContext).
They now follow the main window's rule everywhere (user decision): no workspace
check. Their expressions keep the main window's `!isAuxiliaryWindow` and add the
generic `layoutMode` window key, set in windows with layout modes, so that they
show in the main window and in chat windows, and not in editor windows, which
have no session. No key exists that is true exactly in windows with a session,
and none is added. SessionTitleBarActionsShownContext is removed.
Intended difference from 491817: Run and Open in Editor show in a chat window
also for a session without a workspace or a quick chat, as in the main window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a chat keeps where it is scrolled to when its editor moves
When the chat editor of a chat window moves, such as to another group, the view
editor creates a view for it where it moves to, which shows the chat as it was
last saved; the old view saved it only when disposed, after the new one loaded.
The session chat view now saves what its chat shows when its pane asks, before
the editor leaves it (IViewEditorView.saveViewState): chat views can save their
view state (AbstractChatView.saveViewState), which the sessions chat view does
as it does when disposed. The input's draft lives on the chat's model, which
both views share.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: a chat editor moved out of its window takes the chat out of it
A chat's editor moved into another window, such as dragged into the main
window's editor area or moved into a new window, stayed there as a plain view
editor, and its chat window only followed the groups its chat part had when it
opened. The chat window now follows the chat's editor in every group of its chat
part, also those added later, such as when the part splits, and closes when it
closes there. When the editor moves out of the window, the editor closes where it
moved to and the chat follows the user decision: into the main window, it moves
to the main window as Move to Main Window does; into another window, it shows in
a chat window of its own again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: close the window once the chat's editor closed
Cmd+W in the chat of a chat window closes the chat's editor, which closes the
window. The window closed its parts while the chat part's group was still
closing the editor, so the editor close continued on a closed part: an error
notification showed in the main window and the extension host received editor
tabs without an active group. The window now closes once the editor closed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: chat window tests follow the Run rule and the strip's Terminal entry
The editor area test expected Run and Open in VS Code in chat windows only for
sessions with a workspace; they follow the main window's rule in every chat
window now. The contribution test picked the strip's layout entries by a prefix
that the Terminal entry of the strip also has.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chatWindow: title row and chat are one card side by side and in chat only
Side by side and in chat only, the title row is the header of the chat's card, in the chat's cell of the grid, as in today's chat window: no card edge between the title and the chat. Stacked and in editor only, it stays a row of its own across the window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: chat window title row as tall as the main part's row of tabs
The title row takes the height of the row of tabs of the window's main part, its card's frame included, in every layout: while the main part does not show, the height it last showed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: chat window title row across the window with the chats as tabs
With the chats of the session as tabs, which replace the session header, the title row of a chat window is a row across the window, as the main window's title bar is, side by side and in chat only too; with a single chat it is the header of the chat's card again. The title row says so with the generic headsChat of a chrome element.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: one title row at a time, the window's across the top or the chat view's own, as tall as the row of tabs
A chat window has two places for its title, and shows one at a time. The title bar part is a row across the top of the window, which shows and hides as a cell of its grid: stacked, in editor only, and with the chats of the session as tabs. With a single chat, side by side and in chat only, the chat view shows its own title row at the top of the chat's card instead, one surface with the chat. Both are as tall as the row of tabs of an editor part, from the first frame and in every layout, rather than measured from the main part. The classes of the window go on its own element, as those of the container of an auxiliary window follow the main window's, and the window lays out again once its styles have loaded.
This replaces the title row in the chat's cell and the measured height of the previous commits.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: chat windows look as they did
The chat view is styled as the session views of the Agents window are (sessions-window-host). The cards draw the frames of the parts in them, the chat's card is the chat's surface, and the group of the part that holds the chat draws no frame of its own. The cards keep no gap to the edges of the window. The native title bar of a chat window shows its layout actions, and windows with layout modes show no Always on Top.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: frames, gaps, strip and title rows as before
The main part shows without editors, as it did. The title row of the window keeps no gap to the cards below it. The chat view's own title reaches over the gap beside the chat's card, so that its actions are where they were. The groups of the main part draw their frames, and the session view the chat's, but while the chat shows its own title row, which the chat's card frames with it. The strip's column holds the gap beside it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* editor: no Lock Group or Close Group in the empty groups of windows with layout modes
An empty group of an auxiliary window offers to lock or close it, which closes an editor window: a window with layout modes, such as a chat window, shows more than its editors, and its empty groups offer neither, as before.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: close with the workbench, such as as it reloads
A chat window closes as the workbench shuts down, after the windows to restore were saved, as editor windows do: reloading left the window open beside the one that restored.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the main window's padding, the window controls in the title row
The cards keep the gaps of the main window's to the edges of the window, but at its top, where the title row is, as the user asked, rather than none as before: the chat leaves its frame to the session view in its card, or, while it shows its own title row, frames both, so that the frames are where the main window's are. The chat's own title row reaches to the edges of the window, under its window controls, and only the title row that shows places them: one laid out without height while it is hidden moved them to the top edge of the window. Its negative top margin no longer moves the chat with it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: Terminal Position in the menus of the terminals of a chat window
The menus of an editor group read the id of its active editor pane, which for a terminal is the terminal editor's, not the id of its input: Terminal Position never showed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the terminals of a chat window line up with its other cards
The groups of the terminals draw their frames with connected tabs, as the main part's do: their card leaves its frame to them, so that it is as wide as the cards beside it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* terminal: recreate the WebGL renderer once a terminal shows in another window
The canvas of the WebGL renderer loses its context in another window than the one it was created in, without the renderer falling back: a terminal that moved to an auxiliary window, such as one restored into a chat window, showed a lost canvas. Attaching the terminal to a container in another window recreates the renderer there.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the terminals of a chat window framed as the main window's panel
The terminals' card draws its frame at its edges, as the main window's panel does, rather than the groups of the terminals inside it: their frame was missing at the edges of the window and doubled at its sides.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: disable hiding the part that shows alone in the chat window Layout menu
The Layout menu entries are menu items of their own, which don't carry the
preconditions of the actions: Show Chat stayed enabled in Chat Only and Show
Editor in Editor Only. Give them the same preconditions, as 491817 does.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: window-scoped actions act on the chat window's session
A chat window's session became the active session only once focus moved into its session view, so its title row actions
(Open in VS Code, the Run dropdown) and its tab entries acted on the main window's session. Its session now becomes the
active session as its window gains focus, without moving focus, and those actions take the session from the window's
own session scope.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: no New Session title bar button in chat windows
The button stands in for the main window's sessions list while it is hidden, and a chat window inherited the main
window's sideBarVisible key, so it showed in a chat window's title too. It now shows in the main window only.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: no lock action in the title of the part that holds the terminals
Terminal groups lock as terminals open in them, which keeps other editors out of the part that holds a chat window's
terminals, but its title then offered Unlock Group, which the main window's panel does not. A generic editor group view
option, hideLockActions, hides the lock and unlock actions of the groups of a part; the terminals part uses it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: keep the editors and terminals of a chat window whose chat moved to another window
As the chat's editor moved out of a chat window into another window than the main window, the window closed and the
chat opened in a new chat window without the editors of its main part and its terminals. They now show there again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: no second Changes tab in a chat window
A Changes editor that moved into a chat window with its chat, or that a restart restored, is the Changes editor of the
session rather than of the chat, so the Changes entry did not find it and opened another. It now activates any Changes
tab of the window's session.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a chat window no longer sets the title of the main window
The title bar of a chat window set the document title of the window it was in, and the title row of the chat view is
created before it is in its window, so it set the main window's title to the chat's, where it stayed. The title of a
window is now its owner's: the chat window service sets it for its window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a title bar looks active while the window it is in is active
A title bar took the window to follow for its active look as it was created, so the title row of a chat view, created
before it is in its chat window, followed the main window: it looked inactive in a focused chat window. It now follows
the window it is in as the active window changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: pin closing the editor area with the terminals under the editor
Close Editor Area shows only the chat. With the terminals under the editor they stay, across the window and as tall,
rather than going away with the main part, and go back under the editor as it shows again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the first open of a chat with no editor to bring along shows only the chat
As 491817 does: a chat that shows in a chat window for the first time, with no
editor in its main part, opens in Chat Only rather than with an empty main part,
without changing what is remembered, so that a mode the user chooses for the chat
shows again. Also pins that an editor dropped beside the chat, which splits the
chat part and empties the main part, changes no mode.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: keep the sizes of the parts across mode round trips and part moves
- The terminals moved between arrangements take their height once the cells
beside them show: resized while the main part was still hidden, it took a
share of their height as it showed (200 -> 270 after Chat Only and back).
- Sizes are remembered for an arrangement only while the part grid still shows
it as the window arranged it: after a part moved, such as with Move Part, the
chat across the window was remembered as its width side by side, and the main
part came back at its minimum.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: pin the widths of the chat and the main part over QA's second split sequence
Terminal position walk, terminals hidden and shown, Chat Only and back, a resize
and a change of density keep the chat at the width the user gave it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: Side by Side never comes back with the side part at its minimum
Chat Only and Side by Side share an arrangement, but in Chat Only the chat takes
the room of the hidden side part: its full width, saved as the window saved its
state, was remembered for Side by Side, and the side part came back at its minimum.
- Sizes are remembered per arrangement and per part it hides, and before every
change of mode, so that the split the user had is saved before a part move.
- A remembered size that leaves the other parts less than their minimum, such as
one stored by earlier builds, gives way to the default share.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the terminals keep the height the user gave them in every mode
The terminals drifted taller across mode round trips (199 -> 286 -> 232 -> 265):
- the title row took no room as soon as it hid, before the grid arranged the
mode, and its room went to the terminals, which was then remembered;
- the height remembered per arrangement won over the one the user last gave;
- a rebuilt grid gave the room of a hidden title row to the terminals.
The title row now shows and hides only with the grid, the user's last height
applies in every mode, and the terminals take it once the cells show or hide.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a chat view that disposes creates no title row
Closing a chat window logged 'InstantiationService has been disposed': as the
view disposed, its window changed, and the derived of its own title row ran
again, creating a title bar part with the services the view had disposed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the split and the terminals come back as they were after a restart
A restored chat window shows without its terminals until they are restored: the
arrangement without them had no sizes remembered, so the chat and the main part
took their default shares, and the terminals, which join empty, showed at a size
of their own. The sizes of the chat and the main part are also remembered for the
arrangement without the terminals, and the terminals take their height when their
first terminal shows. Pins QA's second INFO-2 walk through every mode.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: a change of density restores the exact gaps and insets of the cards
- The gap was not followed: read behind the grid, which did not exist yet as it
was first read, so a change of density changed it only once the grid rebuilt.
- The cards read the frames their insets leave room for as the gap changes,
maybe before the styles of the new density apply: the grid lays out again on
the next frame, so that a density round trip gives the cards their exact size
back (QA: 476/714 -> 475/713 after compact and back).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the terminals keep the user's height when the chat changes size with the mode
QA (Beta): terminals sized 199, then Stacked 286, Side by Side 286, Editor Only 72.
While stacked the chat shows only its input, as tall as it exactly, and its size
changes before the grid arranges the new mode: the row of the old mode was
squeezed, the terminals took the room, and that was remembered as the height the
user gave them; then, taller than their share, they gave way in Editor Only.
- What shows is remembered as soon as what arranges it changes, before anything
reacts to the change.
- The main part takes the rest of a column or a row, not the chat, which may be
only as tall as its input.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: read the app region of the title bar only where the browser computes it
The browser runner of the Insider build failed the test of a click on a hosted
session header: a headless browser may not compute -webkit-app-region, as
Electron does. What a click reaches is still checked everywhere.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: remember only the sizes the user gives the parts
The window remembered the sizes its cells showed with as the mode changed, as it
saved its state, or as it went: sizes the grid had forced, such as the least
width of a chat part that holds an editor, or the terminals as a mode showed,
came back as the user's (QA: terminals dragged to 199 came back 286, then 72; a
forced 502/688 split stayed after the editor left the chat part).
- Sizes are remembered only when the user drags or resets a sash: of the cells
it changed, the terminals' height for every mode, the chat's and the main
part's for the arrangement.
- The terminals take the height the user last gave them, else their share of
the window, in every mode.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the strip's entries act on the window they are in, at the first click
The Session Activity Bar ran its entries without naming its window, so the chat window commands they run, such as Terminal,
the tabs and the layout, acted on the window that has focus. A click in a chat window that does not have focus yet runs
before it does: the first click acted on no window, or another, and only the second one on the window. In a window with
layout modes the strip now runs its entries with the window it is in, and those commands act on the window named.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a canvas opened from a chat window opens in that window
While the active group was outside the main window, a canvas opened in the main part of the main window, as for a
canvas opened from an auxiliary window. Opened from a chat window, which shows its own editors, it now opens in the
main part of that chat window: in the group that has it already, else in the active group.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat pills: the dropdown of a pill shows in the window of the pill
The dropdown of a pill, such as the References or Pull Requests pill of a chat, showed in the window that had focus. For
a pill of a chat window that is not focused yet, that was another window: an entry picked there acted from that window,
so a pull request opened in the main window. It now shows in the window of the pill.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: sizes stored by earlier builds are not read
Earlier builds stored the sizes the parts showed with, including those the window
forced them to, such as terminals squeezed to 123: they came back as the user's.
The sizes the user gives the parts are now stored under a key of their own, and
those of the old key are removed, so that the parts take their defaults once.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: no agent feedback overlay on the chat of a chat window
The navigation of the session's feedback (1/4) showed over the chat input of a
chat window: in a window that shows a session of its own, every resource maps
to that session, also that of the chat, a view shown as an editor. An editor
that shows no file, such as a view, has no feedback overlay, as the chat of the
main window has none.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: opening a chat in a window keeps the main window's side pane
The editors of the main window moving to the chat window emptied its editor
part, which the Agents layout took for the user closing them, and closed the
side pane: it stayed closed for every session the main window showed next,
until the chat window closed. While they move, the editor part's automatic
visibility is suppressed, as it is when the main window switches sessions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: type the editor part of the side pane test of chat windows
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a title row of a chat window gives up the traffic-light inset in full screen
A title bar followed the full screen state of the window it was created in: the
title rows of a chat window, created before they are in it, followed the main
window, and kept the room of the traffic lights while the chat window was in
full screen. It now follows the window it is in, as it moves there and as it is
laid out.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* canvases: a chat window shows the canvases of its own chat
Opening a canvas in a chat window failed: a canvas editor, and moving a canvas,
accepted only groups of the main window. A canvas context service may now present
canvases of an owner in groups outside the main window, and keep them presented
outside the main window's working sets; the Agents one does so for a chat window
and the chat it shows. Other windows keep the main-window-only rule.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the Changes editor of a chat window shows the changed files list
The changed files list of the Changes editor shows where its host enables it: a
chat window enables it on its context, which all its parts inherit, so its
Changes editor shows the list wherever it shows; the main window does not.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the tab rows at the top of a chat window move the window
In a chat window, the empty space of the tab row of a part at the top of the
window moves the window, as the window's title row does: its tabs, actions and
other controls keep their clicks and drags, and while something is dragged the
row takes the drop. The part grid marks the cells at its top edge, and the
groups at the top of their parts there, as the parts move, split, show and hide.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: Developer: Reset Chat Window Layout
Lays out the chat window it runs in as it first opens: it forgets the layout and
sizes remembered for its chat, the sizes the user gave its parts and the parts
moved in it, and shows only the chat while its main part has no editors, else
the chat and the editor side by side at their default shares. Other chat windows
and the main window keep theirs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: Reset Chat Window Layout also puts the terminals across the window
Where the terminals of a chat window show is part of its layout: the reset shows
them across the window, as chat windows do until the user chooses, without
changing where those of other chat windows show.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: a layout command moves the chat back into the chat part first
A chat dropped onto the middle of another part of its window shows as a tab of
that part, and its chat part hides as empty. A layout command shows the parts of
the window as the chat part showing the chat: it moves the chat's editor back
into the chat part first, so that the chat never hides with the part it is in.
The main part showing as an editor opens in it moves nothing.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the Changes editor of a chat window shows its actions in the header row too
The main part of a chat window takes the header row's secondary menu of the main
window's editor area, where the Changes editor shows Run Code Review, its More
Actions and Toggle Files, as the main window does.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the chat's editor merged into another part still closes or moves the window out
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! chat windows: the tab rows at the top of a chat window move the window
A double-click on the empty space of a tab row at the top edge of a chat window does what one on the title bar does
(restores INativeHostService.handleTitleDoubleClick) instead of opening an untitled editor.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! canvases: a chat window shows the canvases of its own chat
The owner of a canvas a chat window shows is visible and has a context whichever window has focus; the main window's
canvases follow the main window's session rather than the focused window's.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* integration: stub the session scope, chat resource and layout service in main's newer tests
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: a title row of a chat window gives up the traffic-light inset in full screen
An auxiliary window in full screen below the camera notch of its display is less tall than its screen: it counts as full
screen while it spans the width of its screen.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! chat windows: the main window's padding, the window controls in the title row
The tab row at the top right of a chat window keeps the room of the window controls that float above it beside the chat's
own title (Windows, Linux), by new generic part grid markers for the right edge.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: the terminal commands of chat windows
The side panel's command toggles the editor of the chat window it runs in, whatever key the user binds to it, instead of a
separate command with a copy of its default key.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: the chat of a session as a view editor
The suggest widget of a chat input shows in the window of the chat.
A chat can render before it is attached, such as the chat of a chat window, whose view editor creates its view before attaching it. Its input's overflow widgets element then went into the main window's container, so the completions of /, @ and # showed in the main window instead of the chat window. The element now moves into the container of the window that the chat lays out in.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: the terminal commands of chat windows
Type the context of the side panel's keybinding test.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: the chat of a session as a view editor
The session state indicator of a chat updates as the window that the chat shows in loses focus, rather than the window
it rendered in, which for the chat of a chat window is the main window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: the terminal commands of chat windows
A terminal in a window with layout modes, such as a chat window, does not offer to move into the panel, which is the main
window's: the window keeps its terminals in a part of its own.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: share the chat background surface beyond the Sessions part
Test that the confetti button of a surface outside the Sessions part has its hit area.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! chat windows: a change of density restores the exact gaps and insets of the cards
The part grid reads the frames of the cards again only when asked to: once the styles of the density apply, it updates
its look before the window lays out.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: terminals in chat windows, in the part that holds them
Find the main part of the window with getWindowMainPart.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: let session actions act on a given session
The skill buttons of an agent-host session run their skill in the chat of the session they are given, such as the chat a
chat window shows, rather than in the main chat of the active session.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: let session actions act on a given session
The resource of a session that an action is given, such as by the Changes toolbar of a chat window, names the session of
the chat window that has focus when that window shows it, rather than the main window's session of the same resource:
its window has focus as the action runs, before the active session follows it. Extension commands of the toolbar keep
receiving the resource.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: show sessions outside the Sessions part grid
Focus moving into a window of its own activates its session passively, as focus moving back activates the main window's:
what the main window restores, opens and shows, such as its canvas, goes on, and no navigation is recorded. A chat the
main window opens finds its chat in the session it opened, also once focus moved into another window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: terminals in chat windows, in the part that holds them
- A terminal added in a chat window is a terminal of its session, in its working directory, with its profile, tracked for
it, rather than one with the main window's defaults.
- A window that closes, or whose terminals hide, while a terminal is created for it does not take it: nothing moves into
it, no listener stays, and the terminal stays with its session. The group it opens in is that of the part once the
terminal is there.
- A terminal a chat window takes is marked as taken at once, so that another chat window asking meanwhile does not take it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: the Agents provider of chat windows
Only the editor parts of a window built of content parts, such as a chat window, show whether the main window's editor
part shows or not; those of editor windows follow it, as before.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: chrome hosts for windows of their own
The title bar of an editor window reads the keys of the main window's session again, as before, and so shows its session
actions; a chat window binds the keys of its own session on its window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: no New Session title bar button in chat windows
New Chat hides from the title bar only in a window with layout modes, such as a chat window; editor windows show it as
before.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: a title row of a chat window gives up the traffic-light inset in full screen
An auxiliary window counts as full screen while flagged so and covering its screen but for the area of a camera notch
above it, so that a wrong flag on a narrower or much shorter window keeps the space of the traffic lights.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! chat windows: the chat window service and its window, on content parts
- A window that goes away while it opens, such as one the user closes, is not added as a chat window: its unload is
handled from before what the opening waits for.
- Closing a window closes its main part first: when an editor of it cannot move to the main window, the window stays as
it was, its chat too.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: terminals in chat windows, in the part that holds them
A link in the terminals of a window opens the file where the window shows it already, as revealIfOpened does without a
group, else in the window's main part.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: entry points of chat windows, behind sessions.chatWindows.enabled
Move to Main Window acts on the window it is run from, such as by a control of a window that does not have focus yet.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! chat windows: layout commands on the generic window layout keys
- Toggle Chat Conversation acts on the window it is run from.
- Showing the editor again by the side panel's command announces the layout, as hiding it does.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! chat windows: the tab rows at the top of a chat window move the window
The double-click of a tab row at the top of a chat window routes to the title bar's action only with the custom title
bar, and only reaches the window where the OS does not take the row as its caption, so that only one of them acts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: let session actions act on a given session
Type the scoped instantiation service of the test.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! sessions: terminals in chat windows, in the part that holds them
Type the editors the test finds.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: drag and drop between parts (#345685)
* Parts drag and drop: editors between parts, and edge splits over views that handle drops
Editors, including a view shown as an editor, drag from one part into
another part of the window and split a part when dropped on its edge (D1, D2):
- content registered as handling its drops (`registerContentDropTarget`),
such as a chat view, keeps the drops in its center; editors and groups
dragged over it still get the edge zones of its group. Other drags (files)
are the content's everywhere;
- an input drop target, such as a chat input, takes every drop on it, also
at an edge of the group, as before;
- a view shown as an editor can offer a drag handle, such as its title row,
that drags its editor with the same transfer as a tab (a singleton moves);
the handle owns its drag and does not start one from its text fields;
- a drop that moves an editor into another part of the same window is
announced;
- Move Editor to Part... moves the active editor into a part picked from the
other parts of its window (Agents window only for now).
The editor area of a window with one part behaves as before.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Parts drag and drop: drag a part to rearrange the window, and Move Part commands
A part drags by the grabber on the top edge of its card, which shows while
the card is hovered (D3). Over the window, a drop indicator shows where it
goes:
- near an edge of the window, to that edge of the window;
- over another part, beside it on its side nearest to the pointer;
- over itself, nowhere.
The parts in the grid do not take the drag of a part, and the move is
announced. Move Part Left/Right/Up/Down move the active part past the part
beside it, or to that edge of the window (Agents window only for now).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Parts drag and drop: an editor dropped on an edge of the window goes into a new part
An editor dropped on an edge of the window, outside the parts, goes into a
new part at that edge (D4), with a drop indicator while it is dragged there.
The owner of the part grid creates such parts through a part factory; without
one, editors do not go into new parts. A part the grid created closes once
its last editor closes (also after a restore), while the owner's own parts
hide as before.
Move Editor into New Part Left/Right/Above/Below move the active editor into
a new part beside its part (Agents window only for now).
The part grid now takes the editor groups service, to move the editors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Parts drag and drop: chat windows create the parts for editors dropped on their edges
`ChatWindowPartFactory` creates the parts that a chat window's part grid
adds, such as for an editor dropped on an edge of the window (D4): like the
window's main part, with the window's services and the provider's look for
the main part, and closed with the window. It goes to the window's part grid
with `PartGrid.setPartFactory`.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Parts drag and drop: drag a chat into a chat window, and move the chat between parts
A chat whose drag ends outside the windows opens in a chat window where the
drag ended (D5), like a tab dragged out of the window opens a new window:
- from a chat tab, a chat row of the sessions list, a session row of the
sessions list or the session header of the main window (a session stands
for the chat it shows), which report the end of their drag to the handler
the chat windows register;
- the main window's editors go with the chat as with Open in New Window;
- over a window, with chat windows not enabled (or AI features hidden), or
without a chat window provider, nothing changes;
- the opening is announced.
A chat window opens at the bounds it is given (`IChatWindowOpenOptions.bounds`).
The chat of a chat window drags by the session title of its header, also
while the header shows in the title row of its window, where the rest of the
header still moves the window (D1). Its own text fields, such as a rename,
keep the mouse. The chat handles what is dropped on it, such as files to
attach, while editors dropped on the edges of its part split it.
Where a new window opens for a drag that ended outside the windows is now
shared from the workbench's drag and drop helpers; tabs and groups dragged
out of the window open where they did before.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
* fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
* fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
The window's title row shows whenever the chat does not lead the window: moved into another part or after another part. Window edges are the edges of the parts, under the title row.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
The window edges for D4 and part drags are those of the parts: below the title row, which is an OS drag region across the top of the window, and the outer insets count as the edge. The grid tests from the base pass the editor groups service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
The grid test from the base that keeps cells inside the outer insets passes the editor groups service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
BUG-5: over content that handles drops, the edge overlay shows for the drag that creates it and that drag does not reach the content, so the content does not show its own feedback there; an overlay that shows takes its drop, also before any drag moved over it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
BUG-8: Move Part to the edge a part is at already leaves the parts, their sizes and the focus as they are.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
The chat leads the window from the first group of the chat part only: with a group split off to its left, the window's title row shows.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
BUG-7: test that content showing its own drop feedback gets the leave of a drag that leaves it, directly or through the edge overlay.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
A part the grid creates or closes keeps the arrangement the window's, so its sizes are remembered, unless something else changed the arrangement first.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
Drop the part cell shown through a view of its owner: the chat is a plain part cell again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
QA FAIL #1: Move Part keeps the sizes of the other parts and the moved part takes the rest, so moving it back restores the layout.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
QA FAIL #4: the groups of a chat window's chat part besides the chat's, such as an editor split beside the chat, are stored with the window and restored in place, with the chat back in its own group.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The grid tests from the base pass the part factory and the editor groups service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
fixup! Parts drag and drop: drag a chat into a chat window, and move the chat between parts
A stored chat part is checked as the window restores, and a chat group the part no longer has falls back to the active group.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The density grid tests from the base pass the part factory and the editor groups service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
A part created at an edge of the window takes its room from the part the editors come from, so the other parts, such as the terminals, keep their sizes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The created parts of a rearranged chat window take their room from the main part, or else the chat, so the terminals keep their height.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
Type fixes after the rebase: a readonly copy, and the new base test passes the part factory and the editor groups service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
The cells of the parts the grid created are marked (data-part-grid-created), so that a look can frame them as the parts they are like.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The cards of created parts look like the main part's, frame included, so their edges line up with it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
The view editor drop test aims at the view, not at the group, which a browser lays out taller than the view.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The sizes tests of created parts resize as the user does, by a sash, which is what the window remembers.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
The cell of a part split into groups is marked (data-part-grid-split), so that a look can frame the part once, as one card.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
A part split into groups is one card in a chat window: its card frames its groups once, and the groups and the chat in them draw no frames of their own.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
A dragged part shows where it goes as a whole card: its slot after the move, from a dry run of the move, or, dropped on the center of another part, the whole part it merges into. Parts merge unless the window says they do not.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The parts of a chat window do not merge, and the preview of a move shows the title row as the window will show it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
Cards move: while a part is dragged beside another, the other cells slide aside to where the drop puts them (from a dry run of the move) and its slot opens; they slide back as the drag leaves or ends, and a drop commits them in place. Every move glides from where the cells were (FLIP). Cells move by transforms, clipped as they get smaller; cards with native content move as plain cards, under which integrated browsers give way. No motion without monaco-enable-motion.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
No reflow while a card is dragged (user decision): the cards stay put and the slot preview shows where it goes, as before. Only the move glides, one FLIP per move: drops and the Move Part commands.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
The slot of a dragged part is found by a dry run once for each place it would go, not on every dragover.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
The empty space of the title of a group that is not at the top edge of the window (no part-grid-top-edge-group, where the title moves the window) drags its part, as the drag handle does. Tabs still drag their editors.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
Test: a tab still drags its editor, and the drag handle its part.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
Resetting a chat window's layout closes the parts its grid created, their editors moving into the main part first.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
getPartTitleDragSource: where a drag of the part from a group's title starts, for whatever starts it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
A layout command moves the chat's editor back into the chat part from any part of the window, such as one the grid created.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
A card drags by the pointer: it lifts (scaled 0.98, with a shadow) and follows the pointer by `translate` only; the other cards slide to where they go, once per drop target, with a running slide retargeted from where it shows; zones follow the cards where they show, with hysteresis; dropped, the part moves once and the card settles into its slot. Escape cancels. Native views move as plain cards, hidden meanwhile. Without motion, a static slot shows and the drop moves the part at once.
`PartGrid.startPartDrag(id, pointerEvent)` starts it, from the grabber and from the empty title space of groups below the top edge (`getPartTitleDragSource`). Parts no longer use HTML5 drag and drop; editors still do.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
Card drag, as the user asked (U10):
- the slot of a dragged card is an empty card, with the watermark of an empty editor, not an accent fill;
- a part goes beside or into a part by where the center of the lifted card is, not the pointer at its grabber; to an edge of the window where the pointer pushes it, also over its own slot once the pointer moved 32px; where parts do not merge, the center of a part takes the nearest side;
- the lifted card is scaled to 0.6 about where the pointer holds it.
Dropped, the card settles into its slot first and the part moves once it settled, so that the layout of the parts, which can take a while, happens while nothing moves. The lift reads every card once before it writes, and the grabbing cursor is one layer over the window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
The slot of a dragged card takes the watermark of an empty editor group from its rules, rather than its own copy of them.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The parts of a chat window merge: a part dropped on the center of another merges into it, the whole part highlighted, as in any window; at its sides, it goes beside it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
Editors dragged on the rim of a card, between cards or at an edge of the window go into a new part there: the other cards make way for its slot, an empty card with the watermark of an empty editor, as for a dragged card, and the part comes once the cards settled. Further into a card, the part's own drop overlay takes them, into or beside a group, as before. What makes the cards make way is shared with the card drag (PartGridReflow), and the dry run of a new part mirrors how it is added (PartGrid.previewNewPart).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
The chat's editor is found in every group of the window (windowGroups), also in parts the grid created: merged there, it still closes the window, moves out and returns.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
Terminals merged into a chat window's main part stay there (U13): ChatWindowTerminals moved every terminal editor that opened in the main part to the terminals part, which put merged terminals back. It now moves only new terminals: an editor that moves from another group is still in that group as it opens.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
Editors dragged where they go into a new part stay there until the pointer leaves the grid: Chromium tells no related target as what is under the pointer changes, which it does as the cards make way.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
The cards that make way are laid out for real where they go, not only moved and clipped: as one starts to slide, it is laid out as large as where it was and where it goes, so that what it shows fills the card as the card's clip slides from size to size, and once it slid, exactly where it goes. A target change lays them out, not a frame. Leaving, Escape and the drop lay them out as the grid does.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
A part dropped on the center of the chat goes beside it, on its nearest side, rather than merging: its editors would join the chat's group, whose title is the chat's own. The parts of a grid say which merge with a predicate (`PartGrid.setMergeAllowed`), the chat window that none merges into the chat; the chat merging into another part still does.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
Editors and groups dragged over a view that handles drops, such as a chat, cannot go into its group, where they would be behind it: they split the group on the side nearest to them, also over its center, into a new group with its own tab row. The view's inputs still take them, and other drags, such as files, still go to the view.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
Over the center of a part it merges into, the cards stay as they are as the card lifted, its slot where it was, and only the part it merges into is highlighted, in its frame: what the merge changes shows once it is done. Moving beside a part, the cards make way; back over the center, they are as they were again. Dropped, the card settles into the part, then the part merges once, and the cards glide to where that leaves them.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
While cards move, a part whose editor draws over the window rather than in it, such as a webview, a notebook, an integrated browser or a canvas, shows a placeholder for it: the content drawn over it hides, its tabs move and lay out with its card, and over the editor shows the watermark of an empty editor with the editor's icon and name. What draws over an element registers it as an overlay anchor (`registerOverlayAnchor`), as overlays positioned over elements and native web contents views do, so that the grid finds and hides it without knowing what it is. The content shows again once the cards settled.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
On main's input drop targets (7525d703bb8): inputs take drops through the holes the overlay's clip-path leaves over them, and a drag that enters one creates no overlay, except for groups. The overlay no longer checks for inputs itself; content that handles drops still lets only editors and groups split the group. The test asserts the hole rather than a synthetic drag over the overlay, which ignores clip-path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
fixup! Parts drag and drop: editors between parts, and edge splits over views that handle drops
An edge split over content that handles drops, such as a chat, gives the new group half of the group, as the drop indicator shows. Beside a group at its minimum size the group counted as expanded, and the part expanded the new group, squeezing the chat to its input.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
The look test from the base passes the editor groups service.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
M1: a drag of editors from another window that ends there, such as cancelled with Escape there, no longer leaves the new part's slot and the cards that made way for it: the drop target listens for drag ends in every window, and a leave once no editors are dragged resets it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
M3: PartGrid.setPreviewLayoutAllowed: a window can say which parts do not lay out at the sizes their cards take while cards make way, such as those showing terminals, whose processes resize, also for a drag that is cancelled. Their cards only show clipped until the grid lays them out.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
M5: a part does not merge into the terminals, whose groups stay locked to terminals. M3: terminals, the terminals part or a part whose active editor is a terminal, do not lay out while cards make way.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
M4: a card drag disposed while its drop still settles, such as with its grid, drops it; a new drag still settles the previous one first. L1: the window losing focus cancels a card drag.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
M4: disposed while editors dropped into a new part still settle, such as with its grid, the drop is dropped: no part is created.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
M2: the parts a chat window created, such as for editors dropped on its edges, are stored with their editors and open again as it restores: each part's editors move into a new part at the edge of the window, where such parts go as its parts are arranged (as after a layout-mode change). Where the window creates no parts, their editors stay in its main part.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
L2: editors go into new parts as the editor groups split: only while workbench.editor.splitOnDragAndDrop, as toggled by its key, and the copy key copies them into the new part.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
L3: Move Part restores the sizes of the other cells inside the change that glides, so that the cards glide to where they end up.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
L4: the parts a chat window creates are named apart from its main part, Editor, and from each other: Editor 2, Editor 3, for announcements and Move Editor to Part.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
L5: the parts of a part grid say so in their context (editorPartInPartGrid, generic, not chat-window only), and Move Part needs it besides the Agents window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
fixup! Parts drag and drop: an editor dropped on an edge of the window goes into a new part
L5: Move Editor into New Part needs the part to be one of a part grid.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
L6: the overlay anchor registry is keyed by host: a host registered again, such as an overlay re-anchored mid-drag, keeps its hidden count, so it does not show again while hidden; one disposed while hidden shows again. Tests for the registry.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
fixup! Parts drag and drop: drag a part to rearrange the window, and Move Part commands
L7: the grabber takes the pointer only down to its grip, not over the tabs under it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
fixup! Parts drag and drop: chat windows create the parts for editors dropped on their edges
Closing the window closes its main part first (#345683).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the parts of a chat window show as the window shows them
The parts of a chat window bind whether they show on their own contexts, rather than taking the main window's editor
area as theirs: on the window's context its parts show, such as the one holding its terminals or a part created by a
drop, which show also while only the chat shows and whether the main window's editor area shows or not; on its main
part's own context, the main part shows as the window's mode says. An editor in them, such as the Changes editor, can
close as in the main window.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: lay out the chat grid once a group is added or removed
A layout while the grid of the chat groups changes, such as the window's as a terminal opens and moves focus, read the
grid while it and the groups disagreed (Index out of bounds in getViewCachedVisibleSize). It now waits for the change
and lays out once after it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the session header shows once in the title row
Every session view of the chat bound its header into the title row, so a view the chat moved from that was still
there showed its header beside that of the view the chat shows in: the title twice. Only the view that shows the chat,
the last attached, shows it now, and the views attached before take it back as it goes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* editor: a locked active group hands off from a view with its own title too
An editor opened without a group while a locked group was active, such as one of a chat window's terminals, went to the
most recently active group that was not locked, also when that group showed only a view with its own title, such as the
chat of the window: Quick Open opened a file behind the chat. It goes to the main part of the view's window now, as it
does from the view's group itself.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* editor: closing a part leaves no errors, from its services or its diffs
Closing the last editor of a part created in a chat window, which closes the part, logged errors
("InstantiationService has been disposed"):
- The multi-diff widget disposed the items it renders before the scroll view that renders them: their bindings
firing as they disposed made the scroll view render once more, creating templates while the widget disposed, with
the services of the editor that disposes it already disposed. The scroll view now disposes first.
- A part created with services made its instantiation service the one of the caller's collection, as an
instantiation service adds itself to the collection it is created with. A chat window creates all its parts and
its own services from one collection, so whatever the window and its other parts created after that, such as its
title bar's actions as its layout changes, got the instantiation service of that part, disposed with it. Each part
now has a collection of its own.
Also, the Changes editor that a tab moves away from no longer lets go of what the input resolved while the editor it
moved to shows it, which cancelled that editor's resolve ("Canceled"); a resolve cancelled while the input is still to
show resolves again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: closing a window closes all its parts or none
The chat part could keep the window open after its main part had closed: an editor beside the chat, such as one dropped
beside it, that it could not move to the main window as it closed. The editors beside the chat now move into the main
part first, and while one cannot, nothing closes; the chat part, holding only the chat, which closes without asking,
then closes once the main part did.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* editor: test that closing a part closes its editors that need no confirming
As closing an editor window does: only the editors that need confirming, such as dirty ones, merge into the main part,
whose own editors stay.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: a layout mode arranges the parts from its own arrangement
Switching layout modes kept the arrangement the grid showed where the modes arrange the parts alike, such as Side by Side and Chat Only: a part the user moved, such as the main part dropped above the terminals, stayed there once cells showing meanwhile adopted the move as arranged, and came back squeezed. A part a mode hid, such as the main part in Chat Only, also came back at its minimum size, as the terminals moved beside it while it was hidden. Each layout mode now arranges the parts again from its own arrangement, with the sizes remembered for it; parts created for dropped editors stay.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: a closing window does not arrange its parts again
Closing a chat window closes its main part and its chat part, whose cells leave the grid, and then, as it goes away, the part that holds its terminals. That change arranged the grid again and set the chat cell visible: 'The part grid has no cell 'chat''. The grid of a window now stops arranging its parts once the window goes away (its willUnload), not as one of its parts closes, which can happen while it stays open.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: mark the title bar's groups that show no actions, in place of :has()
A group of actions in the title bar of a chat window takes no room while its actions all hide themselves, such as the
Create Pull Request bar without changes. The title bar now marks such a group with a class as its actions show and hide,
which the style reads, in place of a :has() selector, which the repository's CSS guidelines advise against.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the chat model hold ends at its timeout, however often it polls
The hold of a chat's model as it moves into a chat window measured its timeout by counting its polls, which a window
whose timers are throttled, such as one in the background, makes fewer: the hold lasted much longer than its timeout,
and its test failed on macOS CI. It now ends at a deadline; the polls only check whether the view has bound.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: closing a window keeps its layout, and moves editors back when it stays open
Closing a window that showed only its chat, with an editor beside the chat, moved that editor into the main part, which
showed the main part: the window's remembered layout and the default of new chat windows became Side by Side, and the
grid was arranged again as the window closed. An editor opening in the main part changes nothing while the window
closes. And when the window stays open, as an editor cannot move to the main window, the editors that moved go back
beside the chat.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the Changes toolbar of a chat window gives its own actions the session
A session resource resolves to the session of the focused chat window that shows it, so the first click on the toolbar
of a chat window without focus could act on the main window's session. The actions of the toolbar get the session
itself now, as those of its operations dropdown do; those of extensions keep getting its resource, as the API gives it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a terminal created for a chat window that closed meanwhile goes to the panel
It was created at the column of the window's terminals group, which may now be another group's, and stayed there as an
editor. It goes into the background of the panel, as the terminals of a window do as they hide.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the Changes editor looks for the same input in other groups, not an equal one
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: a layout mode change keeps the parts and the focus when nothing moved
Changing between layout modes that arrange the parts alike, such as Chat Only
and Side by Side, only shows or hides the parts again, unless the user moved
parts out of the mode's arrangement: the grid is not rebuilt, and the focus,
such as in the chat input, stays. A mode change that does rebuild the grid,
because parts were moved or the mode arranges them differently, puts the focus
back where it was in the parts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: the Changes editor offers how its own files list shows, where it shows one
In a chat window the Changes editor shows its changed files beside the diffs, but its More Actions menu offered only the
side pane's Files View, of the main window, rather than how its list shows and where. It offers Files View & Position
there now, with the commands of the multi-diff editors: View as List or Tree, On the Left or Right.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: test that a Changes editor keeps what its input resolved while another group shows the input
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the Terminals part holds only terminals
Any other editor that opens or is restored in the part that holds a chat
window's terminals, such as a dropped tab or Move Editor, moves to the
window's main part once its open completes. The guard lives with the part,
including while the terminals are hidden, and stops as the window closes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* browser view: open in the window's main part rather than a chat's or locked part
The integrated browser's preferred group now hands off from a self-titled
editor's group, as the editor group finder does (O3), so a PR link opened
from a chat window opens in the window's main part rather than the chat's
group. A part of only locked groups that is not its window's main part,
such as the Terminals part, is no longer split for it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agents: the Files tab closes in a part of another window
The docked Files tab stays uncloseable in the main window's main part, but
in a chat window's part it closes like the other editors there, as the
Changes tab does.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agents: trust a chat window's full-screen state, not its size
In macOS full screen, a chat window's title row kept the traffic-light
spacer: its full-screen state was only trusted when the window also
covered its screen, which a window in full screen may not do, such as
below the camera notch of a display or on an external display.
The title bar now follows the state from the host's full-screen events for
its window, and asks the host again (isFullScreen) as the window resizes or
the title bar moves to it, to correct a stale state. The spacer and the
titlebar-fullscreen class follow the same result.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* view editors: test that a view editor moving around leaves one live view
Moving the editor of a view, such as a chat, into a group split off its own,
to another part and back, five times over, leaves only the view that shows
it alive: the panes it leaves dispose theirs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* browser view: do not open in a locked group of the window's main part either
An open handed from a part of only locked groups to the main part of its
window avoids a locked active group there too.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the chat dropped on the Terminals part goes back to the chat part
The Terminals part sends other editors to the window's main part; the chat's
own editor goes back to its chat part instead. IChatWindow exposes the
editor that shows the chat for this.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agents: ask the host about full screen once a window is done resizing
The re-check of a chat window's full-screen state waits for the end of a
resize instead of running per resize event, and an answer that arrives
after the title bar is disposed changes nothing.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a task run for a session a chat window shows opens its terminal in that window
Running a task from the Run menu of a chat window opened its terminal in the
main window's panel, which also took the focus there: the agent-host task
runner always revealed the panel. It now shows the task terminal in the
terminals of the chat window that shows the session, as F1 did, and only
falls back to the panel when no chat window shows it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: Cmd+J in a chat window keeps the focus in it
Showing a chat window's terminals moved a terminal of the window that was in
an editor of another group, such as one the user moved into the main part,
through the terminal panel: moveToTerminalView shows and focuses the main
window's panel, which took the focus to the main window. Such a terminal now
moves from its group to the part that holds the terminals directly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a terminal of the main window's panel shows in a chat window without focusing the main window
Showing a chat window's terminals can take a terminal of its session from the
main window's panel. Two things there focused the main window: the panel
group it left focused its next terminal when it was the active one, and the
terminal was focused before it showed in the chat window, while still in the
main window. The group now makes another terminal active first, and the
terminal takes the focus once it shows in the chat window. A terminal in no
group goes through the background rather than the panel.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: other editors stay in the Terminals part
An editor dropped, moved or restored into the part that holds a chat
window's terminals, such as the Changes editor, now stays there beside the
terminals instead of moving to the window's main part. The chat's own
editor still goes back to the chat part.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the Terminals part shows the header row for editors other than terminals
A new group view option, showHeaderFor, decides per active editor whether
the enabled group header shows. The groups of the part that holds a chat
window's terminals take the header menus of the main part's groups and show
the header row for another editor there, such as the Changes editor with its
view options, and none for a terminal: terminals look as before.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a terminal moved into another part of a chat window stays there
Cmd+J shows and hides only the terminals of the part that holds a chat
window's terminals. A terminal the user moved into another part of the
window, such as its main part, stays where they put it: hiding the
terminals does not send it to the panel, and showing them does not pull it
back. With none left in that part, showing them shows a terminal of their
own there, as for a window without terminals. When the window closes, all
its terminals still go back to their session.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: groups of the chat part look as those of the main part
An editor split beside the chat inside the chat part, such as the Changes
editor, showed the generic tab row with its lock action instead of the
Agents header row and tabs of the main part. The chat part now takes the
look's group view options and part options too; the chat's own group still
shows no title area while it holds only the chat.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* view editors: a view lives on beside other tabs, and its group hands opens off
A view shown as an editor now stays alive, out of the DOM, while another
editor of its group shows, and shows again as it was; it goes as its editor
closes or moves. A view editor whose views render their own title declares
it (providesTitle), which gives its editor the new ProvidesTitle
capability: a group that holds it hands editors opened in it off to the main
part of its window also while another editor, as a tab, is active there.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: editors as tabs beside the chat
The chat's group can hold other editors, as tabs. Its tab shows the chat's
title and, while editors are beside it, no close action; Cmd+W on the chat
then closes the window, as closing the chat did. The chat leads the window,
and its view shows the session header, only while it shows; the window's
title row shows the header meanwhile. Layouts that show the chat show it
in its group. The chat's group shows no header row for the chat. A chat
group with tabs is captured for restore, with the chat first.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* sessions: a task terminal goes to the chat window it was run from, and stays in another chat window
A task of a session shows in a chat window's terminals only while that
window, which shows the session, is the active window, such as when the
task runs from its Run menu; run from the main window, it stays in the
panel. Showing a chat window's terminals no longer takes one of them that
another chat window shows now: it becomes that window's.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: Cmd+W, focus and visibility of the chat beside tabs
Cmd+W closes the window also with focus in the chat, whose view binds the
active editor of the main part in its context: the command checks the
active editor when it runs, else does what Close Editor does. Focusing the
window or its session shows the chat where a tab beside it showed. A view
shown as an editor is told as it hides and shows again while its editor
stays in its group, and the chat's view hides then.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: the grabber of a part shows while the pointer is over the part, also over its webview
The grabber on the card of a part showed only while the card was hovered. What draws over a part from outside its
card, such as a webview, which is laid over it from the root of the window, did not count, so over the content of a
webview, often most of the part, the grabber never showed. The grid now follows the pointer over its window and shows
the grabber of the part it is over, mapping what draws over an element back to that element through the overlay
anchor registry.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: with no gap between the cards, the grabber of a part takes the pointer over the sash on its edge
Flush cards share their edge with the sash between them, which sat over the grabber on the top edge of the lower card
and took the pointer there: a user reaching for the grabber resized instead. Without a gap, the grabber now takes the
pointer within its own span; the sash keeps the rest of the edge. Cards with a gap are unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the chat showing only its input grows to show its conversation when dragged taller
In Stacked, a chat that showed only its input was at most as tall as its input but could be shrunk below it: the sash
above it highlighted, yet could never make it taller, and could clip its input. The chat is now as tall as its input at
least, and, while the user drags a sash of the window, may grow: dragged past its input it shows its conversation, and
dragged back down to its input, only its input again, with a little room between the two so that neither flickers (the
existing decideStackedChatInputOnlyWhileDragging). Let go past its input, the conversation stays at the height it was
dragged to; let go at its input, the chat is as tall as its input again. The grid says when the user resizes, from the
press on a sash, before the sash takes it, until it lets go.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: the grabber mark leaves with its part and as the pointer leaves the window from a webview
Review L6: a removed or disposed grid's part no longer keeps the mark, and leaving the window from inside a webview's
frame, whose parent gets no pointerout, or the window losing focus clears it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: a resize starts on any pointer, survives a lost release, and announces what it showed
Review L4/L5: the grid resizes from pointerdown (mouse, pen, touch) to pointerup or pointercancel; a press whose release
went elsewhere no longer leaves the next resize off (resizing is set after the previous one ends); the grid does not
end a resize as it is disposed; and what a drag of the sash showed, the chat's conversation or only its input, is
announced once as it lets go.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: the grabber shows for a part whose webview the pointer goes into straight from another part
QA live check 6 (U23): into a webview, whose frame takes the pointer, the window has a pointerout but no pointerover,
so the part the pointer came from kept its grabber. On a pointerout, the grid now marks the part of what is under the
pointer, such as the frame of a webview over a part, and clears the mark only when nothing of the window is there.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: the grabber shows for a part whose webview the pointer goes into, by where it heads
QA live check 7 (U23): into the frame of a webview the window has a pointerout to nothing at the edge of the element
the pointer leaves, and no event after it, so what is under that point is still that element. On such a pointerout,
the grid now marks the part that something draws over where the pointer heads, such as a webview over the main part,
found through the overlay anchor registry; else the pointer left the window and the mark clears.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: a part's card lifts also when the first move goes into a webview
QA live check 7 (U25): pointer capture taken on the press applies only to the next pointer event, and a first move
upward from the grabber of the chat went into the main part's webview, whose frame took the pointer from the window:
no move, no capture and no release reached the drag. From the press, the layer over the window that the drag shows
once the card lifts now takes the pointer, above what draws over the window; and a press that loses the pointer before
the card lifted ends.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: the grabber shows for a part whose webview the pointer is in, once the window has no more events
QA live check 8 (U23): going into a webview's frame, the window may have no pointerout at all: its last event is a move
inside the part the pointer leaves. Once the window's pointer events stop for a moment, the grid now looks for what
draws over a part that the pointer is over (an overlay hovered while the pointer is in its frame, through a new
isPointerOver of the overlay anchor registry), marks that part, and looks again while the pointer is there; once it is
not, with no event of the window, the pointer left the window from there and the mark clears.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: the grabber stays shown as the pointer goes to it from the title above or a region that moves the window
User report U34: in full screen, the grabber of the chat hid as soon as the pointer was over its title. A region that
moves the window, such as the title row and the empty space of the tab rows at the top edge, takes the pointer from the
window, which then has a pointerout to nothing and a mouseleave while the pointer is still over it; the grid took
those for the pointer leaving the window. Now only a point outside the window clears the mark; inside it, the mark
follows the part at that point, or a webview there. A cell that is not a part, such as the title row across the
window, keeps the mark, as the pointer goes from a part's title there to its grabber below it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: an editor dropped where the last move showed a new part goes there, whatever is under the pointer then
QA live check 9 (compact density): with no gap or insets, a tab dropped at the window's left edge with no move after
the cards made way for the new part was not taken, so the drag ended outside and opened an editor window. As the cards
make way, what is under the pointer can be outside the grid's DOM, and the grid took drags only inside it. The grid now
takes them at its window by where the pointer is, inside the grid, and a drop goes where the last move showed it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: the chat showing only its input does not move
User request: while the chat shows only its input (Stacked, conversation hidden), its part does not move: it shows no
grabber, so the sash on its top edge takes the whole edge, and neither its grabber, the space of its title nor Move Part
moves it, the command announcing so. It moves again once its conversation shows, such as when dragged taller by that
sash. Generic in the part grid: PartGrid.setMovable, which the window drives from whether its chat shows only its input.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: every part put somewhere takes an even share of where it goes
User decision U36: two gestures that put a part in the same place gave it different sizes (a drop at the window's edge
took an even share of the row; a drop beside the part at that edge split only that part), and editors dropped into a
new part split the part they were dropped on. Every part the user puts somewhere, a part dragged by its card, editors
dropped into a new part at an edge or on a rim, and Move Part, now takes an even share (1/n) of the row or column it
joins, within its least and most sizes; the other parts there make room in proportion to their sizes before, the parts
inside them too, and views that are not parts, such as a title row, keep theirs. Dropped beside a part with no part
beyond it on that side, a part goes to that edge of the window, as a drop there does, so both give the same place and
size. Previews use the same function, so a drop ends where its preview showed. Parts the window arranges itself (moveCell,
addPart) are unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* editor: an editor dropped on the center of content that handles drops, such as a chat, joins its group as a tab
User decision U37: an editor or tab dropped on the center of a view shown as an editor that handles drops, such as the
chat of a chat window, went to the side of it nearest to the drop, as the center was the view's. It now goes into the
view's group as its active tab, as the overlay shows, as on any group; the edges still split the group evenly, groups
dragged there still only split it, and the view's own editor dropped on its center stays where it is. Only the chat
view of chat windows registers such content.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: the grid does not look for the pointer over a webview while its window has no focus
Review L5: while the pointer rested over a webview, the grid looked again every 250ms for as long as it did, also after
the window lost focus, which set the mark the blur had cleared. The window losing focus now stops looking, and its focus
or its next pointer event starts it again.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: no arranging while a window closes, and the chat with tabs beside it does not lead
Closing a window with an editor beside the chat in its group logged "The
part grid has no cell 'main'": moving that editor out of the chat's group
showed the title row, which arranged the grid after the main part had
closed. The grid stops arranging from the start of the close and arranges
again when the window stays open.
With editors beside it, as tabs, the chat no longer leads the window: the
title row shows and the group's tab row is below it, rather than under the
macOS traffic lights.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid, editor: a drop gets the size its preview shows, within the least sizes of what makes room
QA final check (U36): an editor dropped at the window's right edge got a third of the main part, not an even share of
the row, as the chat, split into groups, could not get narrower; and an editor dropped on an edge of the chat showed
half of it but got less, as the chat kept its least width. The even share of a part put somewhere now leaves the others
room for their least sizes, and those that would get less keep them while the rest make room in proportion. An even
split of a group shows, and gives, half of the group within the least sizes of the group and of an editor. Previews and
drops compute the size the same way.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agents: the title bar marks its groups that show no actions privately
The helper is no longer exported: the test goes through a title bar that
hosts a session header and checks the class on its real groups of actions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* agents: docked editors decide themselves whether they can close
The check whether the editor part that shows a docked editor is visible
moves from a global helper into DockedEditorInput, which now takes the
editor groups and layout services and adds CannotClose while that part
is hidden. It moves to sessions/browser, beside its users, as it needs
the layout service. The Changes and Files inputs pass their services and
add only their own capabilities.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: moving out carries every part's editors, and close checks all of them first
Move to Main Window and moving the chat into another window serialized only
the editors of the main part: tabs beside the chat in the chat part and the
editors of parts created for drops were lost. Both now take them, before
the window closes; reopening passes the chat part and the created parts as
restoring does. Closing a window checks first that every editor of its main
part and chat part can move to the main window, so that a veto leaves
every editor in place.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat windows: drop a dead check and fix two doc comments
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* part grid: a dragged card whose drop fails still ends its drag
Review L2: a drop that threw as the card settled, from a timer, left the layer over the window, the drag's window
listeners and its settling phase, so that Escape and a release did nothing and no other drag started. The drag now
always cleans up and ends, also when the drop fails, which is reported.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sandeep Somavarapu · github.com-microsoft-vscode · c8110cef · 2026-11-04