Repository navigation
feat(web-shell): add contextual task panels #7929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
9664e6d
8cfff64
f554cf8
9a926f3
8dbb4b8
227cb88
76ca3d3
d5fc330
7d70f95
10dfb70
5f1ece3
247101b
89ccd93
9fb8670
fa3aa32
5877237
7b18f00
5f55a94
de3816a
94b2df8
2be5545
ea27e82
6fefb37
5fb9583
e14ce42
b00fe1c
bb5732d
1f5d68e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| # Web Shell context panels | ||
|
|
||
| ## Goal | ||
|
|
||
| Add a persistent header to active chat sessions and move supported workspace | ||
| and background-task context into a fixed-width environment panel. Keep the | ||
| existing artifact panel as an independent right-side surface. | ||
|
|
||
| ## Header | ||
|
|
||
| The active chat header is opt-in so existing integrations without header props | ||
| keep their previous layout. Passing `header` enables the default header, whose | ||
| content is the current session title. `header.items` controls the title, | ||
| environment action, and artifact-panel action independently; an empty items | ||
| array hides the complete header. Passing `renderChatHeader` also enables the | ||
| header and replaces it completely; the renderer receives the session metadata, | ||
| enabled items, controlled panel state, and panel open-change callbacks. The | ||
| compact sidebar toggle remains owned by `sidebar` and renders outside the | ||
| custom header. While the artifact panel is closed, its toggle is in the chat | ||
| header. While it is open, that same toggle moves to the right edge of the | ||
| artifact-panel header, leaving the environment action at the right edge of the | ||
| chat header adjacent to the panel. | ||
|
|
||
| The artifact-panel action remains available when no tab exists. Opening an | ||
| The empty panel shows Review and, when session-source metadata is supported, | ||
|
Comment on lines
+24
to
+25
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deferred — this PR is in critical-only mode after five change-producing rounds, so this round addresses Critical feedback only. The dangling sentence fragment in the design doc is a real readability nit. It is non-Critical, recorded in the round summary, and left open for a follow-up so it is not silently dropped. 中文说明延后 — 本 PR 在五个产生改动的轮次后已进入仅处理 Critical 的模式,因此本轮仅处理 Critical 反馈。设计文档中的残句确实是一个可读性小问题。 该项为非 Critical,已记录在本轮总结中,并保持开放留待后续跟进,不会被静默丢弃。 |
||
| side-task history plus New side task. Once a tab is open, the panel header add | ||
| menu contains Review and New side task without repeating the side-task history. | ||
| Review opens the most recent transcript turn containing reviewable file | ||
| changes, is disabled when no such turn exists, and is hidden from the add menu | ||
| while a review tab is already open. Closing a populated artifact panel keeps | ||
| its tabs so the header action can reopen the existing content. | ||
|
|
||
| `rightPanel.items` independently controls whether Review and Side task appear | ||
| on the empty panel page. Both items are enabled by default. | ||
|
|
||
| ## Side tasks | ||
|
|
||
| A side task is a distinct daemon thread session in the same workspace as its | ||
| parent. It renders the existing interactive chat pane, including the transcript, | ||
| composer, approval-mode selector, model selector, streaming state, and | ||
| permission handling. Creation uses the dedicated side-task endpoint to snapshot | ||
| the main session's complete model context at that moment, then continues | ||
| independently. Inherited records are not replayed in the side-task transcript; | ||
| only messages created inside the side task are shown. | ||
|
|
||
| Side-task sessions record `sourceType: side_task` and the parent session id as | ||
| `sourceId`. The Web Shell session catalog filters this source type, so side | ||
| tasks do not appear as top-level sessions. With saved side tasks, hovering Side | ||
| task on the empty right-panel page opens a menu of those sessions and a New | ||
| action. With no saved task, clicking the row creates one directly. Selecting a | ||
| saved task restores it as a tab. Closing a tab only detaches its client; the | ||
| daemon transcript remains available for later conversation. | ||
|
|
||
| `/fork sider` opens a new side-task draft directly. Hosts can trigger the same | ||
| action through `shellRef.current.createSideTask()`. | ||
|
|
||
| ## Environment panel | ||
|
|
||
| The environment panel uses only existing Web Shell capabilities: | ||
|
|
||
| - workspace path; | ||
| - Git branch and working-tree summary; | ||
| - working-tree diff and commit history entry points; | ||
| - configured agents entry point; | ||
| - background agent, shell, and monitor task summaries. | ||
|
|
||
| The environment action and environment section remain available throughout an | ||
| active chat session. A clean working tree is shown explicitly; agent and | ||
| background-task sections appear only when they have content. | ||
|
|
||
| `environmentPanel.items` independently controls the environment, subagent, and | ||
| background-task sections. All three sections are enabled by default. | ||
|
|
||
| The local `/fork` command refreshes the session task snapshot as soon as its | ||
| background agent launches. Fork agents have no parent transcript tool call, so | ||
| their right-panel detail resolves the virtual subagent session by agent task ID | ||
| instead of `toolUseId`. | ||
|
|
||
| The local `/tasks` command opens the environment panel and refreshes its task | ||
| snapshot instead of opening the legacy task dialog. | ||
|
|
||
| Side-task, subagent, and fork transcripts expose their own file changes and | ||
| artifacts through the main right panel. Their source session scopes tab | ||
| identities and workspace actions, so opening a nested output creates a separate | ||
| tab without replacing the main session's review or artifact tabs. | ||
|
|
||
| It is a fixed-width, non-resizable layout column styled as a floating card with | ||
| a border and shadow. At narrower message widths it opens as a dismissible | ||
| floating popover instead of consuming chat width. | ||
|
|
||
| The environment panel and artifact panel are independent. At desktop widths the | ||
| two may be visible together. When the viewport cannot fit both, the artifact | ||
| panel normally takes priority and the environment panel is hidden without | ||
| losing its open state. Opening a subagent or background task from the | ||
| environment panel keeps that panel visible beside the resulting detail. A | ||
| floating environment panel is positioned within the remaining message area and | ||
| never overlaps the artifact panel. | ||
|
|
||
| ## Responsive behavior | ||
|
|
||
| The environment panel is hidden for split/full-page views. When the message | ||
| area cannot keep at least 800 pixels after docking the panel, the panel closes | ||
| and can be reopened as a floating popover. An open artifact panel takes | ||
| priority when both panels cannot fit, but the environment action remains | ||
| available for explicitly reopening the popover. The existing artifact drawer | ||
| behavior on narrow screens is unchanged. On desktop, the artifact panel is a | ||
| top-level layout column beside the chat shell, so it starts at the top of the | ||
| page and the chat header ends at the panel boundary. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deferred — critical-only mode (five change-producing rounds completed). The dangling "Opening an" fragment in the design doc is a valid doc fix; recorded for a follow-up so this round stays scoped to the Critical defect.
中文说明
暂缓——仅处理 Critical 模式(已完成五个产生改动的轮次)。设计文档中未写完的 "Opening an" 片段确实是需要修复的文档问题;已记录留待后续处理,以使本轮聚焦于 Critical 缺陷。