zidane-ui 9.5.2 → 9.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/index.js +2 -1
- package/dist/adapters/server-git-host.js +67 -0
- package/dist/adapters/server-host.js +9 -0
- package/dist/adapters/server-oauth-flow.d.ts +2 -2
- package/dist/adapters/server-oauth-flow.js +1 -1
- package/dist/adapters/server-projects.d.ts +53 -2
- package/dist/adapters/server-projects.js +4 -3
- package/dist/adapters/server-session-host.js +112 -4
- package/dist/channels/BindingEditorDialog.js +1 -1
- package/dist/channels/ChannelDefaultsSection.js +1 -1
- package/dist/channels/ChannelsSettingsSection.js +1 -1
- package/dist/channels/ConnectionSetupDialog.js +1 -1
- package/dist/channels/HeldRepliesList.js +1 -1
- package/dist/channels/ProjectChannelsSection.js +1 -1
- package/dist/chat/HostTranscript.js +1 -0
- package/dist/chat/SessionGroupHeader.js +2 -2
- package/dist/chat/composer/ComposerBadges.d.ts +27 -1
- package/dist/chat/composer/ComposerBadges.js +41 -5
- package/dist/chat/composer/ConversationBadges.d.ts +6 -0
- package/dist/chat/composer/ConversationBadges.js +70 -3
- package/dist/chat/composer/DraftPickers.js +4 -0
- package/dist/chat/composer/ServerScopeToggle.d.ts +16 -1
- package/dist/chat/composer/ServerScopeToggle.js +90 -47
- package/dist/chat/composer/index.d.ts +2 -2
- package/dist/chat/composer/use-draft-target.d.ts +18 -2
- package/dist/chat/composer/use-draft-target.js +74 -7
- package/dist/chat/composer/use-new-session-defaults.d.ts +3 -1
- package/dist/chat/composer/use-new-session-defaults.js +19 -14
- package/dist/chat/composer/use-send-prompt.js +2 -2
- package/dist/chat/headless/composer/index.d.ts +2 -2
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +7 -0
- package/dist/chat/headless/composer/labels-chrome.js +7 -0
- package/dist/chat/headless/composer/labels-editor.d.ts +4 -0
- package/dist/chat/headless/composer/labels-editor.js +4 -0
- package/dist/chat/headless/composer/models.d.ts +2 -0
- package/dist/chat/headless/composer/new-session-defaults.d.ts +12 -1
- package/dist/chat/headless/composer/new-session-defaults.js +30 -1
- package/dist/chat/headless/draft-target.d.ts +27 -6
- package/dist/chat/headless/draft-target.js +36 -3
- package/dist/chat/headless/host.d.ts +7 -0
- package/dist/chat/headless/index.d.ts +4 -4
- package/dist/chat/headless/index.js +29 -29
- package/dist/chat/headless/labels.d.ts +4 -0
- package/dist/chat/headless/send-flow.d.ts +2 -0
- package/dist/chat/headless/send-flow.js +2 -1
- package/dist/chat/headless/session-list.d.ts +4 -0
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +9 -1
- package/dist/chat/headless/sidebar/labels.js +4 -0
- package/dist/chat/headless/sidebar/rows.d.ts +48 -7
- package/dist/chat/headless/sidebar/rows.js +121 -22
- package/dist/chat/headless/sidebar/types.d.ts +5 -0
- package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
- package/dist/chat/headless/transcript/fold-actions.js +29 -1
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.js +2 -2
- package/dist/chat/rich-composer/RichComposer.js +58 -11
- package/dist/chat/rich-composer/composer-controls.d.ts +5 -1
- package/dist/chat/rich-composer/composer-controls.js +4 -4
- package/dist/chat/rich-composer/composer-keys.js +2 -2
- package/dist/chat/rich-composer/draft-collab.d.ts +91 -0
- package/dist/chat/rich-composer/draft-collab.js +310 -0
- package/dist/chat/rich-composer/use-composer-editor.d.ts +2 -0
- package/dist/chat/rich-composer/use-draft-collab.d.ts +53 -0
- package/dist/chat/rich-composer/use-draft-collab.js +92 -0
- package/dist/chat/rich-composer/use-draft-mirror.d.ts +11 -0
- package/dist/chat/rich-composer/use-draft-mirror.js +38 -9
- package/dist/chat/sidebar/InboxList.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +6 -2
- package/dist/chat/sidebar/ProjectIcon.js +7 -3
- package/dist/chat/sidebar/SessionSidebar.d.ts +30 -1
- package/dist/chat/sidebar/SessionSidebar.js +79 -7
- package/dist/chat/sidebar/SidebarGroupHeader.d.ts +12 -4
- package/dist/chat/sidebar/SidebarGroupHeader.js +70 -28
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/transcript/actions.d.ts +6 -0
- package/dist/chat/transcript/fold.d.ts +2 -1
- package/dist/chat/transcript/fold.js +26 -1
- package/dist/chat/transcript/index.js +3 -3
- package/dist/chat/transcript/notices.d.ts +5 -2
- package/dist/chat/transcript/notices.js +23 -3
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/components/Avatar.d.ts +36 -0
- package/dist/components/Avatar.js +56 -0
- package/dist/components/AvatarStack.d.ts +58 -0
- package/dist/components/AvatarStack.js +187 -0
- package/dist/components/Tabs.d.ts +6 -1
- package/dist/components/Tabs.js +43 -39
- package/dist/core.css +19 -1
- package/dist/dist/{index-DPbpsCtl.d.ts → index-ChabiHpR.d.ts} +1 -1
- package/dist/dist/index.d.ts +1 -1
- package/dist/git/headless/environment.d.ts +15 -0
- package/dist/git/headless/environment.js +18 -1
- package/dist/git/headless/github.d.ts +11 -0
- package/dist/git/headless/github.js +15 -0
- package/dist/git/headless/host.d.ts +109 -0
- package/dist/git/headless/index.d.ts +5 -4
- package/dist/git/headless/index.js +4 -3
- package/dist/git/headless/labels.d.ts +16 -1
- package/dist/git/headless/labels.js +25 -1
- package/dist/git/testing/contract.d.ts +22 -4
- package/dist/git/testing/contract.js +173 -3
- package/dist/git/testing/index.d.ts +22 -1
- package/dist/git/testing/index.js +135 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/labels.d.ts +4 -0
- package/dist/labels.js +4 -0
- package/dist/onboarding/headless/labels.d.ts +4 -0
- package/dist/session/DraftPeopleStack.d.ts +24 -0
- package/dist/session/DraftPeopleStack.js +48 -0
- package/dist/session/NewProjectDialog.d.ts +28 -8
- package/dist/session/NewProjectDialog.js +225 -40
- package/dist/session/PersonCard.d.ts +29 -0
- package/dist/session/PersonCard.js +199 -0
- package/dist/session/ProjectArtifactsSection.d.ts +4 -1
- package/dist/session/ProjectArtifactsSection.js +149 -34
- package/dist/session/ProjectHome.d.ts +1 -1
- package/dist/session/ProjectHome.js +23 -4
- package/dist/session/ProjectName.d.ts +11 -6
- package/dist/session/ProjectName.js +27 -13
- package/dist/session/ProjectPeopleStack.d.ts +26 -0
- package/dist/session/ProjectPeopleStack.js +56 -0
- package/dist/session/ProjectPublishDialog.js +9 -3
- package/dist/session/ProjectSettingsDialog.d.ts +1 -1
- package/dist/session/ProjectSettingsDialog.js +171 -66
- package/dist/session/ProjectShareDialog.d.ts +1 -1
- package/dist/session/ProjectShareDialog.js +16 -6
- package/dist/session/ProjectToolsSection.js +88 -96
- package/dist/session/ProjectUsage.d.ts +4 -1
- package/dist/session/ProjectUsage.js +13 -4
- package/dist/session/SessionDetailsDialog.d.ts +5 -1
- package/dist/session/SessionDetailsDialog.js +67 -10
- package/dist/session/SessionPeopleStack.js +19 -37
- package/dist/session/SessionProjectPicker.d.ts +54 -0
- package/dist/session/SessionProjectPicker.js +175 -0
- package/dist/session/SessionProvider.d.ts +15 -1
- package/dist/session/SessionProvider.js +28 -6
- package/dist/session/UsageSection.d.ts +2 -4
- package/dist/session/UsageSection.js +57 -55
- package/dist/session/headless/draft-collab.d.ts +55 -0
- package/dist/session/headless/draft-collab.js +127 -0
- package/dist/session/headless/draft-room.d.ts +124 -0
- package/dist/session/headless/draft-room.js +340 -0
- package/dist/session/headless/drafts.d.ts +93 -0
- package/dist/session/headless/drafts.js +79 -0
- package/dist/session/headless/fixture-drafts.d.ts +54 -0
- package/dist/session/headless/fixture-drafts.js +286 -0
- package/dist/session/headless/fixture-host.d.ts +18 -2
- package/dist/session/headless/fixture-host.js +41 -7
- package/dist/session/headless/fixture-projects.d.ts +6 -4
- package/dist/session/headless/fixture-projects.js +25 -4
- package/dist/session/headless/host.d.ts +34 -6
- package/dist/session/headless/index.d.ts +6 -3
- package/dist/session/headless/index.js +6 -3
- package/dist/session/headless/labels.d.ts +47 -2
- package/dist/session/headless/labels.js +17 -1
- package/dist/session/headless/people.d.ts +27 -3
- package/dist/session/headless/people.js +38 -20
- package/dist/session/headless/project-artifact-labels.d.ts +7 -0
- package/dist/session/headless/project-artifact-labels.js +7 -0
- package/dist/session/headless/project-artifacts.d.ts +8 -0
- package/dist/session/headless/project-artifacts.js +15 -1
- package/dist/session/headless/project-labels.d.ts +25 -0
- package/dist/session/headless/project-labels.js +25 -0
- package/dist/session/headless/shared-with.d.ts +28 -0
- package/dist/session/headless/shared-with.js +51 -0
- package/dist/session/host-context.d.ts +11 -0
- package/dist/session/host-context.js +14 -0
- package/dist/session/index.d.ts +7 -3
- package/dist/session/index.js +6 -2
- package/dist/session/new-project-parts.d.ts +67 -0
- package/dist/session/new-project-parts.js +470 -0
- package/dist/session/project-artifact-parts.d.ts +2 -1
- package/dist/session/project-artifact-parts.js +5 -2
- package/dist/session/project-people.d.ts +14 -0
- package/dist/session/project-people.js +86 -0
- package/dist/session/share-people.d.ts +12 -0
- package/dist/session/share-people.js +1 -1
- package/dist/session/testing/contract.d.ts +6 -3
- package/dist/session/testing/contract.js +24 -3
- package/dist/session/testing/drafts.contract.d.ts +30 -0
- package/dist/session/testing/drafts.contract.js +126 -0
- package/dist/session/testing/index.d.ts +2 -1
- package/dist/session/testing/index.js +2 -1
- package/dist/session/use-home-projects.d.ts +11 -2
- package/dist/session/use-home-projects.js +142 -5
- package/dist/session/useDraftCollab.d.ts +24 -0
- package/dist/session/useDraftCollab.js +78 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.js +9 -9
- package/dist/settings/sections/index.js +1 -1
- package/dist/settings/sections/providers/CredentialSources.d.ts +5 -5
- package/dist/settings/sections/providers/CredentialSources.js +5 -22
- package/dist/settings/sections/providers/labels.d.ts +1 -9
- package/dist/settings/sections/providers/labels.js +1 -9
- package/dist/styles.css +20 -9
- package/package.json +4 -3
- package/src/styles/sidebar.css +2 -3
|
@@ -64,6 +64,8 @@ const GLYPH_SIZE = {
|
|
|
64
64
|
glyph: "text-zg-title"
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
+
/** The default glyph of a server's project. */
|
|
68
|
+
const SERVER_PROJECT_GLYPH = "i-ph-cloud";
|
|
67
69
|
/** The glyph inside a project's icon slot: the picked image or emoji, else the default glyph. */
|
|
68
70
|
function iconGlyph(icon, isGitRepo, defaultGlyph, size) {
|
|
69
71
|
const s = GLYPH_SIZE[size];
|
|
@@ -86,12 +88,12 @@ function iconGlyph(icon, isGitRepo, defaultGlyph, size) {
|
|
|
86
88
|
*
|
|
87
89
|
* @param props - The {@link ProjectIconGlyphProps}.
|
|
88
90
|
*/
|
|
89
|
-
function ProjectIconGlyph({ icon, isGitRepo, defaultGlyph, size = "sm", className, style }) {
|
|
91
|
+
function ProjectIconGlyph({ icon, isGitRepo, defaultGlyph, server = false, size = "sm", className, style }) {
|
|
90
92
|
return /* @__PURE__ */ jsx("span", {
|
|
91
93
|
"aria-hidden": true,
|
|
92
94
|
className: [`inline-flex items-center justify-center shrink-0 overflow-hidden ${GLYPH_SIZE[size].slot}`, className].filter(Boolean).join(" "),
|
|
93
95
|
style,
|
|
94
|
-
children: iconGlyph(icon, isGitRepo, defaultGlyph, size)
|
|
96
|
+
children: iconGlyph(icon, isGitRepo, defaultGlyph ?? (server ? SERVER_PROJECT_GLYPH : void 0), size)
|
|
95
97
|
});
|
|
96
98
|
}
|
|
97
99
|
/** Downscale target in px: well above the 18px display slot so it stays sharp on retina, ~2–4 KB as webp. */
|
|
@@ -130,11 +132,12 @@ const POPOVER_WIDTH = 232;
|
|
|
130
132
|
*
|
|
131
133
|
* @param props - The {@link ProjectIconButtonProps}.
|
|
132
134
|
*/
|
|
133
|
-
function ProjectIconButton({ fullPath, label, icon, isGitRepo, defaultGlyph, title, onAssign, className, style }) {
|
|
135
|
+
function ProjectIconButton({ fullPath, label, icon, isGitRepo, defaultGlyph: defaultGlyphProp, server = false, title, onAssign, className, style }) {
|
|
134
136
|
const labels = useSidebarLabels();
|
|
135
137
|
const popover = usePopover();
|
|
136
138
|
const { triggerRef, surfaceRef } = popover;
|
|
137
139
|
const tip = useTooltip(title ?? labels.changeProjectIcon, { disabled: popover.open });
|
|
140
|
+
const defaultGlyph = defaultGlyphProp ?? (server ? SERVER_PROJECT_GLYPH : void 0);
|
|
138
141
|
const glyph = iconGlyph(icon, isGitRepo, defaultGlyph, "sm");
|
|
139
142
|
if (!fullPath) return /* @__PURE__ */ jsx(ProjectIconGlyph, {
|
|
140
143
|
...icon ? { icon } : {},
|
|
@@ -178,6 +181,7 @@ function ProjectIconButton({ fullPath, label, icon, isGitRepo, defaultGlyph, tit
|
|
|
178
181
|
className: "p-2",
|
|
179
182
|
children: popover.open && /* @__PURE__ */ jsx(IconPicker, {
|
|
180
183
|
hasIcon: Boolean(icon),
|
|
184
|
+
...server ? { resetLabel: labels.resetToCloud } : {},
|
|
181
185
|
onPick: (next) => {
|
|
182
186
|
onAssign(fullPath, next);
|
|
183
187
|
popover.close();
|
|
@@ -2,6 +2,7 @@ import { ExtensionItem } from "../../extensions/headless/wire.js";
|
|
|
2
2
|
import { HostView } from "../headless/hosts.js";
|
|
3
3
|
import { ProjectIcon } from "../headless/sidebar/project-icons.js";
|
|
4
4
|
import { SidebarQueryLayer } from "../headless/sidebar/query.js";
|
|
5
|
+
import { SidebarServerProjectRef } from "../headless/sidebar/rows.js";
|
|
5
6
|
import { SessionArchiveFilter, SidebarGroupBy, SidebarInboxGroupBy, SidebarLayout, SidebarListSession, SidebarSortBy, SidebarView } from "../headless/sidebar/types.js";
|
|
6
7
|
import { SidebarProject } from "./session-menu.js";
|
|
7
8
|
import { SidebarLive } from "./sidebar-live.js";
|
|
@@ -49,6 +50,18 @@ export interface SidebarHomeProject extends SidebarProjectRecord {
|
|
|
49
50
|
*/
|
|
50
51
|
folders?: readonly string[];
|
|
51
52
|
}
|
|
53
|
+
/** A project of a server, as the sidebar lists it. */
|
|
54
|
+
export interface SidebarServerProject extends SidebarProjectRecord {
|
|
55
|
+
/** Its home folder on the server: that server's sessions in it are listed under it too. */
|
|
56
|
+
home?: string;
|
|
57
|
+
}
|
|
58
|
+
/** A server's projects, once read: that server's sessions are listed under their project, else in Chats. */
|
|
59
|
+
export interface SidebarServerProjects {
|
|
60
|
+
/** The server (its `HostView` id). */
|
|
61
|
+
hostId: string;
|
|
62
|
+
/** Its projects, each with the sessions filed in it (`sessions`: the ids this list knows them by). */
|
|
63
|
+
projects: readonly SidebarServerProject[];
|
|
64
|
+
}
|
|
52
65
|
/** Props of {@link SessionSidebar}. */
|
|
53
66
|
export interface SessionSidebarProps<S extends SidebarRowSession> {
|
|
54
67
|
/** The sessions the list shows (the shown space's filters applied). */
|
|
@@ -88,7 +101,7 @@ export interface SessionSidebarProps<S extends SidebarRowSession> {
|
|
|
88
101
|
/** Starts a new session in a project's folder. */
|
|
89
102
|
onNewSessionIn: (path: string) => void;
|
|
90
103
|
/**
|
|
91
|
-
* Opens a project's home (its name clicked; a server's project too). Present: project names open it and
|
|
104
|
+
* Opens a project's home (its name clicked; a server's project too, by its id, with no folder too). Present: project names open it and
|
|
92
105
|
* their collapse moves to a chevron after their buttons. Absent: names toggle collapse.
|
|
93
106
|
*/
|
|
94
107
|
onOpenProject?: (project: SidebarProjectRef) => void;
|
|
@@ -106,6 +119,8 @@ export interface SessionSidebarProps<S extends SidebarRowSession> {
|
|
|
106
119
|
* Absent: none listed.
|
|
107
120
|
*/
|
|
108
121
|
folderlessProjects?: readonly SidebarProjectRecord[];
|
|
122
|
+
/** The list's own host is a server (the web app): its projects with no icon show the server's glyph. */
|
|
123
|
+
projectsOnServer?: boolean;
|
|
109
124
|
/** Opens the home of a project with no folder. */
|
|
110
125
|
onOpenProjectRecord?: (projectId: string) => void;
|
|
111
126
|
/** The project with no folder whose home shows: its header wears the active chip. */
|
|
@@ -119,6 +134,20 @@ export interface SessionSidebarProps<S extends SidebarRowSession> {
|
|
|
119
134
|
homeProjects?: readonly SidebarHomeProject[];
|
|
120
135
|
/** A project's icon was picked (`null`: reset) on its home's group or on the header of a project with no folder: the host keeps it. */
|
|
121
136
|
onSetProjectIcon?: (projectId: string, icon: ProjectIcon | null) => void;
|
|
137
|
+
/**
|
|
138
|
+
* The projects of each server whose projects are read (`Settings.projectHome`), in a view grouped by folder: a
|
|
139
|
+
* session of that server is listed under its project, with the project's icon (else a cloud) and the server's
|
|
140
|
+
* badge, and a session in none in Chats. A server not listed groups its sessions by folder.
|
|
141
|
+
*/
|
|
142
|
+
serverProjects?: readonly SidebarServerProjects[];
|
|
143
|
+
/**
|
|
144
|
+
* What a server project's header shows at its end (who is in it, `ProjectPeopleStack`), given the list's own openers
|
|
145
|
+
* for a person's card. Absent: nothing.
|
|
146
|
+
*/
|
|
147
|
+
projectPeople?: (project: SidebarServerProjectRef, open: {
|
|
148
|
+
onOpenProject?: (projectId: string, hostId?: string) => void;
|
|
149
|
+
onOpenSession: (sessionId: string) => void;
|
|
150
|
+
}) => ReactNode;
|
|
122
151
|
/** Renames a session. */
|
|
123
152
|
onRename: (sessionId: S['id'], title: string) => Promise<void>;
|
|
124
153
|
/** Archives or restores a session. */
|
|
@@ -9,6 +9,8 @@ import { readExitMs, readMotionMs } from "../../motion/presence.js";
|
|
|
9
9
|
import { useWithFade } from "../../motion/springs.js";
|
|
10
10
|
import { FlipSnapshot, useFlipList } from "../../motion/use-flip-list.js";
|
|
11
11
|
import { basename } from "../../path.js";
|
|
12
|
+
import { ProjectPeopleStack } from "../../session/ProjectPeopleStack.js";
|
|
13
|
+
import { useSessionProjectsOf } from "../../session/SessionProvider.js";
|
|
12
14
|
import { useOptionalWorkspaceActions } from "../../workspace/WorkspaceProvider.js";
|
|
13
15
|
import { compareSessions } from "../headless/session-list.js";
|
|
14
16
|
import { INBOX_EARLIER_AFTER_MS } from "../headless/sidebar/inbox.js";
|
|
@@ -146,6 +148,10 @@ function NewSessionButton({ onNewSession, isActive, className = "", style }) {
|
|
|
146
148
|
}), tip.tip]
|
|
147
149
|
});
|
|
148
150
|
}
|
|
151
|
+
/** A server project's people, drawn by the app's `projectPeople` as an element: its openers run on a click, never in render. */
|
|
152
|
+
function ServerProjectPeople({ render, project, open }) {
|
|
153
|
+
return render(project, open);
|
|
154
|
+
}
|
|
149
155
|
/** The link key of a session a view started: the `zidane.startedFromKey` facet (docs/VIEWS-ORCHESTRATION.md). */
|
|
150
156
|
function startedFromKeyOf(session) {
|
|
151
157
|
const key = session.facets?.["zidane.startedFromKey"];
|
|
@@ -159,7 +165,7 @@ const NO_DECORATIONS = [];
|
|
|
159
165
|
* @param props - The directory's view, the app's actions, the live row parts, the footer and the frame.
|
|
160
166
|
*/
|
|
161
167
|
function SessionSidebar(props) {
|
|
162
|
-
const { sessions: allSessions, hosts, groupBy, sortBy, archiveFilter, activeSessionId, onActivate, orchestration, spacesOn, spaces, listSpaceId, spaceSlide: lastSpaceSwitch, search, live, runDetails = true, artifactBadges = true, onNewSession, onNewSessionIn: newSessionIn, onOpenProject, openProject, onOpenChats, chatsOpen = false, folderlessProjects, onOpenProjectRecord, openProjectId = null, homeProjects, onSetProjectIcon, onRename, onSetArchived, onSetFavorite, onSetInboxState, layout = "groups", inboxEarlierAfterMs = INBOX_EARLIER_AFTER_MS, inboxGroupBy: inboxGroupByProp, onDelete, onMoveToSpace, onMoveSession, onTeleportSession, onShareSession, canShareSession, onMoveProjectToSpace, onArchiveProject, onDeleteProject: deleteProject, keyboardBlocked, query, onViewChange, agentNames: agentNamesProp, onOpenItem, filter, footer, collapsed, width, onWidthCommit, chromeInset, ariaLabel, className, style } = props;
|
|
168
|
+
const { sessions: allSessions, hosts, groupBy, sortBy, archiveFilter, activeSessionId, onActivate, orchestration, spacesOn, spaces, listSpaceId, spaceSlide: lastSpaceSwitch, search, live, runDetails = true, artifactBadges = true, onNewSession, onNewSessionIn: newSessionIn, onOpenProject, openProject, onOpenChats, chatsOpen = false, folderlessProjects, projectsOnServer = false, onOpenProjectRecord, openProjectId = null, homeProjects, onSetProjectIcon, serverProjects, projectPeople, onRename, onSetArchived, onSetFavorite, onSetInboxState, layout = "groups", inboxEarlierAfterMs = INBOX_EARLIER_AFTER_MS, inboxGroupBy: inboxGroupByProp, onDelete, onMoveToSpace, onMoveSession, onTeleportSession, onShareSession, canShareSession, onMoveProjectToSpace, onArchiveProject, onDeleteProject: deleteProject, keyboardBlocked, query, onViewChange, agentNames: agentNamesProp, onOpenItem, filter, footer, collapsed, width, onWidthCommit, chromeInset, ariaLabel, className, style } = props;
|
|
163
169
|
const labels = useSidebarLabels();
|
|
164
170
|
const notify = useSidebarNotice();
|
|
165
171
|
const environment = useEnvironmentCommands();
|
|
@@ -225,8 +231,15 @@ function SessionSidebar(props) {
|
|
|
225
231
|
name: p.name,
|
|
226
232
|
...p.sessions ? { sessions: p.sessions } : {}
|
|
227
233
|
}))];
|
|
228
|
-
|
|
229
|
-
|
|
234
|
+
const servers = serverProjects ?? [];
|
|
235
|
+
return groups.length > 0 || servers.length > 0 ? sidebarProjectIndex(groups, servers) : void 0;
|
|
236
|
+
}, [
|
|
237
|
+
homeProjects,
|
|
238
|
+
shownRecords,
|
|
239
|
+
serverProjects
|
|
240
|
+
]);
|
|
241
|
+
/** Each server project's icon, by server and project. */
|
|
242
|
+
const serverIcons = useMemo(() => new Map((serverProjects ?? []).flatMap((server) => server.projects.flatMap((p) => p.icon ? [[`${server.hostId}\u0000${p.id}`, p.icon]] : []))), [serverProjects]);
|
|
230
243
|
const setProjectIcon = useCallback((fullPath, icon) => {
|
|
231
244
|
const recordId = projectIdOfGroup(fullPath);
|
|
232
245
|
if (recordId !== null) return onSetProjectIcon?.(recordId, icon);
|
|
@@ -663,6 +676,59 @@ function SessionSidebar(props) {
|
|
|
663
676
|
commitImmediate(null);
|
|
664
677
|
onNewSession();
|
|
665
678
|
}, [commitImmediate, onNewSession]);
|
|
679
|
+
const projectsOf = useSessionProjectsOf();
|
|
680
|
+
const opened = useRef({
|
|
681
|
+
recordById,
|
|
682
|
+
homeProjects,
|
|
683
|
+
onOpenProject,
|
|
684
|
+
onOpenProjectRecord,
|
|
685
|
+
allSessions,
|
|
686
|
+
onRowSelect,
|
|
687
|
+
projectsOf
|
|
688
|
+
});
|
|
689
|
+
useEffect(() => {
|
|
690
|
+
opened.current = {
|
|
691
|
+
recordById,
|
|
692
|
+
homeProjects,
|
|
693
|
+
onOpenProject,
|
|
694
|
+
onOpenProjectRecord,
|
|
695
|
+
allSessions,
|
|
696
|
+
onRowSelect,
|
|
697
|
+
projectsOf
|
|
698
|
+
};
|
|
699
|
+
});
|
|
700
|
+
const openSharedProject = useCallback((projectId, hostId) => {
|
|
701
|
+
const { recordById: records, homeProjects: homes, onOpenProject: openHome, onOpenProjectRecord: openRecord, projectsOf: projectsOfHost } = opened.current;
|
|
702
|
+
if (hostId) {
|
|
703
|
+
const project = projectsOfHost?.(hostId).get()?.list.get()?.find((listed) => listed.id === projectId);
|
|
704
|
+
if (project) openHome?.({
|
|
705
|
+
path: project.home ?? "",
|
|
706
|
+
hostId,
|
|
707
|
+
projectId
|
|
708
|
+
});
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
if (records.has(projectId)) return openRecord?.(projectId);
|
|
712
|
+
const home = homes?.find((project) => project.id === projectId)?.home;
|
|
713
|
+
if (home) openHome?.({ path: home });
|
|
714
|
+
}, []);
|
|
715
|
+
const openSharedSession = useCallback((sessionId) => {
|
|
716
|
+
const { allSessions: listed, onRowSelect: select } = opened.current;
|
|
717
|
+
if (listed.some((session) => session.id === sessionId)) select(sessionId);
|
|
718
|
+
}, []);
|
|
719
|
+
const opensProjects = Boolean(onOpenProject || onOpenProjectRecord);
|
|
720
|
+
const peopleOpeners = useMemo(() => ({
|
|
721
|
+
...opensProjects ? { onOpenProject: openSharedProject } : {},
|
|
722
|
+
onOpenSession: openSharedSession
|
|
723
|
+
}), [
|
|
724
|
+
opensProjects,
|
|
725
|
+
openSharedProject,
|
|
726
|
+
openSharedSession
|
|
727
|
+
]);
|
|
728
|
+
const peopleOf = (projectId) => projectId === void 0 ? void 0 : /* @__PURE__ */ jsx(ProjectPeopleStack, {
|
|
729
|
+
projectId,
|
|
730
|
+
...peopleOpeners
|
|
731
|
+
});
|
|
666
732
|
const frame = useSidebarFrame({
|
|
667
733
|
collapsed,
|
|
668
734
|
width,
|
|
@@ -687,13 +753,14 @@ function SessionSidebar(props) {
|
|
|
687
753
|
}) : /* @__PURE__ */ jsx(SidebarGroupHeader, {
|
|
688
754
|
row: header,
|
|
689
755
|
groupBy: listGroupBy,
|
|
690
|
-
icon: header.projectId !== void 0 ? recordById.get(header.projectId)?.icon : header.fullPath ? homeOf(header)?.icon ?? projectIcons[header.fullPath] : void 0,
|
|
756
|
+
icon: header.serverProject ? serverIcons.get(`${header.serverProject.hostId}\u0000${header.serverProject.projectId}`) : header.projectId !== void 0 ? recordById.get(header.projectId)?.icon : header.fullPath ? homeOf(header)?.icon ?? projectIcons[header.fullPath] : void 0,
|
|
691
757
|
...renamedHome(homeOf(header)) ? { projectName: homeOf(header).name } : {},
|
|
692
|
-
...header.projectId !== void 0 ? onSetProjectIcon && !recordById.get(header.projectId)?.iconLocked ? { onAssignIcon: setProjectIcon } : {} : homeOf(header)?.iconLocked ? {} : { onAssignIcon: setProjectIcon },
|
|
758
|
+
...header.projectId !== void 0 ? onSetProjectIcon && !recordById.get(header.projectId)?.iconLocked ? { onAssignIcon: setProjectIcon } : {} : header.serverProject || homeOf(header)?.iconLocked ? {} : { onAssignIcon: setProjectIcon },
|
|
693
759
|
...header.projectId !== void 0 && onOpenProjectRecord ? {
|
|
694
760
|
onOpenProjectRecord,
|
|
695
761
|
open: activeSessionId == null && openProjectId === header.projectId
|
|
696
762
|
} : {},
|
|
763
|
+
...projectsOnServer && (header.projectId !== void 0 || homeOf(header) !== void 0) ? { serverGlyph: true } : {},
|
|
697
764
|
onToggle: toggleGroup,
|
|
698
765
|
onNewSessionIn,
|
|
699
766
|
spaces: onMoveProjectToSpace ? rowDetails.spaces : null,
|
|
@@ -707,12 +774,17 @@ function SessionSidebar(props) {
|
|
|
707
774
|
...header.hostId && hostById.get(header.hostId) ? { server: hostById.get(header.hostId) } : {},
|
|
708
775
|
...onOpenProject && header.projectId === void 0 ? {
|
|
709
776
|
onOpenProject,
|
|
710
|
-
open: activeSessionId == null && openProject != null && openProject.path === header.fullPath && openProject.hostId === header.hostId
|
|
777
|
+
open: activeSessionId == null && openProject != null && (header.serverProject ? openProject.hostId === header.serverProject.hostId && (openProject.projectId !== void 0 ? openProject.projectId === header.serverProject.projectId : openProject.path === header.serverProject.home) : openProject.path === header.fullPath && openProject.hostId === header.hostId)
|
|
711
778
|
} : {},
|
|
712
779
|
...onOpenChats && header.chats ? {
|
|
713
780
|
onOpenChats,
|
|
714
781
|
open: activeSessionId == null && chatsOpen
|
|
715
|
-
} : {}
|
|
782
|
+
} : {},
|
|
783
|
+
people: header.serverProject ? projectPeople && /* @__PURE__ */ jsx(ServerProjectPeople, {
|
|
784
|
+
render: projectPeople,
|
|
785
|
+
project: header.serverProject,
|
|
786
|
+
open: peopleOpeners
|
|
787
|
+
}) : peopleOf(header.projectId ?? homeOf(header)?.id)
|
|
716
788
|
}), /* @__PURE__ */ jsx(SidebarFold, {
|
|
717
789
|
open: !header.collapsed || node.children.length > 0,
|
|
718
790
|
children: node.children.map((child) => renderNode(child, header.kind === "host" ? header.host.id : header.hostId))
|
|
@@ -16,21 +16,25 @@
|
|
|
16
16
|
* project's name, with the folder as its hover hint. A project with no folder
|
|
17
17
|
* (`row.projectId`) has its "+", its pin and a menu of both; its name opens
|
|
18
18
|
* its home (`onOpenProjectRecord`), and with nothing filed in it there is
|
|
19
|
-
* nothing to fold.
|
|
19
|
+
* nothing to fold. A server's project (`row.serverProject`) shows its icon
|
|
20
|
+
* or a cloud and its server's badge; its name opens its home on the server,
|
|
21
|
+
* by its id (with no folder too).
|
|
20
22
|
*/
|
|
21
23
|
import { HostView } from "../headless/hosts.js";
|
|
22
24
|
import { ProjectIcon } from "../headless/sidebar/project-icons.js";
|
|
23
25
|
import { SidebarListRow } from "../headless/sidebar/rows.js";
|
|
24
26
|
import { SidebarGroupBy } from "../headless/sidebar/types.js";
|
|
25
27
|
import { SidebarProject } from "./session-menu.js";
|
|
26
|
-
import { CSSProperties } from "react";
|
|
28
|
+
import { CSSProperties, ReactNode } from "react";
|
|
27
29
|
import { Space } from "zidane/chat/pure";
|
|
28
30
|
/** A project folder as the sidebar names it: its path, and the server it is on (absent: this computer). */
|
|
29
31
|
export interface SidebarProjectRef {
|
|
30
|
-
/** The folder. */
|
|
32
|
+
/** The folder; `''` for a server's project with no folder. */
|
|
31
33
|
path: string;
|
|
32
34
|
/** The saved server; absent: this computer. */
|
|
33
35
|
hostId?: string;
|
|
36
|
+
/** A server's project (`row.serverProject`), by its id there: its home is `path`. Absent: a folder. */
|
|
37
|
+
projectId?: string;
|
|
34
38
|
}
|
|
35
39
|
/** A group header row. */
|
|
36
40
|
export type SidebarHeaderRow = Extract<SidebarListRow, {
|
|
@@ -78,6 +82,10 @@ export interface SidebarGroupHeaderProps {
|
|
|
78
82
|
onOpenProjectRecord?: (projectId: string) => void;
|
|
79
83
|
/** This project's home, or for Chats a new chat with no folder, is the one shown. */
|
|
80
84
|
open?: boolean;
|
|
85
|
+
/** Who else is in the project now (`ProjectPeopleStack`), before the header's buttons. */
|
|
86
|
+
people?: ReactNode;
|
|
87
|
+
/** The project is on a server (the list's own host is one): with no icon, it shows the server's glyph. */
|
|
88
|
+
serverGlyph?: boolean;
|
|
81
89
|
/** Extra classes on the header. */
|
|
82
90
|
className?: string;
|
|
83
91
|
/** Inline styles on the header. */
|
|
@@ -88,4 +96,4 @@ export interface SidebarGroupHeaderProps {
|
|
|
88
96
|
*
|
|
89
97
|
* @param props - The header row, the view, its icon and the project actions.
|
|
90
98
|
*/
|
|
91
|
-
export declare function SidebarGroupHeader({ row, groupBy, icon, projectName, onAssignIcon, onToggle, onNewSessionIn, spaces, spaceId, onMoveProject, pinned, onSetPinned, canArchive, onArchiveProject, onDeleteProject, server, onOpenProject, onOpenChats, onOpenProjectRecord, open, className, style }: SidebarGroupHeaderProps): import("react").JSX.Element;
|
|
99
|
+
export declare function SidebarGroupHeader({ row, groupBy, icon, projectName, onAssignIcon, onToggle, onNewSessionIn, spaces, spaceId, onMoveProject, pinned, onSetPinned, canArchive, onArchiveProject, onDeleteProject, server, onOpenProject, onOpenChats, onOpenProjectRecord, open, people, serverGlyph, className, style }: SidebarGroupHeaderProps): import("react").JSX.Element;
|
|
@@ -11,12 +11,22 @@ import { useState } from "react";
|
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { resolveSessionSpace } from "zidane/chat/pure";
|
|
13
13
|
// src/chat/sidebar/SidebarGroupHeader.tsx
|
|
14
|
+
/** A machine's badge, as `HostBadge` draws a host: the folder of a server's machine names it. */
|
|
15
|
+
const MACHINE_BADGE = "zg-row-badge text-zg-meta inline-flex items-center gap-1 h-[18px] px-1.5 rounded-zg-sm whitespace-nowrap min-w-0";
|
|
16
|
+
/** The people's faces, ringed in the header's tray tone and raised on it, then the header's own action. */
|
|
17
|
+
function withPeople(people, action) {
|
|
18
|
+
if (!people) return action;
|
|
19
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: "inline-flex shrink-0 empty:hidden [--zg-avatar-ring:var(--zg-tray)] [--zg-avatar-bg:var(--zg-raised)]",
|
|
21
|
+
children: people
|
|
22
|
+
}), action] });
|
|
23
|
+
}
|
|
14
24
|
/**
|
|
15
25
|
* Renders a group header of the sidebar list.
|
|
16
26
|
*
|
|
17
27
|
* @param props - The header row, the view, its icon and the project actions.
|
|
18
28
|
*/
|
|
19
|
-
function SidebarGroupHeader({ row, groupBy, icon, projectName, onAssignIcon, onToggle, onNewSessionIn, spaces, spaceId, onMoveProject, pinned, onSetPinned, canArchive, onArchiveProject, onDeleteProject, server, onOpenProject, onOpenChats, onOpenProjectRecord, open = false, className = "", style }) {
|
|
29
|
+
function SidebarGroupHeader({ row, groupBy, icon, projectName, onAssignIcon, onToggle, onNewSessionIn, spaces, spaceId, onMoveProject, pinned, onSetPinned, canArchive, onArchiveProject, onDeleteProject, server, onOpenProject, onOpenChats, onOpenProjectRecord, open = false, people, serverGlyph = false, className = "", style }) {
|
|
20
30
|
const labels = useSidebarLabels();
|
|
21
31
|
const { revealPath, openHostSettings } = useSidebarHost();
|
|
22
32
|
const label = projectName ?? row.label;
|
|
@@ -27,6 +37,7 @@ function SidebarGroupHeader({ row, groupBy, icon, projectName, onAssignIcon, onT
|
|
|
27
37
|
const path = isProjectFolder && recordId === void 0 ? row.fullPath : void 0;
|
|
28
38
|
const recordKey = recordId !== void 0 ? row.fullPath : void 0;
|
|
29
39
|
const repo = row.repoKey ? { repoKey: row.repoKey } : {};
|
|
40
|
+
const serverHome = row.serverProject?.home;
|
|
30
41
|
/** Where the right-click opened the project's menu; `null` while it is closed. */
|
|
31
42
|
const [menuAt, setMenuAt] = useState(null);
|
|
32
43
|
const menuItems = path ? [
|
|
@@ -93,6 +104,49 @@ function SidebarGroupHeader({ row, groupBy, icon, projectName, onAssignIcon, onT
|
|
|
93
104
|
onSelect: () => onSetPinned(recordKey, !pinned)
|
|
94
105
|
}] : [];
|
|
95
106
|
const hasMenu = menuItems.length > 0;
|
|
107
|
+
const action = row.machine ? /* @__PURE__ */ jsxs("span", {
|
|
108
|
+
className: "inline-flex items-center gap-1 min-w-0 max-w-[60%]",
|
|
109
|
+
children: [row.hostId && server && /* @__PURE__ */ jsx(HostBadge, {
|
|
110
|
+
host: server,
|
|
111
|
+
icon: true,
|
|
112
|
+
className: "min-w-0",
|
|
113
|
+
...openHostSettings ? { onOpen: () => void openHostSettings(server.id) } : {}
|
|
114
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
115
|
+
"data-testid": "header-badge-machine",
|
|
116
|
+
className: MACHINE_BADGE,
|
|
117
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
118
|
+
"aria-hidden": true,
|
|
119
|
+
className: "i-ph-desktop-tower text-zg-meta shrink-0"
|
|
120
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
121
|
+
className: "truncate",
|
|
122
|
+
children: row.machine
|
|
123
|
+
})]
|
|
124
|
+
})]
|
|
125
|
+
}) : row.hostId && server ? /* @__PURE__ */ jsx(HostBadge, {
|
|
126
|
+
host: server,
|
|
127
|
+
icon: true,
|
|
128
|
+
className: "min-w-0 max-w-[60%]",
|
|
129
|
+
...openHostSettings ? { onOpen: () => void openHostSettings(server.id) } : {}
|
|
130
|
+
}) : isProjectFolder && row.fullPath ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
131
|
+
icon: "i-ph-plus",
|
|
132
|
+
label: labels.newSessionIn(label),
|
|
133
|
+
size: "xs",
|
|
134
|
+
className: "zg-row-dots",
|
|
135
|
+
onClick: (event) => {
|
|
136
|
+
event.stopPropagation();
|
|
137
|
+
onNewSessionIn(row.fullPath);
|
|
138
|
+
}
|
|
139
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
140
|
+
icon: pinned ? "i-ph-push-pin-fill" : "i-ph-push-pin",
|
|
141
|
+
label: pinned ? labels.unpinNamed(label) : labels.pinNamed(label),
|
|
142
|
+
size: "xs",
|
|
143
|
+
"aria-pressed": pinned,
|
|
144
|
+
className: "zg-row-dots",
|
|
145
|
+
onClick: (event) => {
|
|
146
|
+
event.stopPropagation();
|
|
147
|
+
onSetPinned(row.fullPath, !pinned);
|
|
148
|
+
}
|
|
149
|
+
})] }) : void 0;
|
|
96
150
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SessionGroupHeader, {
|
|
97
151
|
className: `zg-sticky-head${className ? ` ${className}` : ""}`,
|
|
98
152
|
...style ? { style } : {},
|
|
@@ -118,45 +172,33 @@ function SidebarGroupHeader({ row, groupBy, icon, projectName, onAssignIcon, onT
|
|
|
118
172
|
...row.hostId ? { hostId: row.hostId } : {}
|
|
119
173
|
}),
|
|
120
174
|
active: open
|
|
175
|
+
} : onOpenProject && row.serverProject ? {
|
|
176
|
+
onOpen: () => onOpenProject({
|
|
177
|
+
path: serverHome ?? "",
|
|
178
|
+
hostId: row.serverProject.hostId,
|
|
179
|
+
projectId: row.serverProject.projectId
|
|
180
|
+
}),
|
|
181
|
+
active: open
|
|
121
182
|
} : onOpenChats && row.chats ? {
|
|
122
183
|
onOpen: onOpenChats,
|
|
123
184
|
active: open
|
|
124
185
|
} : {},
|
|
125
|
-
icon: row.favorites ? /* @__PURE__ */ jsx(GroupGlyph, { icon: "i-ph-star" }) : row.chats ? /* @__PURE__ */ jsx(GroupGlyph, { icon: "i-ph-chats" }) :
|
|
186
|
+
icon: row.favorites ? /* @__PURE__ */ jsx(GroupGlyph, { icon: "i-ph-star" }) : row.chats ? /* @__PURE__ */ jsx(GroupGlyph, { icon: "i-ph-chats" }) : row.serverProject ? /* @__PURE__ */ jsx(ProjectIconGlyph, {
|
|
187
|
+
...icon ? { icon } : {},
|
|
188
|
+
server: true
|
|
189
|
+
}) : byFolder && onAssignIcon ? /* @__PURE__ */ jsx(ProjectIconButton, {
|
|
126
190
|
fullPath: row.fullPath,
|
|
127
191
|
label,
|
|
128
192
|
icon,
|
|
129
193
|
isGitRepo: row.isGitRepo,
|
|
194
|
+
server: serverGlyph,
|
|
130
195
|
onAssign: onAssignIcon
|
|
131
196
|
}) : byFolder ? /* @__PURE__ */ jsx(ProjectIconGlyph, {
|
|
132
197
|
...icon ? { icon } : {},
|
|
133
|
-
...row.isGitRepo !== void 0 ? { isGitRepo: row.isGitRepo } : {}
|
|
198
|
+
...row.isGitRepo !== void 0 ? { isGitRepo: row.isGitRepo } : {},
|
|
199
|
+
server: serverGlyph
|
|
134
200
|
}) : /* @__PURE__ */ jsx(GroupGlyph, { icon: groupBy === "date" ? "i-ph-calendar-blank" : "i-ph-lightning" }),
|
|
135
|
-
action:
|
|
136
|
-
host: server,
|
|
137
|
-
icon: true,
|
|
138
|
-
className: "min-w-0 max-w-[60%]",
|
|
139
|
-
...openHostSettings ? { onOpen: () => void openHostSettings(server.id) } : {}
|
|
140
|
-
}) : isProjectFolder && row.fullPath ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
|
|
141
|
-
icon: "i-ph-plus",
|
|
142
|
-
label: labels.newSessionIn(label),
|
|
143
|
-
size: "xs",
|
|
144
|
-
className: "zg-row-dots",
|
|
145
|
-
onClick: (event) => {
|
|
146
|
-
event.stopPropagation();
|
|
147
|
-
onNewSessionIn(row.fullPath);
|
|
148
|
-
}
|
|
149
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
150
|
-
icon: pinned ? "i-ph-push-pin-fill" : "i-ph-push-pin",
|
|
151
|
-
label: pinned ? labels.unpinNamed(label) : labels.pinNamed(label),
|
|
152
|
-
size: "xs",
|
|
153
|
-
"aria-pressed": pinned,
|
|
154
|
-
className: "zg-row-dots",
|
|
155
|
-
onClick: (event) => {
|
|
156
|
-
event.stopPropagation();
|
|
157
|
-
onSetPinned(row.fullPath, !pinned);
|
|
158
|
-
}
|
|
159
|
-
})] }) : void 0
|
|
201
|
+
action: withPeople(people, action)
|
|
160
202
|
}), hasMenu && /* @__PURE__ */ jsx(RowActionsMenu, {
|
|
161
203
|
open: menuAt !== null,
|
|
162
204
|
position: menuAt,
|
|
@@ -4,7 +4,7 @@ import { usePendingRemoval } from "./pending-removals.js";
|
|
|
4
4
|
import { ICON_PICKER_WIDTH, IconPicker, IconPickerProps, ProjectIconButton, ProjectIconButtonProps, ProjectIconGlyph, ProjectIconGlyphProps, useProjectIcons } from "./ProjectIcon.js";
|
|
5
5
|
import { EnvironmentChip, EnvironmentChipProps, ProjectChip, ProjectChipProps, RowProject } from "./RowChips.js";
|
|
6
6
|
import { SessionMenuActions, SessionMenuContext, SessionMenuSurfaceActions, SessionMenuTarget, SidebarProject, archiveProjectPrompt, deleteProjectPrompt, sessionMenuItems, spaceRows, useConfirmDeleteSession, useEnvironmentActions, useEnvironmentCommands, useProjectSessionActions, useSessionMenuItems } from "./session-menu.js";
|
|
7
|
-
import { NewSessionButton, NewSessionButtonProps, SessionSidebar, SessionSidebarProps, SidebarHomeProject, SidebarProjectRecord, SidebarRowSession, SidebarSpaceSlide } from "./SessionSidebar.js";
|
|
7
|
+
import { NewSessionButton, NewSessionButtonProps, SessionSidebar, SessionSidebarProps, SidebarHomeProject, SidebarProjectRecord, SidebarRowSession, SidebarServerProject, SidebarServerProjects, SidebarSpaceSlide } from "./SessionSidebar.js";
|
|
8
8
|
import { ARRIVAL_MS, BadgeCardPlacement, SidebarBadgeFocus, SidebarLive, SidebarLiveOptions, SidebarRowArtifactsProps, SidebarRowBadgesProps, SidebarRowMetaProps, createSidebarLive, useArrival } from "./sidebar-live.js";
|
|
9
9
|
import { SidebarChip, SidebarChipProps, SidebarDecoration, SidebarDecorationProps } from "./SidebarDecoration.js";
|
|
10
10
|
import { SidebarFilterMenu, SidebarFilterMenuProps } from "./SidebarFilterMenu.js";
|
|
@@ -30,4 +30,4 @@ import { SessionDirectoryView, useSessionDirectoryView } from "./useSessionDirec
|
|
|
30
30
|
import { SessionContentSearch, useSessionSearch } from "./useSessionSearch.js";
|
|
31
31
|
import { SidebarKeyboardNavOptions, useSidebarKeyboardNav } from "./useSidebarKeyboardNav.js";
|
|
32
32
|
import { useSidebarLabels } from "./useSidebarLabels.js";
|
|
33
|
-
export { ARRIVAL_MS, type BadgeCardPlacement, EnvironmentChip, type EnvironmentChipProps, ICON_PICKER_WIDTH, IconPicker, type IconPickerProps, MainSessionRow, type MainSessionRowProps, NewSessionButton, type NewSessionButtonProps, ProjectChip, type ProjectChipProps, ProjectIconButton, type ProjectIconButtonProps, ProjectIconGlyph, type ProjectIconGlyphProps, type RowProject, type SessionContentSearch, type SessionDirectoryView, type SessionMenuActions, type SessionMenuContext, type SessionMenuSurfaceActions, type SessionMenuTarget, SessionSidebar, type SessionSidebarProps, type SidebarBadgeFocus, SidebarChip, type SidebarChipProps, type SidebarChromeInset, type SidebarCollapsedStore, SidebarCompactingIndicator, type SidebarCompactingIndicatorProps, SidebarDecoration, type SidebarDecorationProps, SidebarFilterMenu, type SidebarFilterMenuProps, SidebarFooter, type SidebarFooterProps, SidebarFrame, type SidebarFrameOptions, type SidebarFrameProps, type SidebarFrameState, SidebarGroupHeader, type SidebarGroupHeaderProps, type SidebarHeaderRow, type SidebarHomeProject, SidebarHostProvider, type SidebarHostProviderProps, type SidebarKeyboardNavOptions, type SidebarLive, type SidebarLiveOptions, SidebarLiveProvider, type SidebarLiveProviderProps, type SidebarNotify, SidebarPreview, type SidebarPreviewProps, type SidebarProject, type SidebarProjectRecord, type SidebarProjectRef, type SidebarRowArtifactsProps, type SidebarRowBadgesProps, type SidebarRowHandlers, type SidebarRowMetaProps, type SidebarRowSession, SidebarRowView, type SidebarRowViewProps, SidebarSearchRow, type SidebarSearchRowProps, SidebarSessionRow, type SidebarSessionRowProps, type SidebarSettingsNote, SidebarSignInPrompt, type SidebarSignInPromptProps, type SidebarSpaceSlide, SidebarToggleButton, type SidebarToggleButtonProps, SpaceGlyph, type SpaceGlyphProps, SpaceSwitcher, type SpaceSwitcherProps, type SpacesHomeChoice, SpacesSection, type SpacesSectionProps, archiveProjectPrompt, createSidebarCollapsed, createSidebarLive, deleteProjectPrompt, sessionMenuItems, spaceRows, useArrival, useCompactionProgress, useConfirmDeleteSession, useEnvironmentActions, useEnvironmentCommands, useMainSession, usePendingRemoval, usePinnedProjects, useProjectIcons, useProjectSessionActions, useSaveViewAsSpace, useSessionActivity, useSessionBadges, useSessionDirectoryView, useSessionMenuItems, useSessionSearch, useSidebarFrame, useSidebarHost, useSidebarKeyboardNav, useSidebarLabels, useSidebarLive, useSidebarNotice };
|
|
33
|
+
export { ARRIVAL_MS, type BadgeCardPlacement, EnvironmentChip, type EnvironmentChipProps, ICON_PICKER_WIDTH, IconPicker, type IconPickerProps, MainSessionRow, type MainSessionRowProps, NewSessionButton, type NewSessionButtonProps, ProjectChip, type ProjectChipProps, ProjectIconButton, type ProjectIconButtonProps, ProjectIconGlyph, type ProjectIconGlyphProps, type RowProject, type SessionContentSearch, type SessionDirectoryView, type SessionMenuActions, type SessionMenuContext, type SessionMenuSurfaceActions, type SessionMenuTarget, SessionSidebar, type SessionSidebarProps, type SidebarBadgeFocus, SidebarChip, type SidebarChipProps, type SidebarChromeInset, type SidebarCollapsedStore, SidebarCompactingIndicator, type SidebarCompactingIndicatorProps, SidebarDecoration, type SidebarDecorationProps, SidebarFilterMenu, type SidebarFilterMenuProps, SidebarFooter, type SidebarFooterProps, SidebarFrame, type SidebarFrameOptions, type SidebarFrameProps, type SidebarFrameState, SidebarGroupHeader, type SidebarGroupHeaderProps, type SidebarHeaderRow, type SidebarHomeProject, SidebarHostProvider, type SidebarHostProviderProps, type SidebarKeyboardNavOptions, type SidebarLive, type SidebarLiveOptions, SidebarLiveProvider, type SidebarLiveProviderProps, type SidebarNotify, SidebarPreview, type SidebarPreviewProps, type SidebarProject, type SidebarProjectRecord, type SidebarProjectRef, type SidebarRowArtifactsProps, type SidebarRowBadgesProps, type SidebarRowHandlers, type SidebarRowMetaProps, type SidebarRowSession, SidebarRowView, type SidebarRowViewProps, SidebarSearchRow, type SidebarSearchRowProps, type SidebarServerProject, type SidebarServerProjects, SidebarSessionRow, type SidebarSessionRowProps, type SidebarSettingsNote, SidebarSignInPrompt, type SidebarSignInPromptProps, type SidebarSpaceSlide, SidebarToggleButton, type SidebarToggleButtonProps, SpaceGlyph, type SpaceGlyphProps, SpaceSwitcher, type SpaceSwitcherProps, type SpacesHomeChoice, SpacesSection, type SpacesSectionProps, archiveProjectPrompt, createSidebarCollapsed, createSidebarLive, deleteProjectPrompt, sessionMenuItems, spaceRows, useArrival, useCompactionProgress, useConfirmDeleteSession, useEnvironmentActions, useEnvironmentCommands, useMainSession, usePendingRemoval, usePinnedProjects, useProjectIcons, useProjectSessionActions, useSaveViewAsSpace, useSessionActivity, useSessionBadges, useSessionDirectoryView, useSessionMenuItems, useSessionSearch, useSidebarFrame, useSidebarHost, useSidebarKeyboardNav, useSidebarLabels, useSidebarLive, useSidebarNotice };
|
|
@@ -62,6 +62,12 @@ export interface TranscriptActions {
|
|
|
62
62
|
retryEnvironment?: () => void | Promise<void>;
|
|
63
63
|
/** Shows another session, named by its id (a worker a tool call addresses). */
|
|
64
64
|
openSession?: (sessionId: string) => void;
|
|
65
|
+
/**
|
|
66
|
+
* The whole of a message another session's report quoted cut (`summaryTruncated`): the newest of that
|
|
67
|
+
* session's messages that starts with `startsWith` (the report's summary), `null` when none does
|
|
68
|
+
* (`ChatHost.sessionMessage`). Absent: an opened report shows its cut summary.
|
|
69
|
+
*/
|
|
70
|
+
sessionMessage?: (sessionId: string, startsWith: string) => Promise<string | null>;
|
|
65
71
|
/** Sends a prompt as the user's next message. */
|
|
66
72
|
resume?: (prompt: string) => void;
|
|
67
73
|
/**
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* row under its prompt, live as a rising stack of its latest steps, settled
|
|
4
4
|
* as a summary that opens onto every step (`ExchangeFoldRow`). Each step
|
|
5
5
|
* opens onto its details in place: a tool call's payload (`ToolDetails`),
|
|
6
|
-
* a thought, a worker's own folded progress (`fold-worker.tsx`)
|
|
6
|
+
* a thought, a worker's own folded progress (`fold-worker.tsx`), a
|
|
7
|
+
* background task's command and log.
|
|
7
8
|
*/
|
|
8
9
|
import { Cluster, Row } from "../headless/transcript/rows.js";
|
|
9
10
|
import "../headless/transcript/index.js";
|
|
@@ -7,6 +7,7 @@ import { foldAttachments, sameAttachments } from "../headless/transcript/fold-at
|
|
|
7
7
|
import { useChatLabels } from "../useChatLabels.js";
|
|
8
8
|
import { useModelName } from "./actions.js";
|
|
9
9
|
import { EnvironmentSetupDetails } from "./environment-setup.js";
|
|
10
|
+
import { InlineCode } from "./FileChip.js";
|
|
10
11
|
import { FoldAttachments } from "./fold-attachments.js";
|
|
11
12
|
import { FoldStatusTime, useLiveFoldStatus } from "./fold-status.js";
|
|
12
13
|
import { WorkerDetails } from "./fold-worker.js";
|
|
@@ -21,6 +22,7 @@ import { ToolTiming } from "./tool-parts.js";
|
|
|
21
22
|
import { ModelVerdict } from "./tool-row.js";
|
|
22
23
|
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
23
24
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { formatTaskStatus, taskOutcome } from "zidane/chat/pure";
|
|
24
26
|
// src/chat/transcript/fold.tsx
|
|
25
27
|
/**
|
|
26
28
|
* Open/closed memory per fold id, outliving the component: the fold's id
|
|
@@ -370,6 +372,7 @@ function hasActionDetails(item) {
|
|
|
370
372
|
if (item.kind === "worker") return (item.workerRows ?? []).length > 0;
|
|
371
373
|
if (item.kind === "setup") return item.setup !== void 0;
|
|
372
374
|
if (item.kind === "compact") return (item.compact?.text ?? "").trim() !== "";
|
|
375
|
+
if (item.kind === "task") return item.task !== void 0;
|
|
373
376
|
return item.tool !== void 0;
|
|
374
377
|
}
|
|
375
378
|
/**
|
|
@@ -399,7 +402,7 @@ function ActionLine({ item, open = false, onToggle }) {
|
|
|
399
402
|
}), ` ${labels.turnsCompacted}`]
|
|
400
403
|
}) : /* @__PURE__ */ jsx("span", {
|
|
401
404
|
className: `truncate ${running ? "zg-shimmer" : ""}`,
|
|
402
|
-
children: item.label
|
|
405
|
+
children: item.task ? labels.taskEnded[taskOutcome(item.task.task)] : item.label
|
|
403
406
|
}),
|
|
404
407
|
item.compact && /* @__PURE__ */ jsx(CompactMeta, {
|
|
405
408
|
meta: item.compact.compact,
|
|
@@ -525,6 +528,7 @@ function ActionDetails({ item, renderRows }) {
|
|
|
525
528
|
className: "text-zg-ui leading-relaxed text-[var(--zg-text-muted)]",
|
|
526
529
|
children: /* @__PURE__ */ jsx(Markdown, { children: item.compact.text })
|
|
527
530
|
});
|
|
531
|
+
if (item.kind === "task" && item.task) return /* @__PURE__ */ jsx(TaskDetails, { task: item.task.task });
|
|
528
532
|
if (item.kind === "worker" || item.tool?.name === "spawn") return /* @__PURE__ */ jsx(WorkerDetails, {
|
|
529
533
|
item,
|
|
530
534
|
renderRows
|
|
@@ -537,4 +541,25 @@ function ActionDetails({ item, renderRows }) {
|
|
|
537
541
|
children: body
|
|
538
542
|
});
|
|
539
543
|
}
|
|
544
|
+
/** A background task that ended, opened: its whole command, then how it exited and its log file. */
|
|
545
|
+
function TaskDetails({ task }) {
|
|
546
|
+
const labels = useChatLabels();
|
|
547
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
548
|
+
className: "flex flex-col gap-1",
|
|
549
|
+
"data-testid": "task-details",
|
|
550
|
+
children: [/* @__PURE__ */ jsx("code", {
|
|
551
|
+
className: "font-mono text-zg-ui text-[var(--zg-text-muted)] whitespace-pre-wrap break-all",
|
|
552
|
+
children: task.command
|
|
553
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
554
|
+
className: "zg-meta flex items-center gap-1",
|
|
555
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
556
|
+
className: "zg-meta-chip",
|
|
557
|
+
children: formatTaskStatus(task)
|
|
558
|
+
}), task.outputPath && /* @__PURE__ */ jsx("span", {
|
|
559
|
+
title: labels.taskLog(task.outputPath),
|
|
560
|
+
children: /* @__PURE__ */ jsx(InlineCode, { text: task.outputPath })
|
|
561
|
+
})]
|
|
562
|
+
})]
|
|
563
|
+
});
|
|
564
|
+
}
|
|
540
565
|
export { ExchangeFoldRow, FoldHeader, LiveScriptsContext };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TranscriptRenderersProvider } from "./renderer-slots.js";
|
|
1
2
|
import { TranscriptActionsProvider, attachmentSrcOf, toolMediaSrcOf, useModelName, useTranscriptActions } from "./actions.js";
|
|
2
3
|
import { AnsiSpans, AnsiText } from "./AnsiText.js";
|
|
3
4
|
import { AuthFailureCard } from "./AuthFailureCard.js";
|
|
@@ -14,11 +15,11 @@ import { AUTO_FILL_PAGES, FILL_MIN_PROMPTS, LoadEarlierRow, useFillViewportScrol
|
|
|
14
15
|
import { EditDiffBlock } from "./EditDiffBlock.js";
|
|
15
16
|
import { EnvironmentSetupDetails, EnvironmentSetupRow } from "./environment-setup.js";
|
|
16
17
|
import { InlineCode, RefChip } from "./FileChip.js";
|
|
17
|
-
import { useShellBlockScope } from "./shell-block-scope.js";
|
|
18
18
|
import { ExchangeFoldRow, FoldHeader, LiveScriptsContext } from "./fold.js";
|
|
19
|
+
import { useShellBlockScope } from "./shell-block-scope.js";
|
|
19
20
|
import { WorkerDetails } from "./fold-worker.js";
|
|
20
|
-
import { parseToolMedia } from "../headless/transcript/tool-media.js";
|
|
21
21
|
import { Caret, Dot, FailedMark, GUTTER_STEP_PX, RowFrame, RowIconsContext, SESSION_EVENT_DOT, lineStateOf, useRowIcons } from "./frame.js";
|
|
22
|
+
import { parseToolMedia } from "../headless/transcript/tool-media.js";
|
|
22
23
|
import { ImageGenerationBlock, drawsImageGeneration, imageRequestsOf, savedPaths } from "./ImageGenerationBlock.js";
|
|
23
24
|
import { InlineChipText } from "./InlineChipText.js";
|
|
24
25
|
import { InteractionToolBody, hasInteractionBody } from "./InteractionToolBody.js";
|
|
@@ -28,7 +29,6 @@ import { Markdown, MarkdownDiagrams } from "./markdown.js";
|
|
|
28
29
|
import { CommandScopeContext, INLINE_CODE_CLASS, MarkdownContext, OpenSessionContext } from "./markdown-context.js";
|
|
29
30
|
import { MermaidDiagram } from "./MermaidDiagram.js";
|
|
30
31
|
import { MessageGroupRow } from "./messages.js";
|
|
31
|
-
import { TranscriptRenderersProvider } from "./renderer-slots.js";
|
|
32
32
|
import { COMMAND_DETAIL_LINE, CommandDetailRow, CommandNoteRow, ErrorRow, FailureRow, InfoRow, NoticeRow, RepairedRow, SessionEventRow, SetupChangedRow, SpawnEndRow, SpawnStartRow } from "./notices.js";
|
|
33
33
|
import { AttachmentIcon, UserPromptAttachments, UserPromptRow } from "./prompt.js";
|
|
34
34
|
import { PromptLines, copyPromptLines } from "./prompt-lines.js";
|
|
@@ -157,8 +157,11 @@ export interface SessionEventRowProps {
|
|
|
157
157
|
* is the outcome, so there is no verb on screen), the title, the report's
|
|
158
158
|
* excerpt, then the run's duration and turns in their fixed slots, the open
|
|
159
159
|
* button, the caret. Opened, the report shows in full, rendered as markdown,
|
|
160
|
-
* with the rest of the run's receipt under it.
|
|
161
|
-
*
|
|
160
|
+
* with the rest of the run's receipt under it. A report quotes the message
|
|
161
|
+
* cut (`summaryTruncated`, for the Main's context): opened, the row reads the
|
|
162
|
+
* whole message once (`TranscriptActions.sessionMessage`), the cut until it
|
|
163
|
+
* lands. Under its conversation's header the bar reads its time instead of
|
|
164
|
+
* the title. Where the session ran
|
|
162
165
|
* is the group's to say (its project and worktree sections). Falls back to a
|
|
163
166
|
* plain text row when `sessionEvent` is absent (malformed signal).
|
|
164
167
|
*/
|