zidane-ui 9.1.3 → 9.1.5
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/server-extensions-host.js +1 -1
- package/dist/adapters/server-host.js +2 -1
- package/dist/adapters/server-machines-host.js +1 -1
- package/dist/adapters/server-session-host.js +87 -13
- package/dist/adapters/server-settings-host.js +1 -1
- 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/HostTranscript.d.ts +5 -1
- package/dist/chat/HostTranscript.js +16 -4
- package/dist/chat/RunEstimateChip.d.ts +5 -3
- package/dist/chat/RunEstimateChip.js +33 -3
- package/dist/chat/Transcript.js +1 -1
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ConversationBadges.js +16 -10
- package/dist/chat/composer/composer-bus.d.ts +2 -2
- package/dist/chat/composer/composer-bus.js +2 -2
- package/dist/chat/composer/use-composer-stores.js +1 -1
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/headless/composer/conversation-badges.d.ts +8 -3
- package/dist/chat/headless/composer/conversation-badges.js +26 -11
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +3 -1
- package/dist/chat/headless/composer/labels-chrome.js +3 -1
- package/dist/chat/headless/index.d.ts +5 -3
- package/dist/chat/headless/index.js +17 -15
- package/dist/chat/headless/labels.d.ts +54 -1
- package/dist/chat/headless/labels.js +62 -2
- package/dist/chat/headless/secrets.d.ts +32 -0
- package/dist/chat/headless/secrets.js +43 -0
- package/dist/chat/headless/session-list.d.ts +45 -0
- package/dist/chat/headless/sidebar/estimates.js +13 -1
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +1 -1
- package/dist/chat/headless/sidebar/labels.d.ts +50 -0
- package/dist/chat/headless/sidebar/labels.js +1 -0
- package/dist/chat/headless/sidebar/query.d.ts +2 -2
- package/dist/chat/headless/sidebar/query.js +6 -3
- package/dist/chat/headless/sidebar/types.d.ts +7 -1
- package/dist/chat/headless/sidebar/view.js +2 -0
- package/dist/chat/headless/transcript/auth-failure.d.ts +67 -0
- package/dist/chat/headless/transcript/auth-failure.js +87 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -1
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/nesting.d.ts +3 -3
- package/dist/chat/headless/transcript/nesting.js +12 -4
- package/dist/chat/index.d.ts +4 -2
- package/dist/chat/index.js +3 -1
- package/dist/chat/interactions/InboxPanel.d.ts +6 -2
- package/dist/chat/interactions/InboxPanel.js +82 -44
- package/dist/chat/interactions/PlanCard.d.ts +2 -2
- package/dist/chat/interactions/PlanCard.js +1 -1
- package/dist/chat/interactions/QuestionField.d.ts +8 -3
- package/dist/chat/interactions/QuestionField.js +89 -8
- package/dist/chat/interactions/QuestionForm.d.ts +3 -1
- package/dist/chat/interactions/QuestionForm.js +48 -10
- package/dist/chat/interactions/SecretInput.d.ts +32 -0
- package/dist/chat/interactions/SecretInput.js +72 -0
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +5 -3
- package/dist/chat/interactions/index.d.ts +2 -1
- package/dist/chat/interactions/index.js +2 -1
- package/dist/chat/sidebar/SessionSidebar.js +2 -0
- package/dist/chat/sidebar/SidebarFilterMenu.d.ts +7 -2
- package/dist/chat/sidebar/SidebarFilterMenu.js +26 -2
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +8 -3
- package/dist/chat/sidebar/sidebar-live.js +8 -4
- package/dist/chat/transcript/AuthFailureCard.d.ts +34 -0
- package/dist/chat/transcript/AuthFailureCard.js +358 -0
- package/dist/chat/transcript/InteractionToolBody.js +12 -2
- package/dist/chat/transcript/actions.d.ts +24 -1
- package/dist/chat/transcript/index.d.ts +3 -2
- package/dist/chat/transcript/index.js +2 -1
- package/dist/chat/transcript/notices.d.ts +2 -1
- package/dist/chat/transcript/notices.js +13 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +1 -1
- package/dist/components/HowItWorks.d.ts +8 -1
- package/dist/components/HowItWorks.js +2 -2
- package/dist/components/RowActionsMenu.d.ts +6 -1
- package/dist/components/RowActionsMenu.js +4 -0
- package/dist/core.css +24 -0
- package/dist/dist/{index-WlE93Q6d.d.ts → index-BI6RZc60.d.ts} +36 -3
- package/dist/dist/index-f-XWIoYo.d.ts +1 -0
- package/dist/dist/index.d.ts +6 -0
- package/dist/dist/sandbox-B4OW6oNx.d.ts +2 -0
- package/dist/dist/timeout-B5pO5I5a.d.ts +30 -0
- package/dist/extensions/ExtensionSettingsPage.js +1 -1
- package/dist/extensions/ExtensionSettingsSidebar.js +1 -1
- package/dist/extensions/headless/fixture-host.js +1 -1
- package/dist/extensions/headless/index.js +4 -4
- package/dist/extensions/hooks.js +1 -1
- package/dist/files/DiffsTab.js +1 -1
- package/dist/files/EditorColumn.js +1 -1
- package/dist/files/MediaDiff.js +1 -1
- package/dist/files/SearchPanel.js +121 -53
- package/dist/files/headless/name-match.js +29 -14
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useOpenFiles.js +1 -1
- package/dist/git/WherePicker.js +2 -2
- package/dist/git/headless/environment.d.ts +6 -1
- package/dist/git/headless/environment.js +5 -2
- package/dist/git/headless/labels.d.ts +2 -0
- package/dist/git/headless/labels.js +2 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +2 -1
- package/dist/git/useStartFromPanel.d.ts +22 -0
- package/dist/git/useStartFromPanel.js +91 -0
- package/dist/keybindings/KeyCommands.js +1 -1
- package/dist/keybindings/KeybindingsProvider.js +1 -1
- package/dist/keybindings/headless/catalog.js +2 -2
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/overrides.js +1 -1
- package/dist/machines/HostSyncPanel.js +1 -1
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/headless/index.js +1 -1
- package/dist/onboarding/demos/features.d.ts +9 -1
- package/dist/onboarding/demos/features.js +107 -2
- package/dist/onboarding/demos/how-it-works.d.ts +5 -1
- package/dist/onboarding/demos/how-it-works.js +120 -2
- package/dist/onboarding/headless/labels.d.ts +17 -0
- package/dist/onboarding/headless/labels.js +17 -0
- package/dist/onboarding/index.js +1 -1
- package/dist/onboarding/marks.d.ts +1 -2
- package/dist/onboarding/marks.js +4 -12
- package/dist/onboarding/steps/ReadyStep.js +1 -1
- package/dist/onboarding/steps/connect/ProviderPanel.js +1 -1
- package/dist/onboarding/tutorials.d.ts +3 -1
- package/dist/onboarding/tutorials.js +2 -1
- package/dist/palette/app-sources.js +1 -1
- package/dist/session/ArtifactsPanel.js +1 -1
- package/dist/session/PanelAttention.d.ts +14 -6
- package/dist/session/PanelAttention.js +35 -24
- package/dist/session/PlanTracker.d.ts +54 -0
- package/dist/session/PlanTracker.js +412 -0
- package/dist/session/ProjectHome.d.ts +15 -2
- package/dist/session/ProjectHome.js +158 -85
- package/dist/session/RemindersPanel.d.ts +25 -0
- package/dist/session/RemindersPanel.js +526 -0
- package/dist/session/SecretsPanel.d.ts +19 -0
- package/dist/session/SecretsPanel.js +241 -0
- package/dist/session/SessionProvider.d.ts +26 -5
- package/dist/session/SessionProvider.js +51 -6
- package/dist/session/StepStatusIcon.d.ts +24 -0
- package/dist/session/StepStatusIcon.js +50 -0
- package/dist/session/TodoList.d.ts +4 -3
- package/dist/session/TodoList.js +6 -5
- package/dist/session/headless/fixture-host.d.ts +32 -22
- package/dist/session/headless/fixture-host.js +86 -51
- package/dist/session/headless/fixture-plans.d.ts +57 -0
- package/dist/session/headless/fixture-plans.js +141 -0
- package/dist/session/headless/fixture-schedules.d.ts +49 -0
- package/dist/session/headless/fixture-schedules.js +133 -0
- package/dist/session/headless/home-layout.d.ts +10 -2
- package/dist/session/headless/home-layout.js +7 -2
- package/dist/session/headless/host.d.ts +85 -13
- package/dist/session/headless/index.d.ts +5 -3
- package/dist/session/headless/index.js +6 -4
- package/dist/session/headless/labels.d.ts +95 -12
- package/dist/session/headless/labels.js +67 -18
- package/dist/session/headless/plans.d.ts +53 -0
- package/dist/session/headless/plans.js +78 -0
- package/dist/session/headless/reminder-labels.d.ts +63 -0
- package/dist/session/headless/reminder-labels.js +84 -0
- package/dist/session/headless/schedules.d.ts +93 -0
- package/dist/session/headless/schedules.js +190 -0
- package/dist/session/headless/secrets.d.ts +28 -0
- package/dist/session/headless/secrets.js +48 -0
- package/dist/session/index.d.ts +7 -5
- package/dist/session/index.js +6 -4
- package/dist/session/testing/contract.d.ts +18 -5
- package/dist/session/testing/contract.js +351 -43
- package/dist/session/testing/index.d.ts +4 -2
- package/dist/session/testing/index.js +4 -2
- package/dist/settings/headless/catalog.js +17 -1
- package/dist/settings/headless/index.d.ts +2 -2
- package/dist/settings/headless/index.js +3 -3
- package/dist/settings/headless/labels.d.ts +0 -2
- package/dist/settings/headless/labels.js +0 -2
- package/dist/settings/headless/layout.js +7 -1
- package/dist/settings/headless/providers.d.ts +17 -1
- package/dist/settings/headless/providers.js +19 -1
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/rows.d.ts +1 -1
- package/dist/settings/rows.js +2 -2
- 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 +1 -1
- package/dist/settings/sections/environments/EnvironmentsSection.js +1 -1
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
- package/dist/settings/sections/mcp/McpSection.js +1 -1
- package/dist/settings/sections/mcp/McpServerRow.js +1 -1
- package/dist/settings/sections/models/ModelRows.js +1 -1
- package/dist/settings/sections/providers/ProvidersSection.js +209 -201
- package/dist/settings/sections/providers/ServerProvidersSection.js +1 -1
- package/dist/settings/sections/shared/catalog.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +1 -1
- package/dist/styles.css +59 -1
- package/dist/terminal/HostTerminalSurface.js +2 -2
- package/dist/workspace/PanelContentView.d.ts +22 -4
- package/dist/workspace/PanelContentView.js +112 -16
- package/dist/workspace/PanelGlyph.d.ts +21 -0
- package/dist/workspace/PanelGlyph.js +33 -0
- package/dist/workspace/PanelHome.js +5 -3
- package/dist/workspace/PanelStrip.js +11 -4
- package/dist/workspace/PanelToolbar.d.ts +32 -0
- package/dist/workspace/PanelToolbar.js +194 -0
- package/dist/workspace/WorkspaceProvider.d.ts +3 -1
- package/dist/workspace/WorkspaceProvider.js +6 -2
- package/dist/workspace/extension-tabs.js +5 -2
- package/dist/workspace/headless/host.d.ts +4 -0
- package/dist/workspace/headless/index.d.ts +3 -1
- package/dist/workspace/headless/index.js +4 -2
- package/dist/workspace/headless/labels.d.ts +10 -0
- package/dist/workspace/headless/labels.js +11 -1
- package/dist/workspace/headless/pages.d.ts +15 -0
- package/dist/workspace/headless/pages.js +49 -0
- package/dist/workspace/headless/tab-mark.d.ts +14 -0
- package/dist/workspace/headless/tab-mark.js +27 -0
- package/dist/workspace/headless/view.d.ts +7 -1
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +3 -2
- package/dist/workspace/testing/index.js +6 -0
- package/dist/workspace/workspace-key-commands.js +3 -3
- package/package.json +2 -2
- package/src/styles/motion.css +13 -0
- package/src/styles/onboarding.css +0 -1
- package/src/styles/primitives.css +10 -0
- package/src/styles/workspace.css +17 -0
- package/dist/session/TodosPanel.d.ts +0 -19
- package/dist/session/TodosPanel.js +0 -251
- package/dist/session/headless/todos.d.ts +0 -22
- package/dist/session/headless/todos.js +0 -38
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IconButton } from "../components/IconButton.js";
|
|
2
2
|
import { Tooltip } from "../components/Tooltip.js";
|
|
3
|
+
import { useNearViewport } from "../hooks/useNearViewport.js";
|
|
3
4
|
import { useFilesLabels } from "./useFilesLabels.js";
|
|
4
5
|
import { FileIcon, TreeChevron } from "../code/editor/FileIcon.js";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { memo, useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { memo, startTransition, useCallback, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
|
|
7
8
|
//#region src/files/SearchPanel.tsx
|
|
8
9
|
/**
|
|
9
10
|
* ⌘⇧F: search across files, shown in place of the Files tree or the Diffs
|
|
@@ -12,6 +13,10 @@ import { memo, useEffect, useMemo, useRef, useState } from "react";
|
|
|
12
13
|
* lines come from `search` (the host for Files, the diffs for Diffs).
|
|
13
14
|
*
|
|
14
15
|
* Keys: ↓ / ↑ move between results, Enter opens, Esc closes.
|
|
16
|
+
*
|
|
17
|
+
* Typing stays ahead of the results: names match on a deferred query, new
|
|
18
|
+
* lines land in a transition, and the lines render a page at a time (the next
|
|
19
|
+
* page once the list's end comes near), so a big result never blocks a keystroke.
|
|
15
20
|
*/
|
|
16
21
|
function splitPath(path) {
|
|
17
22
|
const slash = path.lastIndexOf("/");
|
|
@@ -27,6 +32,8 @@ const DEBOUNCE_MS = 150;
|
|
|
27
32
|
const MAX_NAMES = 50;
|
|
28
33
|
/** Characters kept before the first match on a long line. */
|
|
29
34
|
const LEAD = 32;
|
|
35
|
+
/** Result rows (file headers and lines) rendered per page. */
|
|
36
|
+
const PAGE = 200;
|
|
30
37
|
const SearchPanel = memo(function SearchPanel({ label, asked, names, search, onOpenFile, onOpenLine, onClose, inset }) {
|
|
31
38
|
const labels = useFilesLabels();
|
|
32
39
|
const [query, setQuery] = useState("");
|
|
@@ -49,12 +56,13 @@ const SearchPanel = memo(function SearchPanel({ label, asked, names, search, onO
|
|
|
49
56
|
let live = true;
|
|
50
57
|
const t = window.setTimeout(() => {
|
|
51
58
|
latest.current(query, opts).then((r) => {
|
|
52
|
-
if (live)
|
|
59
|
+
if (!live) return;
|
|
60
|
+
startTransition(() => setResult({
|
|
53
61
|
query,
|
|
54
62
|
matches: r.matches,
|
|
55
63
|
capped: r.capped,
|
|
56
64
|
...r.unsupported ? { unsupported: r.unsupported } : {}
|
|
57
|
-
});
|
|
65
|
+
}));
|
|
58
66
|
});
|
|
59
67
|
}, DEBOUNCE_MS);
|
|
60
68
|
return () => {
|
|
@@ -62,16 +70,37 @@ const SearchPanel = memo(function SearchPanel({ label, asked, names, search, onO
|
|
|
62
70
|
window.clearTimeout(t);
|
|
63
71
|
};
|
|
64
72
|
}, [query, opts]);
|
|
65
|
-
const
|
|
73
|
+
const namesQuery = useDeferredValue(query);
|
|
74
|
+
const nameHits = useMemo(() => namesQuery ? names(namesQuery, opts).slice(0, MAX_NAMES) : [], [
|
|
66
75
|
names,
|
|
67
|
-
|
|
76
|
+
namesQuery,
|
|
68
77
|
opts
|
|
69
78
|
]);
|
|
70
79
|
const groups = useMemo(() => {
|
|
71
80
|
const byPath = /* @__PURE__ */ new Map();
|
|
72
|
-
for (const m of result?.matches ?? [])
|
|
81
|
+
for (const m of result?.matches ?? []) {
|
|
82
|
+
const lines = byPath.get(m.path);
|
|
83
|
+
if (lines) lines.push(m);
|
|
84
|
+
else byPath.set(m.path, [m]);
|
|
85
|
+
}
|
|
73
86
|
return [...byPath];
|
|
74
87
|
}, [result]);
|
|
88
|
+
const [more, setMore] = useState({
|
|
89
|
+
of: null,
|
|
90
|
+
pages: 0
|
|
91
|
+
});
|
|
92
|
+
const budget = PAGE * (1 + (more.of === result ? more.pages : 0));
|
|
93
|
+
const showMore = useCallback(() => {
|
|
94
|
+
startTransition(() => setMore((m) => ({
|
|
95
|
+
of: result,
|
|
96
|
+
pages: (m.of === result ? m.pages : 0) + 1
|
|
97
|
+
})));
|
|
98
|
+
}, [result]);
|
|
99
|
+
const toggleGroup = useCallback((path) => setCollapsed((prev) => {
|
|
100
|
+
const next = new Set(prev);
|
|
101
|
+
if (!next.delete(path)) next.add(path);
|
|
102
|
+
return next;
|
|
103
|
+
}), []);
|
|
75
104
|
const hitCount = useMemo(() => (result?.matches ?? []).reduce((n, m) => n + m.ranges.length, 0), [result]);
|
|
76
105
|
const pending = query !== "" && result?.query !== query;
|
|
77
106
|
const focusResult = (from, direction) => {
|
|
@@ -154,6 +183,7 @@ const SearchPanel = memo(function SearchPanel({ label, asked, names, search, onO
|
|
|
154
183
|
}),
|
|
155
184
|
/* @__PURE__ */ jsxs("div", {
|
|
156
185
|
ref: list,
|
|
186
|
+
"data-scroll-root": "",
|
|
157
187
|
className: "flex-1 min-h-0 overflow-y-auto px-2 pb-2",
|
|
158
188
|
children: [nameHits.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
159
189
|
"aria-label": labels.filesFileNames,
|
|
@@ -167,57 +197,95 @@ const SearchPanel = memo(function SearchPanel({ label, asked, names, search, onO
|
|
|
167
197
|
title: path,
|
|
168
198
|
children: [/* @__PURE__ */ jsx(FileIcon, { path }), /* @__PURE__ */ jsx(PathLabel, { path })]
|
|
169
199
|
}) }, path))
|
|
170
|
-
}), groups.length > 0 && /* @__PURE__ */ jsx(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
onClick: () => setCollapsed((prev) => {
|
|
181
|
-
const next = new Set(prev);
|
|
182
|
-
if (!next.delete(path)) next.add(path);
|
|
183
|
-
return next;
|
|
184
|
-
}),
|
|
185
|
-
className: "zg-menu-row zg-press-subtle",
|
|
186
|
-
title: path,
|
|
187
|
-
children: [
|
|
188
|
-
/* @__PURE__ */ jsx(TreeChevron, {
|
|
189
|
-
open: !closed,
|
|
190
|
-
className: "text-[var(--zg-text-muted)]"
|
|
191
|
-
}),
|
|
192
|
-
/* @__PURE__ */ jsx(FileIcon, { path }),
|
|
193
|
-
/* @__PURE__ */ jsx(PathLabel, { path }),
|
|
194
|
-
/* @__PURE__ */ jsx("span", {
|
|
195
|
-
className: "zg-meta shrink-0 tabular-nums",
|
|
196
|
-
children: lines.reduce((n, l) => n + l.ranges.length, 0)
|
|
197
|
-
})
|
|
198
|
-
]
|
|
199
|
-
}), !closed && /* @__PURE__ */ jsx("ul", {
|
|
200
|
-
className: "m-0 p-0 list-none flex flex-col",
|
|
201
|
-
children: lines.map((m) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
|
|
202
|
-
type: "button",
|
|
203
|
-
"data-result": "",
|
|
204
|
-
"data-size": "sm",
|
|
205
|
-
onClick: () => onOpenLine(m, result.query, opts),
|
|
206
|
-
className: "zg-menu-row zg-press-subtle",
|
|
207
|
-
style: { paddingLeft: 30 },
|
|
208
|
-
"aria-label": labels.filesMatchLine(path, m.line, m.text.trim()),
|
|
209
|
-
children: [/* @__PURE__ */ jsxs("span", {
|
|
210
|
-
className: "zg-meta shrink-0 w-8 text-right tabular-nums",
|
|
211
|
-
children: [m.side === "old" ? "−" : "", m.line]
|
|
212
|
-
}), /* @__PURE__ */ jsx(LineText, { match: m })]
|
|
213
|
-
}) }, `${m.part ?? ""}:${m.side ?? ""}:${m.line}`))
|
|
214
|
-
})] }, path);
|
|
215
|
-
})
|
|
200
|
+
}), groups.length > 0 && result && /* @__PURE__ */ jsx(MatchGroups, {
|
|
201
|
+
groups,
|
|
202
|
+
collapsed,
|
|
203
|
+
budget,
|
|
204
|
+
query: result.query,
|
|
205
|
+
opts,
|
|
206
|
+
spaced: nameHits.length > 0,
|
|
207
|
+
onToggle: toggleGroup,
|
|
208
|
+
onOpenLine,
|
|
209
|
+
onMore: showMore
|
|
216
210
|
})]
|
|
217
211
|
})
|
|
218
212
|
]
|
|
219
213
|
});
|
|
220
214
|
});
|
|
215
|
+
/** The matching lines grouped by file, the first `budget` rows of them. Memoized: typing doesn't re-render them. */
|
|
216
|
+
const MatchGroups = memo(function MatchGroups({ groups, collapsed, budget, query, opts, spaced, onToggle, onOpenLine, onMore }) {
|
|
217
|
+
const labels = useFilesLabels();
|
|
218
|
+
let left = budget;
|
|
219
|
+
const shown = [];
|
|
220
|
+
for (const [path, lines] of groups) {
|
|
221
|
+
if (left <= 0) break;
|
|
222
|
+
const closed = collapsed.has(path);
|
|
223
|
+
left -= 1;
|
|
224
|
+
const visible = closed ? [] : lines.slice(0, Math.max(0, left));
|
|
225
|
+
left -= visible.length;
|
|
226
|
+
shown.push({
|
|
227
|
+
path,
|
|
228
|
+
lines: visible,
|
|
229
|
+
closed,
|
|
230
|
+
total: lines.reduce((n, l) => n + l.ranges.length, 0)
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
const last = shown[shown.length - 1];
|
|
234
|
+
const truncated = shown.length < groups.length || last !== void 0 && !last.closed && last.lines.length < groups[shown.length - 1][1].length;
|
|
235
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("ul", {
|
|
236
|
+
"aria-label": labels.filesMatchingLines,
|
|
237
|
+
className: `m-0 p-0 list-none flex flex-col ${spaced ? "mt-2" : ""}`,
|
|
238
|
+
children: shown.map(({ path, lines, closed, total }) => /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsxs("button", {
|
|
239
|
+
type: "button",
|
|
240
|
+
"data-result": "",
|
|
241
|
+
"data-size": "sm",
|
|
242
|
+
"aria-expanded": !closed,
|
|
243
|
+
onClick: () => onToggle(path),
|
|
244
|
+
className: "zg-menu-row zg-press-subtle",
|
|
245
|
+
title: path,
|
|
246
|
+
children: [
|
|
247
|
+
/* @__PURE__ */ jsx(TreeChevron, {
|
|
248
|
+
open: !closed,
|
|
249
|
+
className: "text-[var(--zg-text-muted)]"
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ jsx(FileIcon, { path }),
|
|
252
|
+
/* @__PURE__ */ jsx(PathLabel, { path }),
|
|
253
|
+
/* @__PURE__ */ jsx("span", {
|
|
254
|
+
className: "zg-meta shrink-0 tabular-nums",
|
|
255
|
+
children: total
|
|
256
|
+
})
|
|
257
|
+
]
|
|
258
|
+
}), !closed && lines.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
259
|
+
className: "m-0 p-0 list-none flex flex-col",
|
|
260
|
+
children: lines.map((m) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
|
|
261
|
+
type: "button",
|
|
262
|
+
"data-result": "",
|
|
263
|
+
"data-size": "sm",
|
|
264
|
+
onClick: () => onOpenLine(m, query, opts),
|
|
265
|
+
className: "zg-menu-row zg-press-subtle",
|
|
266
|
+
style: { paddingLeft: 30 },
|
|
267
|
+
"aria-label": labels.filesMatchLine(path, m.line, m.text.trim()),
|
|
268
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
269
|
+
className: "zg-meta shrink-0 w-8 text-right tabular-nums",
|
|
270
|
+
children: [m.side === "old" ? "−" : "", m.line]
|
|
271
|
+
}), /* @__PURE__ */ jsx(LineText, { match: m })]
|
|
272
|
+
}) }, `${m.part ?? ""}:${m.side ?? ""}:${m.line}`))
|
|
273
|
+
})] }, path))
|
|
274
|
+
}), truncated && /* @__PURE__ */ jsx(MoreRows, { onNear: onMore }, budget)] });
|
|
275
|
+
});
|
|
276
|
+
/** Asks for the next page once the end of the list comes near. One per page (keyed by it). */
|
|
277
|
+
function MoreRows({ onNear }) {
|
|
278
|
+
const ref = useRef(null);
|
|
279
|
+
const near = useNearViewport(ref, "400px 0px");
|
|
280
|
+
useEffect(() => {
|
|
281
|
+
if (near) onNear();
|
|
282
|
+
}, [near, onNear]);
|
|
283
|
+
return /* @__PURE__ */ jsx("div", {
|
|
284
|
+
ref,
|
|
285
|
+
"aria-hidden": true,
|
|
286
|
+
className: "h-px"
|
|
287
|
+
});
|
|
288
|
+
}
|
|
221
289
|
function PathLabel({ path }) {
|
|
222
290
|
const { dir, base } = splitPath(path);
|
|
223
291
|
return /* @__PURE__ */ jsxs("span", {
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import { matchRanges } from "./search.js";
|
|
2
1
|
//#region src/files/headless/name-match.ts
|
|
3
2
|
function basename(path) {
|
|
4
3
|
const trimmed = path.replace(/[/\\]+$/, "");
|
|
5
4
|
return trimmed.slice(Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\")) + 1);
|
|
6
5
|
}
|
|
6
|
+
/** Per list of paths: its names split and lowercased once, not on every keystroke. */
|
|
7
|
+
const indexes = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
function indexOf(paths) {
|
|
9
|
+
let index = indexes.get(paths);
|
|
10
|
+
if (!index) {
|
|
11
|
+
const bases = paths.map(basename);
|
|
12
|
+
index = {
|
|
13
|
+
bases,
|
|
14
|
+
lowerBases: bases.map((b) => b.toLowerCase()),
|
|
15
|
+
lowerPaths: paths.map((p) => p.toLowerCase())
|
|
16
|
+
};
|
|
17
|
+
indexes.set(paths, index);
|
|
18
|
+
}
|
|
19
|
+
return index;
|
|
20
|
+
}
|
|
7
21
|
/**
|
|
8
22
|
* The paths whose file name (or, ranked after, folders) contain `query`, best first, at most `limit`.
|
|
9
23
|
*
|
|
@@ -14,20 +28,21 @@ function basename(path) {
|
|
|
14
28
|
*/
|
|
15
29
|
function nameMatches(paths, query, opts, limit = 50) {
|
|
16
30
|
if (!query) return [];
|
|
31
|
+
const index = indexOf(paths);
|
|
32
|
+
const needle = opts.caseSensitive ? query : query.toLowerCase();
|
|
33
|
+
const bases = opts.caseSensitive ? index.bases : index.lowerBases;
|
|
34
|
+
const full = opts.caseSensitive ? paths : index.lowerPaths;
|
|
17
35
|
const scored = [];
|
|
18
|
-
for (
|
|
19
|
-
const base =
|
|
20
|
-
const inBase =
|
|
21
|
-
if (inBase) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
if (matchRanges(path, query, opts).length > 0) scored.push({
|
|
30
|
-
path,
|
|
36
|
+
for (let i = 0; i < paths.length; i++) {
|
|
37
|
+
const base = bases[i];
|
|
38
|
+
const inBase = base.indexOf(needle);
|
|
39
|
+
if (inBase !== -1) scored.push({
|
|
40
|
+
path: paths[i],
|
|
41
|
+
rank: inBase,
|
|
42
|
+
base: base.length
|
|
43
|
+
});
|
|
44
|
+
else if (full[i].includes(needle)) scored.push({
|
|
45
|
+
path: paths[i],
|
|
31
46
|
rank: 1e4,
|
|
32
47
|
base: base.length
|
|
33
48
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useOptionalConfirm } from "../app/useConfirm.js";
|
|
2
1
|
import { droppedItems, entryRefusalText, inFolder, nameOf, parentOf, topLevelPaths } from "./headless/entries.js";
|
|
2
|
+
import { useOptionalConfirm } from "../app/useConfirm.js";
|
|
3
3
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
4
|
//#region src/files/useEntryActions.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFilesHost } from "./FilesProvider.js";
|
|
2
1
|
import { isUnder, movedPath } from "./headless/entries.js";
|
|
2
|
+
import { useFilesHost } from "./FilesProvider.js";
|
|
3
3
|
import { filesRootOf } from "./headless/view.js";
|
|
4
4
|
import { folderBuffers } from "./drafts-store.js";
|
|
5
5
|
import { editedPath, sameFile, statusDelta } from "./headless/workspace-diff.js";
|
package/dist/git/WherePicker.js
CHANGED
|
@@ -201,9 +201,9 @@ function WhereMenu(props) {
|
|
|
201
201
|
})] }),
|
|
202
202
|
description: descriptor.available ? descriptor.description : descriptor.reason,
|
|
203
203
|
onClick: () => {
|
|
204
|
-
onChange({
|
|
204
|
+
onChange(active && props.draft?.kind === descriptor.kind ? props.draft : {
|
|
205
205
|
kind: descriptor.kind,
|
|
206
|
-
branch:
|
|
206
|
+
branch: ""
|
|
207
207
|
});
|
|
208
208
|
if (descriptor.takesBranch) requestAnimationFrame(() => branchRef.current?.focus());
|
|
209
209
|
else close();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvironmentDescriptor, EnvironmentRequest } from "zidane/chat";
|
|
1
|
+
import { EnvironmentCheckout, EnvironmentDescriptor, EnvironmentRequest } from "zidane/chat";
|
|
2
2
|
//#region src/git/headless/environment.d.ts
|
|
3
3
|
/** What the user picked in a draft; `null` where it is used = the configured default. */
|
|
4
4
|
interface DraftEnvironment {
|
|
@@ -6,6 +6,11 @@ interface DraftEnvironment {
|
|
|
6
6
|
kind: string;
|
|
7
7
|
/** Typed branch; empty = the suggested one. */
|
|
8
8
|
branch: string;
|
|
9
|
+
/**
|
|
10
|
+
* Work on `branch` as it is (a pull request's or a ticket's branch) rather than cutting it: set by a panel's
|
|
11
|
+
* "Open in worktree". Picking another environment or typing a branch drops it.
|
|
12
|
+
*/
|
|
13
|
+
checkout?: EnvironmentCheckout;
|
|
9
14
|
}
|
|
10
15
|
/** A machine shared with the draft's host, as an environment descriptor names it. */
|
|
11
16
|
type EnvironmentMachine = NonNullable<EnvironmentDescriptor['machine']>;
|
|
@@ -51,11 +51,14 @@ function resolveDraftDescriptor(descriptors, draft) {
|
|
|
51
51
|
function resolveDraftEnvironment(descriptors, draft) {
|
|
52
52
|
const descriptor = resolveDraftDescriptor(descriptors, draft);
|
|
53
53
|
if (!descriptor || descriptor.kind === "local") return;
|
|
54
|
-
const
|
|
54
|
+
const picked = draft?.kind === descriptor.kind ? draft : null;
|
|
55
|
+
const typed = picked ? picked.branch.trim() : "";
|
|
55
56
|
const branch = descriptor.takesBranch ? typed || descriptor.suggestedBranch : void 0;
|
|
57
|
+
const checkout = descriptor.takesBranch && typed && picked?.checkout ? picked.checkout : void 0;
|
|
56
58
|
return {
|
|
57
59
|
kind: descriptor.kind,
|
|
58
|
-
...branch ? { branch } : {}
|
|
60
|
+
...branch ? { branch } : {},
|
|
61
|
+
...checkout ? { checkout } : {}
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
/**
|
|
@@ -5,6 +5,8 @@ type Checks = NonNullable<GitPullRequest['checks']>;
|
|
|
5
5
|
declare const DEFAULT_GIT_LABELS: {
|
|
6
6
|
/** A host call the host cannot make here. */
|
|
7
7
|
gitUnavailable: string;
|
|
8
|
+
gitStartNoWorktree: string;
|
|
9
|
+
gitStartCheckedOutElsewhere: (path: string) => string;
|
|
8
10
|
gitBranchButton: (branch: string) => string;
|
|
9
11
|
gitBranchDetached: (commit: string) => string;
|
|
10
12
|
gitBranchSwitch: string;
|
|
@@ -9,6 +9,8 @@ const plural = (n, one) => `${n} ${one}${n === 1 ? "" : "s"}`;
|
|
|
9
9
|
const DEFAULT_GIT_LABELS = {
|
|
10
10
|
/** A host call the host cannot make here. */
|
|
11
11
|
gitUnavailable: "Not available here.",
|
|
12
|
+
gitStartNoWorktree: "Worktrees are not available for this folder.",
|
|
13
|
+
gitStartCheckedOutElsewhere: (path) => `That branch is checked out in ${path}. Open it in a worktree instead.`,
|
|
12
14
|
gitBranchButton: (branch) => `Branch ${branch}`,
|
|
13
15
|
gitBranchDetached: (commit) => `Detached at ${commit}`,
|
|
14
16
|
gitBranchSwitch: "Switch branch",
|
package/dist/git/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ import { GIT_BAR_ITEM, SyncChip, SyncChipProps } from "./SyncChip.js";
|
|
|
8
8
|
import { WhereMenu, WhereMenuProps, WherePicker, WherePickerProps } from "./WherePicker.js";
|
|
9
9
|
import { GitBarState, useGitBar } from "./useGitBar.js";
|
|
10
10
|
import { useEnvironmentChoices } from "./useEnvironmentChoices.js";
|
|
11
|
-
|
|
11
|
+
import { StartFromPanelDraft, StartFromPanelResult, useStartFromPanel } from "./useStartFromPanel.js";
|
|
12
|
+
export { BranchMenu, BranchMenuProps, BranchMenuWorktree, GIT_BAR_ITEM, GitBar, GitBarBranchMenuProps, GitBarProps, GitBarState, GitProvider, GitProviderProps, ImportRepoDialog, ImportRepoDialogProps, ImportRepoTarget, MoveSessionDialog, MoveSessionDialogProps, RemoteFolderBrowser, RemoteFolderBrowserProps, RemoteFolderPicker, RemoteFolderPickerProps, StartFromPanelDraft, StartFromPanelResult, SyncChip, SyncChipProps, WhereMenu, WhereMenuProps, WherePicker, WherePickerProps, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel };
|
package/dist/git/index.js
CHANGED
|
@@ -8,4 +8,5 @@ import { useGitBar } from "./useGitBar.js";
|
|
|
8
8
|
import { GitBar } from "./GitBar.js";
|
|
9
9
|
import { MoveSessionDialog, useMoveSession } from "./MoveSessionDialog.js";
|
|
10
10
|
import { WhereMenu, WherePicker } from "./WherePicker.js";
|
|
11
|
-
|
|
11
|
+
import { useStartFromPanel } from "./useStartFromPanel.js";
|
|
12
|
+
export { BranchMenu, GIT_BAR_ITEM, GitBar, GitProvider, ImportRepoDialog, MoveSessionDialog, RemoteFolderBrowser, RemoteFolderPicker, SyncChip, WhereMenu, WherePicker, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DraftTarget } from "../chat/composer/use-draft-target.js";
|
|
2
|
+
import { PanelStartSession } from "zidane/chat/pure";
|
|
3
|
+
//#region src/git/useStartFromPanel.d.ts
|
|
4
|
+
/** What a start answered: done, or why not in words. */
|
|
5
|
+
type StartFromPanelResult = {
|
|
6
|
+
ok: true;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
/** The draft a start sets up. */
|
|
12
|
+
type StartFromPanelDraft = Pick<DraftTarget, 'environment' | 'setEnvironment' | 'environmentChoices'>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the start for `cwd`'s draft: it sets the draft's environment, switches the folder when asked, replaces
|
|
15
|
+
* the composer's text with the row's prompt and focuses it.
|
|
16
|
+
*
|
|
17
|
+
* @param draft - The new-chat draft on screen.
|
|
18
|
+
* @param cwd - The folder the panel is for.
|
|
19
|
+
*/
|
|
20
|
+
declare function useStartFromPanel(draft: StartFromPanelDraft, cwd: string): (start: PanelStartSession) => Promise<StartFromPanelResult>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { StartFromPanelDraft, StartFromPanelResult, useStartFromPanel };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { gitErrorText } from "./headless/labels.js";
|
|
2
|
+
import { useGitHost, useGitLabels } from "./GitProvider.js";
|
|
3
|
+
import { focusComposer, pushComposerDraft } from "../chat/composer/composer-bus.js";
|
|
4
|
+
import { useCallback } from "react";
|
|
5
|
+
import { parseMachineKind } from "zidane/chat/pure";
|
|
6
|
+
//#region src/git/useStartFromPanel.ts
|
|
7
|
+
/**
|
|
8
|
+
* A panel row's "start a session" (`PanelStartSession`: a pull request's or a ticket's Open in worktree, Switch
|
|
9
|
+
* to branch, Open here) on the new-chat draft on screen: the draft's environment and the composer's text. Nothing
|
|
10
|
+
* is sent: the user reviews the prompt and sends it.
|
|
11
|
+
*
|
|
12
|
+
* - `worktree`: the draft runs in a worktree on the row's branch, checked out as it is
|
|
13
|
+
* (`DraftEnvironment.checkout`): the local branch, `origin`'s, else the pull request's head.
|
|
14
|
+
* - `here`: the folder switches to the pull request or branch first (`GitHost.checkout`, never forced: git's
|
|
15
|
+
* refusal comes back as the result), and the draft runs in the folder itself.
|
|
16
|
+
*/
|
|
17
|
+
const isWorktreeKind = (kind) => kind === "worktree" || parseMachineKind(kind)?.base === "worktree";
|
|
18
|
+
const isLocalKind = (kind) => kind === "local" || parseMachineKind(kind)?.base === "local";
|
|
19
|
+
/**
|
|
20
|
+
* The worktree kind to start in: the draft's own when it is one (a machine's), else this computer's. `null`: none
|
|
21
|
+
* offered or available.
|
|
22
|
+
*/
|
|
23
|
+
function worktreeKind(draft) {
|
|
24
|
+
const choices = draft.environmentChoices.filter((d) => d.available && isWorktreeKind(d.kind));
|
|
25
|
+
return ((draft.environment && choices.find((d) => d.kind === draft.environment.kind)) ?? choices.find((d) => d.kind === "worktree") ?? null)?.kind ?? null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns the start for `cwd`'s draft: it sets the draft's environment, switches the folder when asked, replaces
|
|
29
|
+
* the composer's text with the row's prompt and focuses it.
|
|
30
|
+
*
|
|
31
|
+
* @param draft - The new-chat draft on screen.
|
|
32
|
+
* @param cwd - The folder the panel is for.
|
|
33
|
+
*/
|
|
34
|
+
function useStartFromPanel(draft, cwd) {
|
|
35
|
+
const git = useGitHost();
|
|
36
|
+
const labels = useGitLabels();
|
|
37
|
+
const { environment, environmentChoices, setEnvironment } = draft;
|
|
38
|
+
return useCallback(async (start) => {
|
|
39
|
+
if (start.where === "worktree") {
|
|
40
|
+
const kind = worktreeKind({
|
|
41
|
+
environment,
|
|
42
|
+
environmentChoices,
|
|
43
|
+
setEnvironment
|
|
44
|
+
});
|
|
45
|
+
if (!kind) return {
|
|
46
|
+
ok: false,
|
|
47
|
+
message: labels.gitStartNoWorktree
|
|
48
|
+
};
|
|
49
|
+
const branch = start.branch ?? (start.pullRequest ? `pr-${start.pullRequest}` : "");
|
|
50
|
+
const pick = {
|
|
51
|
+
kind,
|
|
52
|
+
branch,
|
|
53
|
+
...branch ? { checkout: start.pullRequest ? { pullRequest: start.pullRequest } : {} } : {}
|
|
54
|
+
};
|
|
55
|
+
setEnvironment(pick);
|
|
56
|
+
} else {
|
|
57
|
+
const target = start.pullRequest ? { pullRequest: start.pullRequest } : start.branch ? { branch: start.branch } : null;
|
|
58
|
+
if (target) {
|
|
59
|
+
if (!git?.checkout) return {
|
|
60
|
+
ok: false,
|
|
61
|
+
message: labels.gitUnavailable
|
|
62
|
+
};
|
|
63
|
+
const result = await git.checkout(cwd, target);
|
|
64
|
+
if (!result.ok) return {
|
|
65
|
+
ok: false,
|
|
66
|
+
message: result.worktree ? labels.gitStartCheckedOutElsewhere(result.worktree.path) : gitErrorText(result.error, labels)
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const local = environmentChoices.find((d) => d.available && d.kind === "local") ?? environmentChoices.find((d) => d.available && isLocalKind(d.kind));
|
|
70
|
+
setEnvironment(local ? {
|
|
71
|
+
kind: local.kind,
|
|
72
|
+
branch: ""
|
|
73
|
+
} : null);
|
|
74
|
+
}
|
|
75
|
+
pushComposerDraft({
|
|
76
|
+
text: start.prompt ?? "",
|
|
77
|
+
attachments: []
|
|
78
|
+
});
|
|
79
|
+
focusComposer();
|
|
80
|
+
return { ok: true };
|
|
81
|
+
}, [
|
|
82
|
+
git,
|
|
83
|
+
labels,
|
|
84
|
+
cwd,
|
|
85
|
+
environment,
|
|
86
|
+
environmentChoices,
|
|
87
|
+
setEnvironment
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { useStartFromPanel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { createKeyCommandRegistry } from "./headless/commands.js";
|
|
1
2
|
import { getMergedKeybindings } from "./headless/overrides.js";
|
|
2
3
|
import { loadOnce } from "./load-once.js";
|
|
3
4
|
import { bindKeyListeners, useKeybindingsHost } from "./KeybindingsProvider.js";
|
|
4
|
-
import { createKeyCommandRegistry } from "./headless/commands.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { createContext, useContext, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
7
7
|
//#region src/keybindings/KeyCommands.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LabelsProvider } from "../labels.js";
|
|
2
2
|
import { DEFAULT_KEYBINDINGS, KEYBINDING_DEF_BY_ACTION } from "./headless/catalog.js";
|
|
3
|
-
import { bindingAllowedIn, keyScopeOf } from "./headless/key-scope.js";
|
|
4
3
|
import { getMergedKeybindings } from "./headless/overrides.js";
|
|
4
|
+
import { bindingAllowedIn, keyScopeOf } from "./headless/key-scope.js";
|
|
5
5
|
import { loadOnce } from "./load-once.js";
|
|
6
6
|
import { matchesBinding } from "./match.js";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -33,8 +33,8 @@ const KEYBINDING_DEFS = [
|
|
|
33
33
|
{
|
|
34
34
|
action: "openTodos",
|
|
35
35
|
default: "ctrl+t",
|
|
36
|
-
label: "
|
|
37
|
-
description: "open the
|
|
36
|
+
label: "plan",
|
|
37
|
+
description: "open the Inbox: what waits on you, the plan in progress and the recent ones"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
action: "openArtifacts",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_KEYBINDINGS, KEYBINDING_DEFS, KEYBINDING_DEF_BY_ACTION, bindingAlternatives, parseBindingSpec, parseBindingSpecs } from "./catalog.js";
|
|
2
|
-
import { KEYSCOPE_ATTR, bindingAllowedIn, isTypingFocused, isTypingTarget, keyScopeOf } from "./key-scope.js";
|
|
3
|
-
import { createKeybindingOverrides, filterOverrides, getMergedKeybindings } from "./overrides.js";
|
|
4
2
|
import { createKeyCommandRegistry } from "./commands.js";
|
|
3
|
+
import { createKeybindingOverrides, filterOverrides, getMergedKeybindings } from "./overrides.js";
|
|
4
|
+
import { KEYSCOPE_ATTR, bindingAllowedIn, isTypingFocused, isTypingTarget, keyScopeOf } from "./key-scope.js";
|
|
5
5
|
import { DEFAULT_KEYBINDINGS_LABELS } from "./labels.js";
|
|
6
6
|
export { DEFAULT_KEYBINDINGS, DEFAULT_KEYBINDINGS_LABELS, KEYBINDING_DEFS, KEYBINDING_DEF_BY_ACTION, KEYSCOPE_ATTR, bindingAllowedIn, bindingAlternatives, createKeyCommandRegistry, createKeybindingOverrides, filterOverrides, getMergedKeybindings, isTypingFocused, isTypingTarget, keyScopeOf, parseBindingSpec, parseBindingSpecs };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { writable } from "../../chat/headless/store.js";
|
|
2
1
|
import { DEFAULT_KEYBINDINGS } from "./catalog.js";
|
|
2
|
+
import { writable } from "../../chat/headless/store.js";
|
|
3
3
|
//#region src/keybindings/headless/overrides.ts
|
|
4
4
|
/**
|
|
5
5
|
* The overrides model every `KeybindingsHost` shares: read the stored map,
|
|
@@ -2,8 +2,8 @@ import { BTN_SECONDARY } from "../components/button.js";
|
|
|
2
2
|
import { Checkbox, OpLine, SegmentedRow } from "../components/Form.js";
|
|
3
3
|
import { constant, useReadable } from "../chat/headless/store.js";
|
|
4
4
|
import { machinesError } from "./headless/host.js";
|
|
5
|
-
import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
6
5
|
import { shortList, syncBlockedReason } from "./headless/sync.js";
|
|
6
|
+
import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
7
7
|
import { useHostCapabilities } from "./HostCapabilities.js";
|
|
8
8
|
import { SyncAccounts } from "./SyncAccounts.js";
|
|
9
9
|
import { SyncOutcomeBadge } from "./SyncOutcomeBadge.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tooltip } from "../components/Tooltip.js";
|
|
2
2
|
import { MetaChip } from "../components/Form.js";
|
|
3
|
-
import { useMachinesLabels } from "./MachinesProvider.js";
|
|
4
3
|
import { syncOutcome } from "./headless/sync.js";
|
|
4
|
+
import { useMachinesLabels } from "./MachinesProvider.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/machines/SyncOutcomeBadge.tsx
|
|
7
7
|
const MAX_LINES = 12;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isMachinesError, isPermitted, machinesError } from "./host.js";
|
|
2
|
-
import { DEFAULT_MACHINES_LABELS } from "./labels.js";
|
|
3
2
|
import { createPresenceStore } from "./presence.js";
|
|
4
3
|
import { createMachineLists, createOnlineMachines, lazyReadable } from "./stores.js";
|
|
5
4
|
import { createHostSyncReads, shortList, syncBlockedReason, syncOutcome } from "./sync.js";
|
|
5
|
+
import { DEFAULT_MACHINES_LABELS } from "./labels.js";
|
|
6
6
|
import { UPDATE_BUSY_STATES, agoText, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostStatusText, hostStatusTone, linkStateText, updateStateLine, uptimeText } from "./messages.js";
|
|
7
7
|
import { hostOfSettingsFocus, hostSettingsFocus } from "./settings-focus.js";
|
|
8
8
|
export { DEFAULT_MACHINES_LABELS, UPDATE_BUSY_STATES, agoText, createHostSyncReads, createMachineLists, createOnlineMachines, createPresenceStore, daemonStatusText, hostCheckMessage, hostCheckOkLine, hostOfSettingsFocus, hostSettingsFocus, hostStatusText, hostStatusTone, isMachinesError, isPermitted, lazyReadable, linkStateText, machinesError, shortList, syncBlockedReason, syncOutcome, updateStateLine, uptimeText };
|
|
@@ -37,6 +37,10 @@ declare function UsageDemo({ on, className, style }: UsageDemoProps): import("re
|
|
|
37
37
|
type DaemonDemoProps = DemoProps;
|
|
38
38
|
/** Background service: two windows share one running session through the link between them. */
|
|
39
39
|
declare function DaemonDemo({ on, className, style }: DaemonDemoProps): import("react").JSX.Element;
|
|
40
|
+
/** Props of {@link RemindersDemo}. */
|
|
41
|
+
type RemindersDemoProps = DemoProps;
|
|
42
|
+
/** Reminders: you type `/remind`, its chip counts down to now, and the reminder lands in the session. */
|
|
43
|
+
declare function RemindersDemo({ on, className, style }: RemindersDemoProps): import("react").JSX.Element;
|
|
40
44
|
/** Props of {@link BrowserDemo}. */
|
|
41
45
|
type BrowserDemoProps = DemoProps;
|
|
42
46
|
/** Browser tab: a page at localhost:5173, and the agent's pointer that clicks its button. */
|
|
@@ -53,6 +57,10 @@ declare function NotificationsDemo({ on, className, style }: NotificationsDemoPr
|
|
|
53
57
|
type ProjectExtensionsDemoProps = DemoProps;
|
|
54
58
|
/** Project extensions: the .zidane/extensions folder of a project, behind a trust lock. */
|
|
55
59
|
declare function ProjectExtensionsDemo({ on, className, style }: ProjectExtensionsDemoProps): import("react").JSX.Element;
|
|
60
|
+
/** Props of {@link SecretsDemo}. */
|
|
61
|
+
type SecretsDemoProps = DemoProps;
|
|
62
|
+
/** Secrets: the agent asks for a key in a password field, and the transcript says it was saved, never the value. */
|
|
63
|
+
declare function SecretsDemo({ on, className, style }: SecretsDemoProps): import("react").JSX.Element;
|
|
56
64
|
/**
|
|
57
65
|
* Whether a feature has a demo.
|
|
58
66
|
*
|
|
@@ -71,4 +79,4 @@ interface FeatureDemoProps extends DemoProps {
|
|
|
71
79
|
*/
|
|
72
80
|
declare function FeatureDemo({ feature, on, className, style }: FeatureDemoProps): import("react").JSX.Element | null;
|
|
73
81
|
//#endregion
|
|
74
|
-
export { AutoTitleDemo, AutoTitleDemoProps, AutocompleteDemo, AutocompleteDemoProps, BrowserDemo, BrowserDemoProps, CodemodeDemo, CodemodeDemoProps, DaemonDemo, DaemonDemoProps, FeatureDemo, FeatureDemoProps, NotificationsDemo, NotificationsDemoProps, ProjectExtensionsDemo, ProjectExtensionsDemoProps, RunEstimatesDemo, RunEstimatesDemoProps, SpacesDemo, SpacesDemoProps, TerminalDemo, TerminalDemoProps, UpdatesDemo, UpdatesDemoProps, UsageDemo, UsageDemoProps, WebSearchDemo, WebSearchDemoProps, hasFeatureDemo };
|
|
82
|
+
export { AutoTitleDemo, AutoTitleDemoProps, AutocompleteDemo, AutocompleteDemoProps, BrowserDemo, BrowserDemoProps, CodemodeDemo, CodemodeDemoProps, DaemonDemo, DaemonDemoProps, FeatureDemo, FeatureDemoProps, NotificationsDemo, NotificationsDemoProps, ProjectExtensionsDemo, ProjectExtensionsDemoProps, RemindersDemo, RemindersDemoProps, RunEstimatesDemo, RunEstimatesDemoProps, SecretsDemo, SecretsDemoProps, SpacesDemo, SpacesDemoProps, TerminalDemo, TerminalDemoProps, UpdatesDemo, UpdatesDemoProps, UsageDemo, UsageDemoProps, WebSearchDemo, WebSearchDemoProps, hasFeatureDemo };
|