mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-07 07:45:54 +00:00
* fix(web-shell): surface cross-workspace sessions in split view & overview
The split-view "add session" picker and the Session Overview only listed the
primary workspace's sessions, so on a multi-workspace daemon
(`qwen serve --workspace A --workspace B …`) sessions in non-primary
workspaces could not be picked into a split pane or triaged from the overview
— even though the sidebar already lists them and the load path already drives
them.
Both surfaces now merge the primary workspace's sessions with the live
sessions of every other trusted workspace, label each session by its
workspace, and — in the split view — attach each pane under its session's own
workspace so a non-primary session no longer 409s against the primary cwd. On
a single-workspace daemon the behavior is unchanged.
- add useOtherWorkspaceSessions: fans out listWorkspaceSessions over the
non-primary trusted workspaces in capabilities.workspaces (Promise.allSettled,
tolerant of one failing), and empty on a single-workspace daemon
- SplitView: merge the lists, tag picker items by workspace, and pass each
pane's workspaceCwd to its DaemonSessionProvider
- SessionOverviewPanel: merge the lists and add a per-card workspace badge
- add utils/workspace helpers, plus unit tests across all four surfaces
* fix(web-shell): repair stale composerTagIcons import that broke the build
ScheduledTasksDialog imported getComposerTagIconUrl from `../composerTagIcons`,
a module deleted when the helper was consolidated into `utils/composerTag.ts`.
The stale path failed `vite build` (and the web-shell browser-regression e2e).
Point it at the current location.
* fix(web-shell): address review feedback for cross-workspace sessions
- useOtherWorkspaceSessions: return the shared EMPTY sentinel when every
workspace responds empty (skip a no-op re-render), guard the load effect
against a stale in-flight fetch overwriting a newer one, and keep the
single-workspace path fully synchronous (no fetch, no post-render setState)
- fetch non-primary workspaces at the primary list's page size so a busy
workspace is not truncated at the daemon's smaller default
- split picker: tag primary sessions with the same localized "primary" label
the Session Overview uses, so both surfaces read consistently
- tests: cover reload(), the poll re-query, empty-primary merge, and the
primary badge render; quieten the act() warnings
* feat(web-shell): show each split pane's workspace in its composer placeholder
In a multi-workspace split, once a session becomes a pane there was nothing
indicating which workspace it belongs to. Name the pane's own workspace in the
composer placeholder ("Message this session in <workspace>…"), so it's clear
which workspace a message is going to before you send it. Single-workspace
daemons are unchanged.
* Revert "feat(web-shell): show each split pane's workspace in its composer placeholder"
This reverts commit c58e667127.
* feat(web-shell): label each split pane's workspace in its composer toolbar
On a multi-workspace daemon, split-view panes can hold sessions from
different workspaces, but nothing showed which workspace a pane's message
would go to. Add a compact, non-interactive workspace chip to the pane
composer toolbar (next to where the git-branch chip sits), mirroring
GitBranchIndicator.
The chip renders only on a multi-workspace daemon, is fed each pane's
workspace explicitly by the split view (which knows it per session), and
keeps its label visible as panes narrow — only tightening and truncating
rather than collapsing to an icon — since it is the pane's identity.
* feat(web-shell): show the workspace chip in the main composer too
Extend the per-pane workspace label to the main (single-session) chat
composer: on a multi-workspace daemon the composer toolbar now names the
current session's workspace, so it is always clear which workspace a
message targets — not only in split view.
Place the workspace chip before the git-branch chip. Reuses the existing
WorkspaceIndicator and `workspace` toolbar action, fed from the active
connection's capabilities and workspace cwd.
* fix(web-shell): keep a session when a shrink closes the split view
When the viewport shrinks below the large-screen breakpoint the split
view auto-closes and folds back to the single chat. If that chat had no
session of its own — the common case when the split was opened straight
from the Session Overview or a `?split=a,b` link — the user was stranded
on an empty "new chat". Fall back to the split's first pane instead.
Best-effort and gated to the uncontrolled (standalone) split: a load
failure (e.g. a non-primary-workspace session the single connection
cannot own) simply leaves the empty chat, i.e. the previous behavior.
* fix(web-shell): restore the split view when the screen grows back
A shrink below the large-screen breakpoint folds the split view down to
the single chat (its entry points are hidden on small screens). That fold
used to be permanent — widening the window back left the user on a single
chat with their panes gone. Fold it away only temporarily instead:
remember that a shrink folded it, and restore the same split once the
screen grows back past the breakpoint, so a transient resize is lossless.
Standalone/uncontrolled split only; a controlled host still owns its own
split lifecycle. While folded, the narrow chat still falls back to the
split's first pane so it isn't an empty new chat.
* fix(web-shell): keep the chat's git branch when folding the split on shrink
Folding the split on a shrink no longer switches the single chat's
session. The previous shrink-time loadSession(firstPane) re-pointed the
main connection at the split's first pane; when that pane lived in a
different (e.g. git-less) workspace it wiped the chat's git branch — and
more broadly changed the session/URL the user drops back to. Fold the
split away without touching the chat's connection, so its session, git
branch and URL are exactly what they were once the screen grows back.
* feat(web-shell): auto-collapse the sidebar in a narrow split view
In split view the session sidebar competes with the panes for width. Below
1200px it now auto-collapses to its icon rail so the panes get the room,
and expands again once the window grows back — the session list and the
"New chat" label no longer eat space a narrow split needs. A wide split
(>= 1200px) keeps the full sidebar and the user's own collapse preference;
nothing changes outside split view.
* test(web-shell): cover the cross-workspace fetch race, quiet split-picker act() warnings
Address review suggestions on the cross-workspace session listing:
- useOtherWorkspaceSessions: add a test that a stale in-flight fetch is
discarded by the `cancelled` guard when the target workspace set changes
mid-flight (a workspace registered/unregistered while a list is loading).
- SplitView: flush after opening the picker so the reload()/reloadOther()
the picker-open effect fires no longer leak act() warnings in the two
cross-workspace tests.
* test(web-shell): use a valid DaemonMode and assert the pane workspace prop
Two review suggestions on the cross-workspace tests:
- workspace.test.ts: the caps() mock used `mode: 'workspace'`, not a valid
DaemonMode (`'http-bridge' | 'native'`) — use `'native'`.
- SplitView.test.tsx: the ChatPane mock now captures `workspaceCwd`, and the
cross-workspace attach test asserts the pane receives it (for the composer
chip) — so dropping that prop pass-through would now fail the test rather
than only the provider's `data-workspace`.
* perf(web-shell): memoize pane toolbar actions; cover chip tooltip fallback & deep-link remount
Address review suggestions on the composer workspace chip:
- ChatPane: memoize `paneToolbarActions` so its array identity is stable —
ChatEditor is `React.memo`, and a fresh `[...]` each render defeated it,
re-rendering the composer on every pane render.
- ChatEditor.test: cover the `workspaceTitle ?? workspaceName` tooltip
fallback (chip rendered with a name but no explicit title).
- SplitView.test: cover the deep-link remount path — a pane mounted before
the other-workspace fan-out resolves remounts under its own workspace once
`workspaceCwdById` populates (pane key `b1:` → `b1:/wsB`).
---------
Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
248 lines
4.7 KiB
CSS
248 lines
4.7 KiB
CSS
.panel {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
font-size: 13px;
|
|
color: var(--foreground);
|
|
}
|
|
|
|
.toolbar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.count {
|
|
color: var(--muted-foreground);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.selectAll {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 12px;
|
|
color: var(--muted-foreground);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.actionButton {
|
|
appearance: none;
|
|
padding: 4px 12px;
|
|
border: 1px solid var(--primary);
|
|
border-radius: 8px;
|
|
background: var(--primary);
|
|
color: var(--background);
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.actionButton:disabled {
|
|
opacity: 0.55;
|
|
cursor: default;
|
|
border-color: var(--border);
|
|
background: transparent;
|
|
color: var(--muted-foreground);
|
|
}
|
|
|
|
.refreshButton {
|
|
margin-left: auto;
|
|
padding: 4px 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
background: transparent;
|
|
color: var(--foreground);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.notice {
|
|
padding: 8px 12px;
|
|
border-radius: 8px;
|
|
font-size: 12px;
|
|
color: var(--warning-color);
|
|
background: color-mix(in srgb, var(--warning-color) 12%, transparent);
|
|
}
|
|
|
|
/* A responsive grid so the panel fills wide (multi-monitor) screens and still
|
|
collapses to a single column on narrow ones. */
|
|
.grid {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
|
gap: 10px;
|
|
}
|
|
|
|
.card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
padding: 12px;
|
|
border: 1px solid var(--border);
|
|
border-left-width: 3px;
|
|
border-radius: 10px;
|
|
background: color-mix(in srgb, var(--foreground) 3%, transparent);
|
|
}
|
|
|
|
.cardCurrent {
|
|
outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent);
|
|
outline-offset: -1px;
|
|
}
|
|
|
|
.cardTop {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
min-width: 0;
|
|
}
|
|
|
|
.cardCheckbox {
|
|
flex: 0 0 auto;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.colorDot {
|
|
width: 8px;
|
|
height: 8px;
|
|
flex: 0 0 8px;
|
|
border-radius: 999px;
|
|
}
|
|
|
|
.cardLabel {
|
|
flex: 1 1 auto;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
text-align: left;
|
|
border: none;
|
|
background: transparent;
|
|
color: var(--foreground);
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
}
|
|
|
|
.cardLabel:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.currentBadge {
|
|
flex: 0 0 auto;
|
|
padding: 1px 7px;
|
|
border-radius: 999px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
color: var(--primary);
|
|
background: color-mix(in srgb, var(--primary) 14%, transparent);
|
|
}
|
|
|
|
.cardMeta {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
flex-wrap: wrap;
|
|
min-width: 0;
|
|
}
|
|
|
|
.metaItem {
|
|
color: var(--muted-foreground);
|
|
font-size: 12px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
max-width: 100%;
|
|
}
|
|
|
|
.statusBadge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 1px 9px;
|
|
border-radius: 999px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
/* Status accents — applied both to the card's left border and its badge. */
|
|
.statusApproval {
|
|
border-left-color: var(--warning-color);
|
|
}
|
|
|
|
.statusApproval.statusBadge {
|
|
color: var(--warning-color);
|
|
background: color-mix(in srgb, var(--warning-color) 14%, transparent);
|
|
}
|
|
|
|
.statusRunning {
|
|
border-left-color: var(--primary);
|
|
}
|
|
|
|
.statusRunning.statusBadge {
|
|
color: var(--primary);
|
|
background: color-mix(in srgb, var(--primary) 14%, transparent);
|
|
}
|
|
|
|
.statusIdle {
|
|
border-left-color: var(--border);
|
|
}
|
|
|
|
.statusIdle.statusBadge {
|
|
color: var(--muted-foreground);
|
|
background: color-mix(in srgb, var(--muted-foreground) 12%, transparent);
|
|
}
|
|
|
|
/* Which workspace a session lives in — only shown on a multi-workspace daemon.
|
|
The primary reads muted; a non-primary workspace gets an accent so
|
|
cross-workspace sessions stand out in the grid. */
|
|
.workspaceBadge {
|
|
flex: 0 0 auto;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
max-width: 140px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
padding: 1px 8px;
|
|
border-radius: 999px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
color: var(--muted-foreground);
|
|
background: color-mix(in srgb, var(--muted-foreground) 12%, transparent);
|
|
}
|
|
|
|
.workspaceBadgeOther {
|
|
color: var(--primary);
|
|
background: color-mix(in srgb, var(--primary) 14%, transparent);
|
|
}
|
|
|
|
.empty {
|
|
padding: 24px 12px;
|
|
text-align: center;
|
|
color: var(--muted-foreground);
|
|
font-size: 13px;
|
|
}
|
|
|
|
/* Color tags mirror the sidebar's session-group palette. */
|
|
.colorRed {
|
|
background: #ff5a5f;
|
|
}
|
|
.colorOrange {
|
|
background: #ff8a2a;
|
|
}
|
|
.colorYellow {
|
|
background: #f6c431;
|
|
}
|
|
.colorGreen {
|
|
background: #69c987;
|
|
}
|
|
.colorBlue {
|
|
background: var(--agent-blue-500);
|
|
}
|
|
.colorPurple {
|
|
background: var(--agent-purple-600);
|
|
}
|