zidane-ui 9.1.13 → 9.1.14
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 -2
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/live.d.ts +29 -3
- package/dist/adapters/live.js +9 -1
- package/dist/adapters/server-composer-host.js +17 -2
- package/dist/adapters/server-extensions-host.d.ts +0 -1
- package/dist/adapters/server-extensions-host.js +5 -16
- package/dist/adapters/server-git-host.js +7 -16
- package/dist/adapters/server-host.js +181 -43
- package/dist/adapters/server-machines-host.d.ts +2 -0
- package/dist/adapters/server-machines-host.js +24 -25
- package/dist/adapters/server-onboarding-host.d.ts +1 -1
- package/dist/adapters/server-onboarding-host.js +3 -4
- package/dist/adapters/server-session-host.js +22 -3
- package/dist/adapters/server-settings-accounts.js +2 -2
- package/dist/adapters/server-settings-host.js +3 -3
- package/dist/adapters/server-settings-performance.js +7 -9
- package/dist/adapters/server-settings-sections.js +13 -14
- package/dist/adapters/server-sidebar-host.js +2 -2
- package/dist/adapters/sse-host.js +68 -3
- package/dist/adapters/sse-protocol.d.ts +12 -2
- package/dist/adapters/sse-protocol.js +4 -2
- package/dist/app/AppHostProvider.js +4 -3
- package/dist/app/ModalProvider.d.ts +13 -3
- package/dist/app/ModalProvider.js +103 -24
- package/dist/app/NoticeStack.d.ts +33 -0
- package/dist/app/NoticeStack.js +90 -0
- package/dist/app/index.d.ts +3 -2
- package/dist/app/index.js +3 -2
- package/dist/appearance/AppearanceProvider.js +2 -2
- package/dist/appearance/headless/index.js +1 -1
- package/dist/approvals/headless/index.js +2 -2
- package/dist/chat/SessionFilterMenu.d.ts +1 -1
- package/dist/chat/SessionFilterMenu.js +2 -1
- package/dist/chat/Transcript.js +1 -1
- package/dist/chat/composer/Composer.js +9 -6
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ConversationBadges.js +1 -1
- package/dist/chat/composer/ModelChainList.js +17 -8
- package/dist/chat/composer/ModelChainTooltip.js +5 -2
- package/dist/chat/composer/use-composer-stores.js +1 -1
- package/dist/chat/composer/use-draft-target.d.ts +20 -1
- package/dist/chat/composer/use-draft-target.js +122 -6
- package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
- package/dist/chat/composer/use-new-session-defaults.js +17 -4
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/composer/use-send-prompt.js +1 -1
- package/dist/chat/headless/chip-labels.d.ts +1 -0
- package/dist/chat/headless/chip-labels.js +1 -0
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/draft-target.d.ts +21 -1
- package/dist/chat/headless/fixture-host.js +17 -2
- package/dist/chat/headless/host.d.ts +3 -3
- package/dist/chat/headless/index.d.ts +9 -9
- package/dist/chat/headless/index.js +15 -15
- package/dist/chat/headless/labels.d.ts +13 -4
- package/dist/chat/headless/labels.js +8 -5
- package/dist/chat/headless/session-list.d.ts +20 -6
- package/dist/chat/headless/session-list.js +1 -0
- package/dist/chat/headless/sidebar/directory.d.ts +56 -14
- package/dist/chat/headless/sidebar/directory.js +149 -70
- package/dist/chat/headless/sidebar/index.d.ts +3 -3
- package/dist/chat/headless/sidebar/index.js +3 -3
- package/dist/chat/headless/sidebar/labels.d.ts +15 -6
- package/dist/chat/headless/sidebar/types.d.ts +3 -1
- package/dist/chat/headless/sidebar/view.d.ts +13 -5
- package/dist/chat/headless/sidebar/view.js +31 -11
- package/dist/chat/headless/streams/actions.d.ts +5 -3
- package/dist/chat/headless/streams/actions.js +3 -2
- package/dist/chat/headless/streams/index.d.ts +3 -3
- package/dist/chat/headless/streams/merge.d.ts +6 -10
- package/dist/chat/headless/streams/merge.js +7 -21
- package/dist/chat/headless/streams/session-streams.d.ts +29 -4
- package/dist/chat/headless/streams/session-streams.js +86 -0
- package/dist/chat/headless/streams/store.d.ts +162 -16
- package/dist/chat/headless/streams/store.js +334 -38
- package/dist/chat/headless/streams/types.d.ts +10 -7
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/interactions/PlanCard.js +10 -3
- package/dist/chat/interactions/QuestionForm.js +7 -3
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +9 -7
- package/dist/chat/sidebar/SessionSidebar.js +5 -5
- package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
- package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
- package/dist/chat/sidebar/SidebarFrame.js +27 -9
- package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
- package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
- package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
- package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.js +4 -4
- package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
- package/dist/chat/testing/contract.js +2 -2
- package/dist/chat/transcript/AuthFailureCard.js +11 -8
- package/dist/chat/transcript/BadgeMenu.js +13 -2
- package/dist/chat/transcript/MermaidDiagram.js +7 -3
- package/dist/chat/transcript/fold.d.ts +4 -0
- package/dist/chat/transcript/fold.js +53 -22
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +8 -4
- package/dist/chat/transcript/useStickToBottom.js +12 -0
- package/dist/components/BrowserSignIn.js +23 -21
- package/dist/components/Form.d.ts +6 -4
- package/dist/components/Form.js +16 -8
- package/dist/components/LoadError.d.ts +4 -2
- package/dist/components/LoadError.js +13 -9
- package/dist/components/Notice.d.ts +29 -0
- package/dist/components/Notice.js +63 -0
- package/dist/components/PanelEmpty.d.ts +1 -1
- package/dist/components/PanelEmpty.js +4 -2
- package/dist/components/Restricted.d.ts +1 -1
- package/dist/components/palette/PaletteList.js +8 -1
- package/dist/components/palette/PalettePanel.js +14 -6
- package/dist/core.css +24 -5
- package/dist/dist/{index-Bq87OcGy.d.ts → index-C6rzc-tt.d.ts} +28 -3
- package/dist/dist/index.d.ts +2 -2
- package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cz9dRF8Q.d.ts} +1 -1
- package/dist/extensions/ExtensionSettingsPage.js +2 -5
- package/dist/extensions/ExtensionSettingsSection.js +5 -4
- package/dist/extensions/ExtensionSettingsSidebar.js +3 -7
- package/dist/extensions/SettingsWireForm.d.ts +1 -7
- package/dist/extensions/SettingsWireForm.js +7 -5
- package/dist/extensions/headless/fixture-host.d.ts +1 -5
- package/dist/extensions/headless/fixture-host.js +2 -5
- package/dist/extensions/headless/host.d.ts +1 -11
- package/dist/extensions/headless/index.d.ts +3 -3
- package/dist/extensions/headless/index.js +6 -6
- package/dist/extensions/headless/select.d.ts +1 -11
- package/dist/extensions/headless/select.js +1 -18
- package/dist/extensions/hooks.js +1 -1
- package/dist/files/EditorColumn.js +13 -2
- package/dist/files/MediaDiff.js +1 -1
- package/dist/files/TreeColumn.js +13 -20
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useOpenFiles.js +3 -1
- package/dist/git/BranchMenu.js +6 -4
- package/dist/git/ImportRepoDialog.js +18 -9
- package/dist/git/MoveSessionDialog.js +16 -8
- package/dist/git/RemoteFolderPicker.js +35 -17
- package/dist/git/SyncChip.js +17 -17
- package/dist/git/WherePicker.d.ts +16 -1
- package/dist/git/WherePicker.js +81 -37
- package/dist/git/headless/environment.d.ts +33 -3
- package/dist/git/headless/environment.js +33 -5
- package/dist/git/headless/index.d.ts +2 -2
- package/dist/git/headless/index.js +2 -2
- package/dist/git/headless/labels.d.ts +15 -2
- package/dist/git/headless/labels.js +17 -4
- package/dist/git/useEnvironmentChoices.d.ts +3 -1
- package/dist/git/useEnvironmentChoices.js +7 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/keybindings/KeyCommands.js +1 -1
- package/dist/keybindings/KeybindingsProvider.js +1 -1
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/overrides.js +1 -1
- package/dist/labels.d.ts +5 -0
- package/dist/labels.js +5 -0
- package/dist/machines/AddMachineDialog.d.ts +34 -0
- package/dist/machines/AddMachineDialog.js +464 -0
- package/dist/machines/Banners.d.ts +33 -4
- package/dist/machines/Banners.js +64 -3
- package/dist/machines/DaemonMenu.js +27 -4
- package/dist/machines/HostCapabilities.d.ts +1 -3
- package/dist/machines/HostCapabilities.js +24 -45
- package/dist/machines/HostSyncPanel.js +124 -130
- package/dist/machines/HostsSection.d.ts +4 -1
- package/dist/machines/HostsSection.js +30 -7
- package/dist/machines/MachinesExplainer.d.ts +17 -0
- package/dist/machines/MachinesExplainer.js +71 -0
- package/dist/machines/MachinesProvider.d.ts +14 -2
- package/dist/machines/MachinesProvider.js +35 -1
- package/dist/machines/ServerAddedCard.d.ts +31 -0
- package/dist/machines/ServerAddedCard.js +72 -0
- package/dist/machines/ServerCard.js +91 -215
- package/dist/machines/ServerMachinesPanel.d.ts +2 -2
- package/dist/machines/ServerMachinesPanel.js +184 -323
- package/dist/machines/ServerUpdatePanel.js +51 -40
- package/dist/machines/ShareThisComputerForm.d.ts +19 -0
- package/dist/machines/ShareThisComputerForm.js +133 -0
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/TokensPanel.d.ts +5 -3
- package/dist/machines/TokensPanel.js +98 -78
- package/dist/machines/headless/fixture-host.d.ts +19 -3
- package/dist/machines/headless/fixture-host.js +43 -6
- package/dist/machines/headless/fixtures.js +4 -6
- package/dist/machines/headless/host.d.ts +40 -19
- package/dist/machines/headless/index.d.ts +3 -3
- package/dist/machines/headless/index.js +3 -3
- package/dist/machines/headless/labels.d.ts +63 -20
- package/dist/machines/headless/labels.js +88 -25
- package/dist/machines/headless/messages.js +8 -0
- package/dist/machines/headless/stores.d.ts +9 -2
- package/dist/machines/headless/stores.js +28 -1
- package/dist/machines/index.d.ts +7 -3
- package/dist/machines/index.js +8 -4
- package/dist/machines/testing/contract.d.ts +15 -3
- package/dist/machines/testing/contract.js +68 -14
- package/dist/motion/grow.d.ts +8 -1
- package/dist/motion/grow.js +10 -4
- package/dist/onboarding/headless/labels.d.ts +13 -0
- package/dist/onboarding/headless/labels.js +8 -0
- package/dist/onboarding/sources/SourceBrowser.js +11 -7
- package/dist/onboarding/steps/ImportStep.js +4 -1
- package/dist/onboarding/steps/ReadyStep.js +9 -2
- package/dist/onboarding/steps/connect/KeyForm.js +6 -2
- package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
- package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
- package/dist/onboarding/steps/tasks.js +17 -14
- package/dist/palette/app-sources.js +1 -1
- package/dist/server/sse-handler.js +141 -19
- package/dist/session/ArtifactsPanel.js +40 -18
- package/dist/session/PlanTracker.js +13 -8
- package/dist/session/ProjectHome.js +13 -11
- package/dist/session/RemindersPanel.js +35 -17
- package/dist/session/RunningWorkDialog.js +6 -2
- package/dist/session/SecretsPanel.js +29 -10
- package/dist/session/SessionDetailsDialog.d.ts +1 -1
- package/dist/session/SessionDetailsDialog.js +18 -10
- package/dist/session/SideChat.js +10 -7
- package/dist/session/TurnDetailsDialog.js +19 -5
- package/dist/session/UsagePanel.js +10 -4
- package/dist/session/headless/host.d.ts +2 -0
- package/dist/session/headless/index.js +2 -2
- package/dist/session/headless/labels.d.ts +19 -1
- package/dist/session/headless/labels.js +15 -1
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/reminder-labels.d.ts +4 -0
- package/dist/session/headless/reminder-labels.js +4 -0
- package/dist/settings/SettingsRestricted.d.ts +1 -1
- package/dist/settings/SettingsRestricted.js +4 -4
- package/dist/settings/SettingsShell.d.ts +7 -0
- package/dist/settings/SettingsShell.js +6 -1
- package/dist/settings/headless/fixture-performance.d.ts +1 -1
- package/dist/settings/headless/host.d.ts +2 -2
- package/dist/settings/headless/index.js +1 -1
- package/dist/settings/headless/labels.d.ts +3 -3
- package/dist/settings/headless/labels.js +3 -3
- package/dist/settings/headless/performance.d.ts +3 -4
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/sections/appearance/AppearanceSection.js +2 -2
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
- package/dist/settings/sections/editor/EditorSection.js +8 -5
- package/dist/settings/sections/editor/labels.d.ts +1 -0
- package/dist/settings/sections/editor/labels.js +1 -0
- package/dist/settings/sections/environments/EnvironmentsSection.js +21 -14
- package/dist/settings/sections/environments/labels.d.ts +1 -0
- package/dist/settings/sections/environments/labels.js +2 -1
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
- package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
- package/dist/settings/sections/extensions/options-labels.js +2 -1
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
- package/dist/settings/sections/index.d.ts +2 -1
- package/dist/settings/sections/index.js +2 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
- package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
- package/dist/settings/sections/logs/LogsSection.js +2 -2
- package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
- package/dist/settings/sections/mcp/McpSection.js +13 -7
- package/dist/settings/sections/mcp/McpServerRow.js +21 -14
- package/dist/settings/sections/mcp/labels.d.ts +8 -2
- package/dist/settings/sections/mcp/labels.js +8 -2
- package/dist/settings/sections/models/ModelRows.js +1 -1
- package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
- package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
- package/dist/settings/sections/models/labels.d.ts +7 -0
- package/dist/settings/sections/models/labels.js +7 -0
- package/dist/settings/sections/models/model-test.js +7 -4
- package/dist/settings/sections/performance/PerformanceSection.js +16 -6
- package/dist/settings/sections/performance/labels.d.ts +1 -1
- package/dist/settings/sections/performance/labels.js +1 -1
- package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ProvidersSection.js +15 -8
- package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ServerProvidersSection.js +12 -6
- package/dist/settings/sections/providers/labels.d.ts +2 -2
- package/dist/settings/sections/providers/labels.js +2 -2
- package/dist/settings/sections/shared/catalog.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +1 -1
- package/dist/settings/testing/performance.contract.js +8 -12
- package/dist/styles.css +32 -3
- package/dist/terminal/HostTerminalSurface.js +17 -7
- package/dist/terminal/TerminalPanel.js +30 -17
- package/dist/terminal/TerminalSurface.js +11 -4
- package/dist/terminal/headless/labels.d.ts +5 -0
- package/dist/terminal/headless/labels.js +5 -0
- package/dist/terminal/headless/store.d.ts +1 -1
- package/dist/terminal/headless/store.js +6 -3
- package/dist/workspace/LayoutBudget.d.ts +5 -1
- package/dist/workspace/LayoutBudget.js +14 -1
- package/dist/workspace/PanelContentView.d.ts +1 -1
- package/dist/workspace/PanelContentView.js +17 -6
- package/dist/workspace/WorkspaceProvider.js +4 -3
- package/dist/workspace/extension-tabs.js +1 -1
- package/dist/workspace/headless/index.js +1 -1
- package/dist/workspace/headless/labels.d.ts +1 -0
- package/dist/workspace/headless/labels.js +1 -0
- package/package.json +3 -3
- package/src/styles/motion.css +8 -0
- package/src/styles/primitives.css +7 -0
|
@@ -5,7 +5,7 @@ import { buttonClass } from "../components/button.js";
|
|
|
5
5
|
import { ErrorBoundary, ErrorDetails } from "../components/ErrorBoundary.js";
|
|
6
6
|
import { Keycap } from "../components/Keycap.js";
|
|
7
7
|
import { useAppearanceState } from "../appearance/AppearanceProvider.js";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { AnimatePresence, motion, useIsPresent } from "motion/react";
|
|
11
11
|
//#region src/app/ModalProvider.tsx
|
|
@@ -411,21 +411,119 @@ function ModalShell({ title, description, onClose, onBack, footer, children, siz
|
|
|
411
411
|
]
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
+
/** Whether the window is narrower than {@link SCREEN_NARROW_MAX}, followed while `watch` (no listener otherwise). */
|
|
415
|
+
function useNarrowWindow(watch) {
|
|
416
|
+
const query = `(max-width: 639px)`;
|
|
417
|
+
const [narrow, setNarrow] = useState(() => watch && typeof window !== "undefined" && window.matchMedia?.(query).matches === true);
|
|
418
|
+
useEffect(() => {
|
|
419
|
+
if (!watch || typeof window === "undefined" || !window.matchMedia) return void 0;
|
|
420
|
+
const list = window.matchMedia(query);
|
|
421
|
+
const update = () => setNarrow(list.matches);
|
|
422
|
+
update();
|
|
423
|
+
list.addEventListener("change", update);
|
|
424
|
+
return () => list.removeEventListener("change", update);
|
|
425
|
+
}, [watch, query]);
|
|
426
|
+
return watch && narrow;
|
|
427
|
+
}
|
|
428
|
+
/** Below this window width (px), a {@link ScreenShell} given `narrowPane` shows one pane at a time. */
|
|
429
|
+
const SCREEN_NARROW_MAX = 640;
|
|
414
430
|
/**
|
|
415
431
|
* Two-column full-window shell mirroring the chat layout: a sidebar-width
|
|
416
432
|
* left column on the tray tone (traffic-light spacer, back button,
|
|
417
433
|
* then whatever navigation the surface provides) and a main column with a
|
|
418
434
|
* heading row over the content. Escape and the back button both call
|
|
419
|
-
* `onClose`.
|
|
435
|
+
* `onClose`. On a narrow window with `narrowPane`, one pane at a time at full
|
|
436
|
+
* width: the left column, or the main one under a back button.
|
|
420
437
|
*
|
|
421
438
|
* @param props - The heading, the left column, the body and `onClose`.
|
|
422
439
|
*/
|
|
423
|
-
function ScreenShell({ title, description, lead, screenLabel, onClose, aside, asideFooter, headerActions, children, className, style }) {
|
|
440
|
+
function ScreenShell({ title, description, lead, screenLabel, onClose, aside, asideFooter, headerActions, children, narrowPane, onNarrowBack, className, style }) {
|
|
424
441
|
const modal = useModal();
|
|
425
442
|
const labels = useLabels();
|
|
426
443
|
const chrome = useContext(ChromeContext);
|
|
427
444
|
const { sidebarWidth } = useAppearanceState();
|
|
445
|
+
const narrow = useNarrowWindow(narrowPane !== void 0);
|
|
428
446
|
useDismissHandler(modal.setDismissHandler, onClose);
|
|
447
|
+
const backToApp = /* @__PURE__ */ jsxs("button", {
|
|
448
|
+
type: "button",
|
|
449
|
+
onClick: onClose,
|
|
450
|
+
"aria-label": labels.screenBack(screenLabel),
|
|
451
|
+
className: "zg-no-drag zg-menu-row zg-press-subtle !w-auto h-7 !min-h-0 !gap-1 !pl-1 !pr-1.5 font-medium",
|
|
452
|
+
children: [
|
|
453
|
+
/* @__PURE__ */ jsx("span", {
|
|
454
|
+
className: "i-ph-caret-left text-sm text-[var(--zg-text-muted)]",
|
|
455
|
+
"aria-hidden": true
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ jsx("span", {
|
|
458
|
+
className: "truncate",
|
|
459
|
+
children: screenLabel
|
|
460
|
+
}),
|
|
461
|
+
/* @__PURE__ */ jsx(Keycap, {
|
|
462
|
+
className: "ml-1.5",
|
|
463
|
+
children: labels.screenBackKey
|
|
464
|
+
})
|
|
465
|
+
]
|
|
466
|
+
});
|
|
467
|
+
if (narrow) return /* @__PURE__ */ jsxs("div", {
|
|
468
|
+
className: `flex flex-col w-full h-full min-h-0 bg-[var(--zg-tray)]${className ? ` ${className}` : ""}`,
|
|
469
|
+
style,
|
|
470
|
+
children: [
|
|
471
|
+
/* @__PURE__ */ jsxs("div", {
|
|
472
|
+
className: "zg-drag shrink-0 flex items-center px-2",
|
|
473
|
+
style: { height: chromePx(chrome.top) },
|
|
474
|
+
children: [chrome.leading > 0 && /* @__PURE__ */ jsx("span", {
|
|
475
|
+
"aria-hidden": true,
|
|
476
|
+
className: "shrink-0",
|
|
477
|
+
style: { width: chromePx(chrome.leading) }
|
|
478
|
+
}), backToApp]
|
|
479
|
+
}),
|
|
480
|
+
/* @__PURE__ */ jsx("div", {
|
|
481
|
+
className: "shrink-0 px-3 pb-2",
|
|
482
|
+
children: aside.search
|
|
483
|
+
}),
|
|
484
|
+
narrowPane === "aside" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
485
|
+
className: "flex-1 min-h-0 flex flex-col px-2 pt-1",
|
|
486
|
+
children: aside.nav
|
|
487
|
+
}), asideFooter && /* @__PURE__ */ jsx("div", {
|
|
488
|
+
className: "shrink-0 px-2 pb-2",
|
|
489
|
+
children: asideFooter
|
|
490
|
+
})] }) : /* @__PURE__ */ jsxs("section", {
|
|
491
|
+
className: "flex-1 min-w-0 min-h-0 flex flex-col bg-[var(--zg-bg)]",
|
|
492
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
493
|
+
className: "shrink-0 flex items-center gap-2 px-3 py-2.5 border-b border-[var(--zg-hairline)]",
|
|
494
|
+
children: [
|
|
495
|
+
onNarrowBack && /* @__PURE__ */ jsx(IconButton, {
|
|
496
|
+
icon: "i-ph-caret-left",
|
|
497
|
+
label: labels.screenNavBack(screenLabel),
|
|
498
|
+
onClick: onNarrowBack
|
|
499
|
+
}),
|
|
500
|
+
lead && /* @__PURE__ */ jsx("div", {
|
|
501
|
+
className: "shrink-0 flex",
|
|
502
|
+
children: lead
|
|
503
|
+
}),
|
|
504
|
+
/* @__PURE__ */ jsxs("div", {
|
|
505
|
+
className: "flex-1 min-w-0",
|
|
506
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
507
|
+
id: MODAL_TITLE_ID,
|
|
508
|
+
className: "text-sm font-semibold leading-tight text-[var(--zg-text)] m-0 truncate",
|
|
509
|
+
children: title
|
|
510
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
511
|
+
className: "text-xs leading-tight text-[var(--zg-text-muted)] mt-0.5 m-0 truncate",
|
|
512
|
+
children: description
|
|
513
|
+
})]
|
|
514
|
+
}),
|
|
515
|
+
headerActions && /* @__PURE__ */ jsx("div", {
|
|
516
|
+
className: "flex items-center gap-2 shrink-0",
|
|
517
|
+
children: headerActions
|
|
518
|
+
})
|
|
519
|
+
]
|
|
520
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
521
|
+
className: "flex-1 min-h-0 flex flex-col overflow-hidden",
|
|
522
|
+
children
|
|
523
|
+
})]
|
|
524
|
+
})
|
|
525
|
+
]
|
|
526
|
+
});
|
|
429
527
|
return /* @__PURE__ */ jsxs("div", {
|
|
430
528
|
className: `flex w-full h-full min-h-0${className ? ` ${className}` : ""}`,
|
|
431
529
|
style,
|
|
@@ -440,26 +538,7 @@ function ScreenShell({ title, description, lead, screenLabel, onClose, aside, as
|
|
|
440
538
|
"aria-hidden": true,
|
|
441
539
|
className: "shrink-0",
|
|
442
540
|
style: { width: chromePx(chrome.leading) }
|
|
443
|
-
}),
|
|
444
|
-
type: "button",
|
|
445
|
-
onClick: onClose,
|
|
446
|
-
"aria-label": labels.screenBack(screenLabel),
|
|
447
|
-
className: "zg-no-drag zg-menu-row zg-press-subtle !w-auto h-7 !min-h-0 !gap-1 !pl-1 !pr-1.5 font-medium",
|
|
448
|
-
children: [
|
|
449
|
-
/* @__PURE__ */ jsx("span", {
|
|
450
|
-
className: "i-ph-caret-left text-sm text-[var(--zg-text-muted)]",
|
|
451
|
-
"aria-hidden": true
|
|
452
|
-
}),
|
|
453
|
-
/* @__PURE__ */ jsx("span", {
|
|
454
|
-
className: "truncate",
|
|
455
|
-
children: screenLabel
|
|
456
|
-
}),
|
|
457
|
-
/* @__PURE__ */ jsx(Keycap, {
|
|
458
|
-
className: "ml-1.5",
|
|
459
|
-
children: labels.screenBackKey
|
|
460
|
-
})
|
|
461
|
-
]
|
|
462
|
-
})]
|
|
541
|
+
}), backToApp]
|
|
463
542
|
}),
|
|
464
543
|
/* @__PURE__ */ jsx("div", {
|
|
465
544
|
className: "zg-screen-toprow shrink-0 flex items-center px-3",
|
|
@@ -513,4 +592,4 @@ function ScreenShell({ title, description, lead, screenLabel, onClose, aside, as
|
|
|
513
592
|
});
|
|
514
593
|
}
|
|
515
594
|
//#endregion
|
|
516
|
-
export { MODAL_TITLE_ID, ModalProvider, ModalShell, ScreenShell, useModal, useOptionalModal };
|
|
595
|
+
export { MODAL_TITLE_ID, ModalProvider, ModalShell, SCREEN_NARROW_MAX, ScreenShell, useModal, useOptionalModal };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NoticeTone } from "../components/Notice.js";
|
|
2
|
+
import { CSSProperties, ReactNode } from "react";
|
|
3
|
+
//#region src/app/NoticeStack.d.ts
|
|
4
|
+
/** One notice to show. */
|
|
5
|
+
interface AppNotice {
|
|
6
|
+
/** How serious it is. */
|
|
7
|
+
tone: NoticeTone;
|
|
8
|
+
/** The message, worded for people (labels). */
|
|
9
|
+
message: string;
|
|
10
|
+
/** The raw words behind it (an exception's message): folded under Details. */
|
|
11
|
+
detail?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Shows a notice in the app's stack. */
|
|
14
|
+
type Notify = (notice: AppNotice) => void;
|
|
15
|
+
/** Props for {@link NoticeStackProvider}. */
|
|
16
|
+
interface NoticeStackProviderProps {
|
|
17
|
+
/** The app. */
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/** Extra classes on the stack's region. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Inline styles on the stack's region. */
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Provides {@link useNotify} to the components below and shows their notices, newest last.
|
|
26
|
+
*
|
|
27
|
+
* @param props - {@link NoticeStackProviderProps}.
|
|
28
|
+
*/
|
|
29
|
+
declare function NoticeStackProvider({ children, className, style }: NoticeStackProviderProps): import("react").JSX.Element;
|
|
30
|
+
/** Shows a notice in the nearest {@link NoticeStackProvider}'s stack; outside one, a console warning. */
|
|
31
|
+
declare function useNotify(): Notify;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { AppNotice, NoticeStackProvider, NoticeStackProviderProps, Notify, useNotify };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useLabels } from "../labels.js";
|
|
2
|
+
import { IconButton } from "../components/IconButton.js";
|
|
3
|
+
import { Notice } from "../components/Notice.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { createContext, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
6
|
+
//#region src/app/NoticeStack.tsx
|
|
7
|
+
/**
|
|
8
|
+
* The app's transient notices: what an action that has no surface of its own
|
|
9
|
+
* (a menu command, a background step) tells the user, as a stack of
|
|
10
|
+
* {@link Notice}s in a corner of the window. The in-app replacement for
|
|
11
|
+
* `window.alert()`.
|
|
12
|
+
*
|
|
13
|
+
* const notify = useNotify();
|
|
14
|
+
* notify({ tone: 'error', message: labels.moveSessionFailed, detail: errorMessage(err) });
|
|
15
|
+
*
|
|
16
|
+
* An error or a warning stays until dismissed. An info notice leaves after
|
|
17
|
+
* 6 s. `AppHostProvider` mounts one. An app that composes its providers by
|
|
18
|
+
* hand mounts `NoticeStackProvider` above them.
|
|
19
|
+
*/
|
|
20
|
+
/** How long an info notice stays, in ms. */
|
|
21
|
+
const INFO_MS = 6e3;
|
|
22
|
+
const warnOutside = (notice) => {
|
|
23
|
+
console.warn(`[zidane-ui] ${notice.message}${notice.detail ? ` (${notice.detail})` : ""}`);
|
|
24
|
+
};
|
|
25
|
+
const NotifyContext = createContext(warnOutside);
|
|
26
|
+
/**
|
|
27
|
+
* Provides {@link useNotify} to the components below and shows their notices, newest last.
|
|
28
|
+
*
|
|
29
|
+
* @param props - {@link NoticeStackProviderProps}.
|
|
30
|
+
*/
|
|
31
|
+
function NoticeStackProvider({ children, className, style }) {
|
|
32
|
+
const labels = useLabels();
|
|
33
|
+
const [shown, setShown] = useState([]);
|
|
34
|
+
const next = useRef(0);
|
|
35
|
+
const dismiss = useCallback((id) => setShown((all) => all.filter((n) => n.id !== id)), []);
|
|
36
|
+
const notify = useCallback((notice) => {
|
|
37
|
+
const id = next.current++;
|
|
38
|
+
setShown((all) => [...all, {
|
|
39
|
+
...notice,
|
|
40
|
+
id
|
|
41
|
+
}]);
|
|
42
|
+
}, []);
|
|
43
|
+
return /* @__PURE__ */ jsxs(NotifyContext.Provider, {
|
|
44
|
+
value: notify,
|
|
45
|
+
children: [children, shown.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
46
|
+
role: "region",
|
|
47
|
+
"aria-label": labels.noticeStack,
|
|
48
|
+
className: ["fixed bottom-3 right-3 z-zg-tooltip flex flex-col gap-2 w-[min(24rem,calc(100vw-1.5rem))]", className].filter(Boolean).join(" "),
|
|
49
|
+
style,
|
|
50
|
+
children: shown.map((n) => /* @__PURE__ */ jsx(StackedNotice, {
|
|
51
|
+
notice: n,
|
|
52
|
+
onDismiss: () => dismiss(n.id)
|
|
53
|
+
}, n.id))
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function StackedNotice({ notice, onDismiss }) {
|
|
58
|
+
const labels = useLabels();
|
|
59
|
+
const leave = useRef(onDismiss);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
leave.current = onDismiss;
|
|
62
|
+
});
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (notice.tone !== "info") return void 0;
|
|
65
|
+
const timer = setTimeout(() => leave.current(), INFO_MS);
|
|
66
|
+
return () => clearTimeout(timer);
|
|
67
|
+
}, [notice.tone]);
|
|
68
|
+
return /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: "zg-float rounded-zg-md",
|
|
70
|
+
"data-notice-tone": notice.tone,
|
|
71
|
+
children: /* @__PURE__ */ jsx(Notice, {
|
|
72
|
+
tone: notice.tone,
|
|
73
|
+
...notice.detail ? { detail: notice.detail } : {},
|
|
74
|
+
action: /* @__PURE__ */ jsx(IconButton, {
|
|
75
|
+
icon: "i-ph-x",
|
|
76
|
+
label: labels.noticeDismiss,
|
|
77
|
+
size: "sm",
|
|
78
|
+
onClick: onDismiss,
|
|
79
|
+
className: "ml-auto"
|
|
80
|
+
}),
|
|
81
|
+
children: notice.message
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/** Shows a notice in the nearest {@link NoticeStackProvider}'s stack; outside one, a console warning. */
|
|
86
|
+
function useNotify() {
|
|
87
|
+
return useContext(NotifyContext);
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { NoticeStackProvider, useNotify };
|
package/dist/app/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AppHostProvider, AppHostProviderProps, useAppHost } from "./AppHostProvider.js";
|
|
2
|
-
import { LayerOptions, MODAL_TITLE_ID, ModalChromeInset, ModalContextValue, ModalOpenOptions, ModalProvider, ModalProviderProps, ModalScrimKind, ModalShell, ModalShellProps, ModalVariant, ScreenShell, ScreenShellProps, useModal, useOptionalModal } from "./ModalProvider.js";
|
|
2
|
+
import { LayerOptions, MODAL_TITLE_ID, ModalChromeInset, ModalContextValue, ModalOpenOptions, ModalProvider, ModalProviderProps, ModalScrimKind, ModalShell, ModalShellProps, ModalVariant, SCREEN_NARROW_MAX, ScreenShell, ScreenShellProps, useModal, useOptionalModal } from "./ModalProvider.js";
|
|
3
|
+
import { AppNotice, NoticeStackProvider, NoticeStackProviderProps, Notify, useNotify } from "./NoticeStack.js";
|
|
3
4
|
import { useConfirm, useOptionalConfirm } from "./useConfirm.js";
|
|
4
5
|
import { useResource } from "./useResource.js";
|
|
5
|
-
export { AppHostProvider, AppHostProviderProps, LayerOptions, MODAL_TITLE_ID, ModalChromeInset, ModalContextValue, ModalOpenOptions, ModalProvider, ModalProviderProps, ModalScrimKind, ModalShell, ModalShellProps, ModalVariant, ScreenShell, ScreenShellProps, useAppHost, useConfirm, useModal, useOptionalConfirm, useOptionalModal, useResource };
|
|
6
|
+
export { AppHostProvider, AppHostProviderProps, AppNotice, LayerOptions, MODAL_TITLE_ID, ModalChromeInset, ModalContextValue, ModalOpenOptions, ModalProvider, ModalProviderProps, ModalScrimKind, ModalShell, ModalShellProps, ModalVariant, NoticeStackProvider, NoticeStackProviderProps, Notify, SCREEN_NARROW_MAX, ScreenShell, ScreenShellProps, useAppHost, useConfirm, useModal, useNotify, useOptionalConfirm, useOptionalModal, useResource };
|
package/dist/app/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { NoticeStackProvider, useNotify } from "./NoticeStack.js";
|
|
1
2
|
import { AppHostProvider, useAppHost } from "./AppHostProvider.js";
|
|
2
|
-
import { MODAL_TITLE_ID, ModalProvider, ModalShell, ScreenShell, useModal, useOptionalModal } from "./ModalProvider.js";
|
|
3
|
+
import { MODAL_TITLE_ID, ModalProvider, ModalShell, SCREEN_NARROW_MAX, ScreenShell, useModal, useOptionalModal } from "./ModalProvider.js";
|
|
3
4
|
import { useConfirm, useOptionalConfirm } from "./useConfirm.js";
|
|
4
5
|
import { useResource } from "./useResource.js";
|
|
5
|
-
export { AppHostProvider, MODAL_TITLE_ID, ModalProvider, ModalShell, ScreenShell, useAppHost, useConfirm, useModal, useOptionalConfirm, useOptionalModal, useResource };
|
|
6
|
+
export { AppHostProvider, MODAL_TITLE_ID, ModalProvider, ModalShell, NoticeStackProvider, SCREEN_NARROW_MAX, ScreenShell, useAppHost, useConfirm, useModal, useNotify, useOptionalConfirm, useOptionalModal, useResource };
|
|
@@ -3,11 +3,11 @@ import { shikiThemeFor } from "../code/shiki-theme.js";
|
|
|
3
3
|
import { derivePalette } from "../theme/derive.js";
|
|
4
4
|
import { seedFromTheme } from "../theme/from-theme.js";
|
|
5
5
|
import { BUILTIN_THEMES, DEFAULT_THEME, resolveTheme } from "../theme/themes.js";
|
|
6
|
-
import { DEFAULT_APPEARANCE, activeThemeId, resolveMotion } from "./headless/prefs.js";
|
|
7
|
-
import { fontsToCssVars } from "./headless/fonts.js";
|
|
8
6
|
import { constant, useReadable } from "../chat/headless/store.js";
|
|
9
7
|
import { codeThemeTypeOf } from "../code/code-themes.js";
|
|
10
8
|
import { applyPalette } from "./apply.js";
|
|
9
|
+
import { fontsToCssVars } from "./headless/fonts.js";
|
|
10
|
+
import { DEFAULT_APPEARANCE, activeThemeId, resolveMotion } from "./headless/prefs.js";
|
|
11
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
12
|
import { createContext, useContext, useEffect, useMemo, useState, useSyncExternalStore } from "react";
|
|
13
13
|
//#region src/appearance/AppearanceProvider.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { CURATED_FONTS, FONT_STACKS, availableCuratedFonts, cssFamily, fontStack, fontsToCssVars, guessKind, isFontAvailable, queryInstalledFonts } from "./fonts.js";
|
|
1
2
|
import { DEFAULT_APPEARANCE, LIMITS, activeThemeId, parseAppearance, resolveMotion, stepInterfaceScale } from "./prefs.js";
|
|
2
3
|
import { APPEARANCE_STORAGE_KEY, BOOT_SNAPSHOT_KEY, createStorageAppearancePrefs, createStorageBoot } from "./storage.js";
|
|
3
|
-
import { CURATED_FONTS, FONT_STACKS, availableCuratedFonts, cssFamily, fontStack, fontsToCssVars, guessKind, isFontAvailable, queryInstalledFonts } from "./fonts.js";
|
|
4
4
|
import { zoomKeyCommands } from "./zoom-commands.js";
|
|
5
5
|
export { APPEARANCE_STORAGE_KEY, BOOT_SNAPSHOT_KEY, CURATED_FONTS, DEFAULT_APPEARANCE, FONT_STACKS, LIMITS, activeThemeId, availableCuratedFonts, createStorageAppearancePrefs, createStorageBoot, cssFamily, fontStack, fontsToCssVars, guessKind, isFontAvailable, parseAppearance, queryInstalledFonts, resolveMotion, stepInterfaceScale, zoomKeyCommands };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createPendingApprovals } from "./pending.js";
|
|
2
|
-
import { createSafelist } from "./safelist.js";
|
|
3
1
|
import { createApprovalHeads } from "./heads.js";
|
|
4
2
|
import { DEFAULT_APPROVALS_LABELS } from "./labels.js";
|
|
3
|
+
import { createPendingApprovals } from "./pending.js";
|
|
4
|
+
import { createSafelist } from "./safelist.js";
|
|
5
5
|
import { FILE_EDIT_TOOLS, allowDecision, approvalPath, approvalPreview, initialHunkMask, isFileEditApproval } from "./preview.js";
|
|
6
6
|
export { DEFAULT_APPROVALS_LABELS, FILE_EDIT_TOOLS, allowDecision, approvalPath, approvalPreview, createApprovalHeads, createPendingApprovals, createSafelist, initialHunkMask, isFileEditApproval };
|
|
@@ -106,7 +106,7 @@ interface SessionFilterMenuProps<V extends SessionView = SessionGroupBy> {
|
|
|
106
106
|
project?: SessionProjectAxis;
|
|
107
107
|
/** Last-activity filter axis: limit the list to sessions active within a window (`1d` to `30d`, or `all`). */
|
|
108
108
|
activity?: SessionFilterAxis<SessionActivityFilter>;
|
|
109
|
-
/** Sort axis: `alphabetical`, `createdTime`, or `recency`. */
|
|
109
|
+
/** Sort axis: `alphabetical`, `createdTime` (the default), `lastUserMessage`, or `recency`. */
|
|
110
110
|
sort?: SessionFilterAxis<SessionSortBy>;
|
|
111
111
|
/** More rows, each in the group its `placement` names, after the built-in ones. */
|
|
112
112
|
extras?: readonly SessionFilterExtra[];
|
|
@@ -36,6 +36,7 @@ const ACTIVITIES = [
|
|
|
36
36
|
const SORTS = [
|
|
37
37
|
"alphabetical",
|
|
38
38
|
"createdTime",
|
|
39
|
+
"lastUserMessage",
|
|
39
40
|
"recency"
|
|
40
41
|
];
|
|
41
42
|
const ALL_PROJECTS = "__all__";
|
|
@@ -99,7 +100,7 @@ function SessionFilterMenu({ view, status, project, activity, sort, extras = NO_
|
|
|
99
100
|
[sort && /* @__PURE__ */ jsx(FilterSub, {
|
|
100
101
|
label: labels.filterSort,
|
|
101
102
|
value: labels.filterSorts[sort.value],
|
|
102
|
-
atDefault: sort.value === "
|
|
103
|
+
atDefault: sort.value === "createdTime",
|
|
103
104
|
options: choices(sort.options ?? SORTS, labels.filterSorts),
|
|
104
105
|
current: sort.value,
|
|
105
106
|
onChange: (v) => sort.onChange(v)
|
package/dist/chat/Transcript.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { firstRowId } from "./headless/transcript/rows.js";
|
|
2
1
|
import { useExtensionItems } from "../extensions/ExtensionsProvider.js";
|
|
3
2
|
import { LinkSessionScope } from "../extensions/links.js";
|
|
4
3
|
import { CvRow, TranscriptSettling } from "./transcript/LazyRow.js";
|
|
5
4
|
import { MarkdownDiagrams } from "./transcript/markdown.js";
|
|
6
5
|
import { useTranscriptActions } from "./transcript/actions.js";
|
|
7
6
|
import { RowIconsContext } from "./transcript/frame.js";
|
|
7
|
+
import { firstRowId } from "./headless/transcript/rows.js";
|
|
8
8
|
import { ExtensionSlot } from "../extensions/ExtensionSlot.js";
|
|
9
9
|
import { rowTurnIds, stopForRow } from "./headless/transcript/select-stops.js";
|
|
10
10
|
import { rowCvStyle, rowEstimatePx } from "./transcript/row-estimate.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { IconButton } from "../../components/IconButton.js";
|
|
2
|
+
import { Notice } from "../../components/Notice.js";
|
|
3
|
+
import { errorMessage } from "../../components/report-error.js";
|
|
2
4
|
import { useLightbox } from "../../components/Lightbox.js";
|
|
3
5
|
import { useChatLabels } from "../useChatLabels.js";
|
|
4
6
|
import { AttachmentNotices, AttachmentTiles, attachmentLightboxItems } from "./attachments.js";
|
|
@@ -145,7 +147,7 @@ const Composer = forwardRef(function Composer(props, ref) {
|
|
|
145
147
|
} catch (error) {
|
|
146
148
|
restore();
|
|
147
149
|
if (p.onError) p.onError(error);
|
|
148
|
-
else setSendError(
|
|
150
|
+
else setSendError(errorMessage(error));
|
|
149
151
|
}
|
|
150
152
|
}, [editor]);
|
|
151
153
|
useLayoutEffect(() => {
|
|
@@ -338,11 +340,12 @@ const Composer = forwardRef(function Composer(props, ref) {
|
|
|
338
340
|
})
|
|
339
341
|
]
|
|
340
342
|
}),
|
|
341
|
-
sendError && /* @__PURE__ */ jsx(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
343
|
+
sendError && /* @__PURE__ */ jsx(Notice, {
|
|
344
|
+
tone: "error",
|
|
345
|
+
compact: true,
|
|
346
|
+
detail: sendError,
|
|
347
|
+
className: "mx-4 mt-1.5",
|
|
348
|
+
children: labels.composerSendFailed
|
|
346
349
|
}),
|
|
347
350
|
props.below,
|
|
348
351
|
/* @__PURE__ */ jsx(SuggestionPopup, { state: suggest }),
|
|
@@ -2,8 +2,8 @@ import { plainTextToDocJson } from "./prompt-history-nav.js";
|
|
|
2
2
|
import { suggestionExtension } from "./suggestion-extension.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { useLayoutEffect } from "react";
|
|
5
|
-
import Placeholder from "@tiptap/extension-placeholder";
|
|
6
5
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
6
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
7
7
|
import StarterKit from "@tiptap/starter-kit";
|
|
8
8
|
//#region src/chat/composer/ComposerEditor.tsx
|
|
9
9
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { remindersSummary } from "../../session/headless/schedules.js";
|
|
2
1
|
import { useComposerLabels } from "./ComposerHostProvider.js";
|
|
3
2
|
import { useExtensionItems, useExtensionsHost } from "../../extensions/ExtensionsProvider.js";
|
|
4
3
|
import { useSessionHost, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules } from "../../session/SessionProvider.js";
|
|
5
4
|
import { slotItems } from "../../extensions/headless/select.js";
|
|
5
|
+
import { remindersSummary } from "../../session/headless/schedules.js";
|
|
6
6
|
import { ComposerBadges } from "./ComposerBadges.js";
|
|
7
7
|
import { mergeBadgeOrder, orderComposerBadges } from "./badge-order.js";
|
|
8
8
|
import { usePendingInteractions } from "../interactions/hooks.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Notice } from "../../components/Notice.js";
|
|
1
2
|
import { useChatLabels } from "../useChatLabels.js";
|
|
2
3
|
import { canJoinChain, lineupKeyOf, modelLineup, offCatalogRows, pickRefOf, pickerGroups, refKey, resolveChain, rowKey, unresolveChain, withPrimary } from "./model-catalog.js";
|
|
3
4
|
import { layoutModelList } from "./model-list-layout.js";
|
|
@@ -285,15 +286,23 @@ function ModelChainList({ initialChain, catalog, loadError = null, onRetry, show
|
|
|
285
286
|
inputRef
|
|
286
287
|
}),
|
|
287
288
|
/* @__PURE__ */ jsx("div", { className: "shrink-0 h-px bg-[var(--zg-hairline)]" }),
|
|
288
|
-
loadError
|
|
289
|
+
loadError ? /* @__PURE__ */ jsx("div", {
|
|
290
|
+
className: "flex-1 min-h-0 flex flex-col items-center justify-center px-6 py-8",
|
|
291
|
+
children: /* @__PURE__ */ jsx(Notice, {
|
|
292
|
+
tone: "error",
|
|
293
|
+
detail: loadError,
|
|
294
|
+
action: onRetry && /* @__PURE__ */ jsx("button", {
|
|
295
|
+
type: "button",
|
|
296
|
+
className: "underline text-[var(--zg-text)] bg-transparent border-0 cursor-pointer",
|
|
297
|
+
onClick: onRetry,
|
|
298
|
+
children: labels.retry
|
|
299
|
+
}),
|
|
300
|
+
children: labels.modelsLoadError
|
|
301
|
+
})
|
|
302
|
+
}) : notice ? /* @__PURE__ */ jsx("div", {
|
|
289
303
|
role: "status",
|
|
290
|
-
className:
|
|
291
|
-
children:
|
|
292
|
-
type: "button",
|
|
293
|
-
className: "underline text-[var(--zg-text)] bg-transparent border-0 cursor-pointer",
|
|
294
|
-
onClick: onRetry,
|
|
295
|
-
children: labels.retry
|
|
296
|
-
})]
|
|
304
|
+
className: "flex-1 min-h-0 flex flex-col items-center justify-center gap-2 px-6 py-8 text-center text-xs text-[var(--zg-text-muted)]",
|
|
305
|
+
children: notice
|
|
297
306
|
}) : /* @__PURE__ */ jsx(ModelChainRows, {
|
|
298
307
|
layout,
|
|
299
308
|
cursor,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Notice } from "../../components/Notice.js";
|
|
1
2
|
import { useChatLabels } from "../useChatLabels.js";
|
|
2
3
|
import { refKey, resolvePick, rowKey } from "./model-catalog.js";
|
|
3
4
|
import { ModelProviderChip, ModelReasoning, ModelWindow } from "./ModelFacts.js";
|
|
@@ -34,8 +35,10 @@ function ModelChainTooltip({ chain, catalog, serving = null, forNextChat = false
|
|
|
34
35
|
style,
|
|
35
36
|
"data-testid": "model-chain-tooltip",
|
|
36
37
|
children: [
|
|
37
|
-
serving && /* @__PURE__ */ jsx(
|
|
38
|
-
|
|
38
|
+
serving && /* @__PURE__ */ jsx(Notice, {
|
|
39
|
+
tone: "warning",
|
|
40
|
+
compact: true,
|
|
41
|
+
className: "leading-snug",
|
|
39
42
|
children: labels.modelServing(primaryName, serving)
|
|
40
43
|
}),
|
|
41
44
|
forNextChat && /* @__PURE__ */ jsx("span", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useComposerHost } from "./ComposerHostProvider.js";
|
|
1
2
|
import { IDLE_RESOURCE } from "../../app/headless/resource.js";
|
|
2
3
|
import { createModelPickerPrefs } from "../headless/composer/model-picker-prefs.js";
|
|
3
|
-
import { useComposerHost } from "./ComposerHostProvider.js";
|
|
4
4
|
import { modelKnobsOf } from "../headless/composer/model-knobs.js";
|
|
5
5
|
import { modelNamesOf } from "../headless/composer/model-names.js";
|
|
6
6
|
import { useEffect, useMemo, useSyncExternalStore } from "react";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DraftEnvironment, EnvironmentMachine } from "../../git/headless/environment.js";
|
|
2
|
-
import { DraftFolderSource } from "../headless/draft-target.js";
|
|
2
|
+
import { DraftFolderSource, DraftPlaceIssue } from "../headless/draft-target.js";
|
|
3
3
|
import { DraftRemoteClone } from "../../git/headless/remote-clone.js";
|
|
4
|
+
import { NewChatPlace } from "zidane/chat/pure";
|
|
4
5
|
import { EnvironmentDescriptor } from "zidane/chat";
|
|
5
6
|
//#region src/chat/composer/use-draft-target.d.ts
|
|
6
7
|
/** A saved server a draft can run on. */
|
|
@@ -9,6 +10,8 @@ interface DraftServer {
|
|
|
9
10
|
id: string;
|
|
10
11
|
/** Its name. */
|
|
11
12
|
name: string;
|
|
13
|
+
/** Its URL, kept with a default place for a device that has not saved it. */
|
|
14
|
+
url?: string;
|
|
12
15
|
}
|
|
13
16
|
/** What {@link useDraftTarget} reads from the app. */
|
|
14
17
|
interface DraftTargetOptions {
|
|
@@ -34,6 +37,11 @@ interface DraftTargetOptions {
|
|
|
34
37
|
* instead.
|
|
35
38
|
*/
|
|
36
39
|
request?: DraftTargetRequest | null;
|
|
40
|
+
/**
|
|
41
|
+
* Where new chats start (the space's place, else the global one: `useNewSessionDefaults`). Applied to each new
|
|
42
|
+
* draft, before a request. Absent: this computer.
|
|
43
|
+
*/
|
|
44
|
+
place?: NewChatPlace | null;
|
|
37
45
|
}
|
|
38
46
|
/** A draft target picked outside the composer. */
|
|
39
47
|
interface DraftTargetRequest {
|
|
@@ -68,6 +76,11 @@ interface DraftTarget {
|
|
|
68
76
|
server?: DraftServer;
|
|
69
77
|
/** Runs the draft on a saved server (`LOCAL_HOST_KEY`: this computer). */
|
|
70
78
|
setHostId(hostId: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Runs the draft on a host and one of its environment kinds in one step (a machine of another server picked
|
|
81
|
+
* from the where menu): the host's folder starts over, the kind is kept.
|
|
82
|
+
*/
|
|
83
|
+
setPlace(hostId: string, environment: string): void;
|
|
71
84
|
/** The server's folder (`null`: its first root). */
|
|
72
85
|
remoteFolder: string | null;
|
|
73
86
|
/** Picks the server's folder. */
|
|
@@ -98,6 +111,12 @@ interface DraftTarget {
|
|
|
98
111
|
setMachineFolder(folder: string | null): void;
|
|
99
112
|
/** The host the machine's folders are browsed through. */
|
|
100
113
|
machineHost: string;
|
|
114
|
+
/** Why the draft cannot use the default place as it is (until dismissed or the next draft). */
|
|
115
|
+
placeIssue: DraftPlaceIssue | null;
|
|
116
|
+
/** Hides {@link DraftTarget.placeIssue}. */
|
|
117
|
+
dismissPlaceIssue(): void;
|
|
118
|
+
/** The draft's pick as a place: what "Use for new chats" saves. */
|
|
119
|
+
here: NewChatPlace;
|
|
101
120
|
/** Why the last new chat could not be created (the prompt is back in the box). */
|
|
102
121
|
error: string | null;
|
|
103
122
|
/** Shows or clears {@link DraftTarget.error}. */
|