@tangle-network/agent-app 0.53.2 → 0.53.4
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/assistant/AssistantDock.d.ts +7 -5
- package/dist/assistant/index.d.ts +2 -1
- package/dist/assistant/index.js +91 -42
- package/dist/assistant/index.js.map +1 -1
- package/dist/assistant/launcher.d.ts +29 -7
- package/dist/assistant/page-context.d.ts +2 -1
- package/dist/assistant/usePanelPrefs.d.ts +33 -11
- package/dist/chat-react/index.js +3 -2
- package/dist/chunk-6FYFGQ6I.js +48 -0
- package/dist/chunk-6FYFGQ6I.js.map +1 -0
- package/dist/{chunk-EV5UI4VH.js → chunk-7HMDNSIA.js} +154 -65
- package/dist/chunk-7HMDNSIA.js.map +1 -0
- package/dist/{chunk-2LPNGZFG.js → chunk-BINC6OWR.js} +183 -152
- package/dist/chunk-BINC6OWR.js.map +1 -0
- package/dist/{chunk-CIYMRDAM.js → chunk-IYK5BRL4.js} +6 -2
- package/dist/chunk-IYK5BRL4.js.map +1 -0
- package/dist/{chunk-FRABQIQ4.js → chunk-NH32EPWU.js} +2 -2
- package/dist/chunk-ODP3X4BN.js +114 -0
- package/dist/chunk-ODP3X4BN.js.map +1 -0
- package/dist/{mention-editor-YPKFP2LF.js → mention-editor-E6J2RUG4.js} +2 -2
- package/dist/studio-react/index.js +2 -2
- package/dist/web-react/agent-profile-choices.d.ts +6 -0
- package/dist/web-react/agent-session-controls.d.ts +6 -1
- package/dist/web-react/agent-settings-popover.d.ts +15 -0
- package/dist/web-react/index.d.ts +3 -0
- package/dist/web-react/index.js +13 -4
- package/dist/web-react/popover-dialog.d.ts +13 -0
- package/dist/web-react/workspace-switcher.d.ts +24 -0
- package/dist/workspace-react/index.d.ts +1 -0
- package/dist/workspace-react/index.js +8 -0
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2LPNGZFG.js.map +0 -1
- package/dist/chunk-CIYMRDAM.js.map +0 -1
- package/dist/chunk-EV5UI4VH.js.map +0 -1
- /package/dist/{chunk-FRABQIQ4.js.map → chunk-NH32EPWU.js.map} +0 -0
- /package/dist/{mention-editor-YPKFP2LF.js.map → mention-editor-E6J2RUG4.js.map} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The assistant's place in the app shell: a right-side panel that mirrors the
|
|
3
3
|
* left sidebar. A panel toggle opens and closes it (top right while closed,
|
|
4
|
-
* the header's inner edge while open) and ⌘E / Ctrl+E does the same.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* the header's inner edge while open) and ⌘E / Ctrl+E does the same. Wherever
|
|
5
|
+
* the page keeps a usable column beside it (the launcher's `reservedWidth` and
|
|
6
|
+
* `dockMediaQuery` say what the host's chrome takes), the panel docks beside
|
|
7
|
+
* the page: it is non-modal, resizable, and the launcher's `inset` tells the
|
|
8
|
+
* shell how far to pad its page column so the panel never covers page content.
|
|
9
|
+
* Where it would not fit, it opens as a modal sheet, full screen on phones.
|
|
10
|
+
* Width and open state persist per user.
|
|
9
11
|
*
|
|
10
12
|
* The dock owns the chat state (via useAssistantChat) so the conversation
|
|
11
13
|
* survives the panel closing. Host-shell concerns (the user, navigation,
|
|
@@ -18,6 +18,7 @@ export { AssistantDock, type AssistantDockProps } from "./AssistantDock";
|
|
|
18
18
|
export { AssistantPanel, type AssistantPanelProps } from "./AssistantPanel";
|
|
19
19
|
export { AssistantTranscript, type AssistantTranscriptProps, type AssistantTimelineOptions, buildAssistantTimeline, assistantIsThinking, } from "./transcript";
|
|
20
20
|
export { ProposalCard, type ProposalCardProps } from "./ProposalCard";
|
|
21
|
-
export { AssistantLauncherProvider, useAssistantLauncher, type AssistantLauncher, type AssistantPanelLayout, } from "./launcher";
|
|
21
|
+
export { AssistantLauncherProvider, useAssistantLauncher, useAssistantPageLabel, type AssistantLauncher, type AssistantPanelLayout, } from "./launcher";
|
|
22
|
+
export { MIN_PAGE_WIDTH, MIN_PANEL_WIDTH } from "./usePanelPrefs";
|
|
22
23
|
export { useDocumentPageContext, pageLabelFromTitle, type DocumentPageContextOptions, } from "./page-context";
|
|
23
24
|
export { AssistantPanelToggle, type AssistantPanelToggleProps, ASSISTANT_PANEL_ID, assistantShortcutLabel, } from "./panel-toggle";
|
package/dist/assistant/index.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
chatToolCallPart
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BINC6OWR.js";
|
|
4
|
+
import "../chunk-NH32EPWU.js";
|
|
5
5
|
import "../chunk-3HUFJ5LO.js";
|
|
6
6
|
import "../chunk-FBVLEGEG.js";
|
|
7
|
+
import "../chunk-ODP3X4BN.js";
|
|
7
8
|
import "../chunk-E4AY62T2.js";
|
|
8
9
|
import "../chunk-ENLRJYVW.js";
|
|
9
10
|
import "../chunk-GEYACSFW.js";
|
|
10
11
|
import {
|
|
11
12
|
ChatComposer
|
|
12
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-7HMDNSIA.js";
|
|
13
14
|
import "../chunk-L7MB2LLM.js";
|
|
15
|
+
import "../chunk-6FYFGQ6I.js";
|
|
14
16
|
import {
|
|
15
17
|
ModelPicker
|
|
16
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-IYK5BRL4.js";
|
|
17
19
|
import "../chunk-SJWIZT7B.js";
|
|
18
20
|
import "../chunk-MLG6XKPV.js";
|
|
19
21
|
import {
|
|
@@ -1923,8 +1925,17 @@ import { useCallback as useCallback3, useEffect as useEffect4, useRef as useRef3
|
|
|
1923
1925
|
var MIN_PANEL_WIDTH = 360;
|
|
1924
1926
|
var DEFAULT_PANEL_WIDTH = 480;
|
|
1925
1927
|
var MAX_PANEL_WIDTH = 800;
|
|
1926
|
-
var
|
|
1927
|
-
var
|
|
1928
|
+
var SHEET_MAX_WIDTH_FRACTION = 0.5;
|
|
1929
|
+
var MIN_PAGE_WIDTH = 400;
|
|
1930
|
+
var DEFAULT_RESERVED_WIDTH = 256;
|
|
1931
|
+
var DOCKED_MEDIA_QUERY = "(min-width: 64rem)";
|
|
1932
|
+
function canDock(viewportWidth, reservedWidth, hostAllows) {
|
|
1933
|
+
return hostAllows && viewportWidth - reservedWidth - MIN_PANEL_WIDTH >= MIN_PAGE_WIDTH;
|
|
1934
|
+
}
|
|
1935
|
+
var DEFAULT_GEOMETRY = {
|
|
1936
|
+
reservedWidth: DEFAULT_RESERVED_WIDTH,
|
|
1937
|
+
docked: true
|
|
1938
|
+
};
|
|
1928
1939
|
var LEGACY_WIDTH_KEY = "assistant.panel.width";
|
|
1929
1940
|
function prefsKey(userId) {
|
|
1930
1941
|
return userId ? `assistant:v1:${userId}:panel` : null;
|
|
@@ -1954,26 +1965,24 @@ function writePrefs(userId, next) {
|
|
|
1954
1965
|
} catch {
|
|
1955
1966
|
}
|
|
1956
1967
|
}
|
|
1957
|
-
function maxPanelWidth() {
|
|
1968
|
+
function maxPanelWidth(geometry) {
|
|
1958
1969
|
if (typeof window === "undefined") return MAX_PANEL_WIDTH;
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
Math.min(
|
|
1962
|
-
Math.round(window.innerWidth * MAX_PANEL_WIDTH_FRACTION),
|
|
1963
|
-
MAX_PANEL_WIDTH
|
|
1964
|
-
)
|
|
1965
|
-
);
|
|
1970
|
+
const room = geometry.docked ? window.innerWidth - geometry.reservedWidth - MIN_PAGE_WIDTH : Math.round(window.innerWidth * SHEET_MAX_WIDTH_FRACTION);
|
|
1971
|
+
return Math.max(MIN_PANEL_WIDTH, Math.min(room, MAX_PANEL_WIDTH));
|
|
1966
1972
|
}
|
|
1967
|
-
function clampWidth(value) {
|
|
1973
|
+
function clampWidth(value, geometry) {
|
|
1968
1974
|
return Math.min(
|
|
1969
1975
|
Math.max(Math.round(value), MIN_PANEL_WIDTH),
|
|
1970
|
-
maxPanelWidth()
|
|
1976
|
+
maxPanelWidth(geometry)
|
|
1971
1977
|
);
|
|
1972
1978
|
}
|
|
1973
|
-
function usePanelPrefs(userId) {
|
|
1979
|
+
function usePanelPrefs(userId, geometry = DEFAULT_GEOMETRY) {
|
|
1980
|
+
const { reservedWidth, docked } = geometry;
|
|
1981
|
+
const geometryRef = useRef3(geometry);
|
|
1982
|
+
geometryRef.current = { reservedWidth, docked };
|
|
1974
1983
|
const [storedOpen, setStoredOpen] = useState4(null);
|
|
1975
1984
|
const [width, setWidthState] = useState4(DEFAULT_PANEL_WIDTH);
|
|
1976
|
-
const [maxWidth, setMaxWidth] = useState4(() => maxPanelWidth());
|
|
1985
|
+
const [maxWidth, setMaxWidth] = useState4(() => maxPanelWidth(geometry));
|
|
1977
1986
|
const desiredRef = useRef3(DEFAULT_PANEL_WIDTH);
|
|
1978
1987
|
const userRef = useRef3(userId);
|
|
1979
1988
|
userRef.current = userId;
|
|
@@ -1984,32 +1993,33 @@ function usePanelPrefs(userId) {
|
|
|
1984
1993
|
Math.round(prefs.width ?? DEFAULT_PANEL_WIDTH),
|
|
1985
1994
|
MIN_PANEL_WIDTH
|
|
1986
1995
|
);
|
|
1987
|
-
setMaxWidth(maxPanelWidth());
|
|
1988
|
-
setWidthState(clampWidth(desiredRef.current));
|
|
1996
|
+
setMaxWidth(maxPanelWidth(geometryRef.current));
|
|
1997
|
+
setWidthState(clampWidth(desiredRef.current, geometryRef.current));
|
|
1989
1998
|
}, [userId]);
|
|
1990
1999
|
useEffect4(() => {
|
|
1991
|
-
const
|
|
1992
|
-
setMaxWidth(maxPanelWidth());
|
|
1993
|
-
setWidthState(clampWidth(desiredRef.current));
|
|
2000
|
+
const fit = () => {
|
|
2001
|
+
setMaxWidth(maxPanelWidth(geometryRef.current));
|
|
2002
|
+
setWidthState(clampWidth(desiredRef.current, geometryRef.current));
|
|
1994
2003
|
};
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2004
|
+
fit();
|
|
2005
|
+
window.addEventListener("resize", fit);
|
|
2006
|
+
return () => window.removeEventListener("resize", fit);
|
|
2007
|
+
}, [reservedWidth, docked]);
|
|
1998
2008
|
const persistOpen = useCallback3((open) => {
|
|
1999
2009
|
setStoredOpen(open);
|
|
2000
2010
|
writePrefs(userRef.current, { open });
|
|
2001
2011
|
}, []);
|
|
2002
2012
|
const setWidth = useCallback3((next) => {
|
|
2003
|
-
const clamped = clampWidth(next);
|
|
2013
|
+
const clamped = clampWidth(next, geometryRef.current);
|
|
2004
2014
|
desiredRef.current = clamped;
|
|
2005
2015
|
writePrefs(userRef.current, { width: clamped });
|
|
2006
2016
|
setWidthState(clamped);
|
|
2007
2017
|
}, []);
|
|
2008
2018
|
const previewWidth = useCallback3((next) => {
|
|
2009
|
-
setWidthState(clampWidth(next));
|
|
2019
|
+
setWidthState(clampWidth(next, geometryRef.current));
|
|
2010
2020
|
}, []);
|
|
2011
2021
|
const nudgeWidth = useCallback3((deltaPx) => {
|
|
2012
|
-
const clamped = clampWidth(desiredRef.current + deltaPx);
|
|
2022
|
+
const clamped = clampWidth(desiredRef.current + deltaPx, geometryRef.current);
|
|
2013
2023
|
desiredRef.current = clamped;
|
|
2014
2024
|
writePrefs(userRef.current, { width: clamped });
|
|
2015
2025
|
setWidthState(clamped);
|
|
@@ -2040,19 +2050,36 @@ function useMediaQuery(query, fallback = true) {
|
|
|
2040
2050
|
}, [query]);
|
|
2041
2051
|
return matches;
|
|
2042
2052
|
}
|
|
2053
|
+
function useViewportWidth() {
|
|
2054
|
+
const [width, setWidth] = useState4(
|
|
2055
|
+
() => typeof window === "undefined" ? Number.POSITIVE_INFINITY : window.innerWidth
|
|
2056
|
+
);
|
|
2057
|
+
useEffect4(() => {
|
|
2058
|
+
const update = () => setWidth(window.innerWidth);
|
|
2059
|
+
update();
|
|
2060
|
+
window.addEventListener("resize", update);
|
|
2061
|
+
return () => window.removeEventListener("resize", update);
|
|
2062
|
+
}, []);
|
|
2063
|
+
return width;
|
|
2064
|
+
}
|
|
2043
2065
|
|
|
2044
2066
|
// src/assistant/launcher.tsx
|
|
2045
2067
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2046
2068
|
var AssistantLauncherContext = createContext2(null);
|
|
2047
2069
|
function AssistantLauncherProvider({
|
|
2048
2070
|
userId = null,
|
|
2071
|
+
reservedWidth = DEFAULT_RESERVED_WIDTH,
|
|
2072
|
+
dockMediaQuery = DOCKED_MEDIA_QUERY,
|
|
2049
2073
|
children
|
|
2050
2074
|
}) {
|
|
2051
2075
|
const [open, setOpen] = useState5(false);
|
|
2052
2076
|
const [seed, setSeed] = useState5(null);
|
|
2053
2077
|
const [openedOnLoad, setOpenedOnLoad] = useState5(false);
|
|
2054
|
-
const
|
|
2055
|
-
const
|
|
2078
|
+
const [pageLabel, setPageLabelState] = useState5(null);
|
|
2079
|
+
const hostAllowsDock = useMediaQuery(dockMediaQuery, true);
|
|
2080
|
+
const viewportWidth = useViewportWidth();
|
|
2081
|
+
const docked = canDock(viewportWidth, reservedWidth, hostAllowsDock);
|
|
2082
|
+
const prefs = usePanelPrefs(userId, { reservedWidth, docked });
|
|
2056
2083
|
const layout = docked ? "docked" : "sheet";
|
|
2057
2084
|
const { persistOpen, storedOpen } = prefs;
|
|
2058
2085
|
const restoredFor = useRef4(null);
|
|
@@ -2083,6 +2110,10 @@ function AssistantLauncherProvider({
|
|
|
2083
2110
|
persistOpen(!open);
|
|
2084
2111
|
}, [open, persistOpen]);
|
|
2085
2112
|
const clearSeed = useCallback4(() => setSeed(null), []);
|
|
2113
|
+
const setPageLabel = useCallback4(
|
|
2114
|
+
(update) => setPageLabelState(update),
|
|
2115
|
+
[]
|
|
2116
|
+
);
|
|
2086
2117
|
const { width, maxWidth, setWidth, previewWidth, nudgeWidth } = prefs;
|
|
2087
2118
|
const panel = useMemo2(
|
|
2088
2119
|
() => ({ width, maxWidth, setWidth, previewWidth, nudgeWidth }),
|
|
@@ -2100,7 +2131,9 @@ function AssistantLauncherProvider({
|
|
|
2100
2131
|
layout,
|
|
2101
2132
|
openedOnLoad,
|
|
2102
2133
|
inset,
|
|
2103
|
-
panel
|
|
2134
|
+
panel,
|
|
2135
|
+
pageLabel,
|
|
2136
|
+
setPageLabel
|
|
2104
2137
|
}),
|
|
2105
2138
|
[
|
|
2106
2139
|
open,
|
|
@@ -2112,7 +2145,9 @@ function AssistantLauncherProvider({
|
|
|
2112
2145
|
layout,
|
|
2113
2146
|
openedOnLoad,
|
|
2114
2147
|
inset,
|
|
2115
|
-
panel
|
|
2148
|
+
panel,
|
|
2149
|
+
pageLabel,
|
|
2150
|
+
setPageLabel
|
|
2116
2151
|
]
|
|
2117
2152
|
);
|
|
2118
2153
|
return /* @__PURE__ */ jsx3(AssistantLauncherContext.Provider, { value, children });
|
|
@@ -2129,6 +2164,15 @@ function useAssistantLauncher() {
|
|
|
2129
2164
|
}
|
|
2130
2165
|
return ctx;
|
|
2131
2166
|
}
|
|
2167
|
+
function useAssistantPageLabel(label) {
|
|
2168
|
+
const setPageLabel = useOptionalAssistantLauncher()?.setPageLabel;
|
|
2169
|
+
const trimmed = label?.trim() || null;
|
|
2170
|
+
useEffect5(() => {
|
|
2171
|
+
if (!setPageLabel || !trimmed) return;
|
|
2172
|
+
setPageLabel(() => trimmed);
|
|
2173
|
+
return () => setPageLabel((current) => current === trimmed ? null : current);
|
|
2174
|
+
}, [setPageLabel, trimmed]);
|
|
2175
|
+
}
|
|
2132
2176
|
|
|
2133
2177
|
// src/assistant/panel-toggle.tsx
|
|
2134
2178
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
@@ -2150,6 +2194,7 @@ function AssistantPanelToggle({
|
|
|
2150
2194
|
const open = openOverride ?? launcher?.open ?? false;
|
|
2151
2195
|
const toggleAssistant = onToggle ?? launcher?.toggleAssistant;
|
|
2152
2196
|
const label = open ? "Close assistant" : "Open assistant";
|
|
2197
|
+
const touch = useMediaQuery("(pointer: coarse)", false);
|
|
2153
2198
|
return /* @__PURE__ */ jsx4(
|
|
2154
2199
|
"button",
|
|
2155
2200
|
{
|
|
@@ -2160,7 +2205,7 @@ function AssistantPanelToggle({
|
|
|
2160
2205
|
"aria-expanded": open,
|
|
2161
2206
|
"aria-controls": open && launcher ? ASSISTANT_PANEL_ID : void 0,
|
|
2162
2207
|
"aria-keyshortcuts": "Meta+E Control+E",
|
|
2163
|
-
title: `${label} (${assistantShortcutLabel()})`,
|
|
2208
|
+
title: touch ? label : `${label} (${assistantShortcutLabel()})`,
|
|
2164
2209
|
style,
|
|
2165
2210
|
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-[var(--accent-surface-soft)] hover:text-foreground ${focusRing} ${className ?? ""}`,
|
|
2166
2211
|
children: /* @__PURE__ */ jsx4(PanelRight, { "aria-hidden": "true", className: "h-[18px] w-[18px] shrink-0" })
|
|
@@ -2553,7 +2598,7 @@ function AssistantTranscript({
|
|
|
2553
2598
|
[view, toolRenderers, renderConfirmedResult]
|
|
2554
2599
|
);
|
|
2555
2600
|
if (items.length === 0 && !view.isStreaming) return /* @__PURE__ */ jsx6(Fragment, { children: emptyState });
|
|
2556
|
-
return /* @__PURE__ */ jsx6(AgentTimeline, { items, isThinking: view.isThinking });
|
|
2601
|
+
return /* @__PURE__ */ jsx6(AgentTimeline, { items, isThinking: view.isThinking, className: "px-6" });
|
|
2557
2602
|
}
|
|
2558
2603
|
|
|
2559
2604
|
// src/assistant/use-stick-to-bottom.ts
|
|
@@ -2664,9 +2709,9 @@ function FirstRun({
|
|
|
2664
2709
|
onPick
|
|
2665
2710
|
}) {
|
|
2666
2711
|
const starters = hasPage ? [PAGE_STARTER, ...STARTERS] : STARTERS;
|
|
2667
|
-
return /* @__PURE__ */ jsxs4("div", { className: "px-
|
|
2668
|
-
/* @__PURE__ */ jsx7("h3", { className: "font-semibold text-[var(--font-size-lg)] text-foreground leading-snug", children: "What should the assistant do?" }),
|
|
2669
|
-
/* @__PURE__ */ jsx7("p", { className: "mt-1.5 text-[var(--font-size-base)] text-muted-foreground leading-[1.5]", children: "It creates workflows, checks usage, and manages API keys. Changes wait for your approval." }),
|
|
2712
|
+
return /* @__PURE__ */ jsxs4("div", { className: "px-6 pt-6 pb-4", children: [
|
|
2713
|
+
/* @__PURE__ */ jsx7("h3", { className: "font-semibold text-[length:var(--font-size-lg)] text-foreground leading-snug", children: "What should the assistant do?" }),
|
|
2714
|
+
/* @__PURE__ */ jsx7("p", { className: "mt-1.5 text-[length:var(--font-size-base)] text-muted-foreground leading-[1.5]", children: "It creates workflows, checks usage, and manages API keys. Changes wait for your approval." }),
|
|
2670
2715
|
/* @__PURE__ */ jsx7("ul", { className: "mt-5 flex flex-col gap-2", children: starters.map((starter) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs4(
|
|
2671
2716
|
"button",
|
|
2672
2717
|
{
|
|
@@ -2847,7 +2892,7 @@ function AssistantPanel({
|
|
|
2847
2892
|
layout === "docked" && /* @__PURE__ */ jsx7(AssistantPanelToggle, { open: true, onToggle: onClose, buttonRef: toggleRef }),
|
|
2848
2893
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center", children: [
|
|
2849
2894
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
2850
|
-
/* @__PURE__ */ jsx7("h2", { className: "truncate font-semibold text-[var(--font-size-base)] text-foreground leading-tight", children: "Assistant" }),
|
|
2895
|
+
/* @__PURE__ */ jsx7("h2", { className: "truncate font-semibold text-[length:var(--font-size-base)] text-foreground leading-tight", children: "Assistant" }),
|
|
2851
2896
|
effectiveBalance != null && /* @__PURE__ */ jsx7(
|
|
2852
2897
|
"span",
|
|
2853
2898
|
{
|
|
@@ -3271,7 +3316,7 @@ function AssistantDock({
|
|
|
3271
3316
|
tabIndex: -1,
|
|
3272
3317
|
onKeyDown: trapTab,
|
|
3273
3318
|
style: { width: wideSheet ? `min(${width}px, 100vw)` : "100%" },
|
|
3274
|
-
className:
|
|
3319
|
+
className: `fixed inset-y-0 right-0 z-50 flex flex-col shadow-[var(--shadow-overlay)] focus:outline-none ${wideSheet ? "border-border border-l" : ""}`,
|
|
3275
3320
|
children: panel
|
|
3276
3321
|
}
|
|
3277
3322
|
)
|
|
@@ -3335,12 +3380,13 @@ function useDocumentPageContext({
|
|
|
3335
3380
|
ids
|
|
3336
3381
|
}) {
|
|
3337
3382
|
const title = useDocumentTitle();
|
|
3383
|
+
const pageLabel = useOptionalAssistantLauncher()?.pageLabel ?? null;
|
|
3338
3384
|
return useMemo5(() => {
|
|
3339
|
-
const label = pageLabelFromTitle(title, titleSuffix, ignoreTitles);
|
|
3385
|
+
const label = (pageLabel && pageLabelFromTitle(pageLabel)) ?? pageLabelFromTitle(title, titleSuffix, ignoreTitles);
|
|
3340
3386
|
if (!label) return null;
|
|
3341
3387
|
const pageIds = ids?.(path);
|
|
3342
3388
|
return { label, path, ...pageIds ? { ids: pageIds } : {} };
|
|
3343
|
-
}, [title, path, titleSuffix, ignoreTitles, ids]);
|
|
3389
|
+
}, [pageLabel, title, path, titleSuffix, ignoreTitles, ids]);
|
|
3344
3390
|
}
|
|
3345
3391
|
export {
|
|
3346
3392
|
ASSISTANT_PANEL_ID,
|
|
@@ -3351,6 +3397,8 @@ export {
|
|
|
3351
3397
|
AssistantPanel,
|
|
3352
3398
|
AssistantPanelToggle,
|
|
3353
3399
|
AssistantTranscript,
|
|
3400
|
+
MIN_PAGE_WIDTH,
|
|
3401
|
+
MIN_PANEL_WIDTH,
|
|
3354
3402
|
ProposalCard,
|
|
3355
3403
|
assistantIsThinking,
|
|
3356
3404
|
assistantShortcutLabel,
|
|
@@ -3361,6 +3409,7 @@ export {
|
|
|
3361
3409
|
useAssistantClient,
|
|
3362
3410
|
useAssistantLauncher,
|
|
3363
3411
|
useAssistantModels,
|
|
3412
|
+
useAssistantPageLabel,
|
|
3364
3413
|
useAssistantThreads,
|
|
3365
3414
|
useDocumentPageContext
|
|
3366
3415
|
};
|