@open-slide/core 2.3.2 → 2.4.0

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.
Files changed (85) hide show
  1. package/dist/{build-8lRsgsO4.js → build-D7GwYl8d.js} +1 -1
  2. package/dist/cli/bin.js +4 -4
  3. package/dist/{config-DJ8ZOe7C.d.ts → config-CfhtJxQH.d.ts} +1 -1
  4. package/dist/{config-D2Mq1vSW.js → config-D4uPk_tM.js} +383 -138
  5. package/dist/{dev-BvefEp1Q.js → dev-DyCDMbHB.js} +10 -10
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +9 -1
  8. package/dist/locale/index.d.ts +1 -1
  9. package/dist/locale/index.js +1 -1
  10. package/dist/{preview-D8ognobz.js → preview-DjIFvt0K.js} +1 -1
  11. package/dist/{types-tdaXSyah.d.ts → types-ZfArJF0d.d.ts} +20 -13
  12. package/dist/{update-BivdNgL3.js → update-BKhRM7o4.js} +30 -3
  13. package/dist/vite/index.d.ts +1 -1
  14. package/dist/vite/index.js +1 -1
  15. package/dist/{zh-tw-DXcqQTrA.js → zh-tw-D7LfGVmA.js} +215 -65
  16. package/package.json +4 -5
  17. package/src/agent/provider.ts +8 -1
  18. package/src/agent/types.ts +17 -2
  19. package/src/app/app.tsx +2 -0
  20. package/src/app/components/agent/agent-markdown.tsx +3 -6
  21. package/src/app/components/agent/agent-panel.tsx +36 -258
  22. package/src/app/components/agent/agent-presence.tsx +1 -1
  23. package/src/app/components/agent/composer.tsx +52 -24
  24. package/src/app/components/agent/effort-slider.tsx +172 -0
  25. package/src/app/components/agent/model-menu.tsx +170 -0
  26. package/src/app/components/agent/permission-menu.tsx +88 -0
  27. package/src/app/components/agent/transcript.tsx +23 -31
  28. package/src/app/components/command/home-command-menu.tsx +4 -1
  29. package/src/app/components/command/slide-command-menu.tsx +4 -1
  30. package/src/app/components/export-progress-toast.tsx +3 -1
  31. package/src/app/components/inspector/asset-picker-dialog.tsx +1 -1
  32. package/src/app/components/inspector/comment-layer.tsx +3 -3
  33. package/src/app/components/inspector/inline-text-editor.tsx +1 -12
  34. package/src/app/components/inspector/inspect-overlay.tsx +9 -1
  35. package/src/app/components/inspector/inspector-panel.tsx +8 -35
  36. package/src/app/components/inspector/inspector-provider.tsx +177 -36
  37. package/src/app/components/inspector/page-panel.tsx +270 -0
  38. package/src/app/components/language-toggle.tsx +13 -11
  39. package/src/app/components/note-markdown.test.tsx +12 -6
  40. package/src/app/components/note-markdown.tsx +16 -21
  41. package/src/app/components/overview-grid.tsx +3 -3
  42. package/src/app/components/panel/editor-sidebar.tsx +43 -8
  43. package/src/app/components/panel/panel-shell.tsx +9 -5
  44. package/src/app/components/panel/save-card.tsx +1 -1
  45. package/src/app/components/sidebar/folder-item.tsx +4 -1
  46. package/src/app/components/sidebar/sidebar.tsx +11 -8
  47. package/src/app/components/style-panel/design-provider.tsx +48 -11
  48. package/src/app/components/style-panel/use-design.ts +6 -1
  49. package/src/app/components/theme-toggle.tsx +16 -22
  50. package/src/app/components/thumbnail-rail.tsx +68 -49
  51. package/src/app/components/ui/context-menu.tsx +9 -10
  52. package/src/app/components/ui/dialog.tsx +2 -4
  53. package/src/app/components/ui/dropdown-menu.tsx +9 -10
  54. package/src/app/components/ui/popover.tsx +1 -1
  55. package/src/app/components/ui/select.tsx +2 -2
  56. package/src/app/components/ui/sonner.tsx +2 -2
  57. package/src/app/index.html +7 -0
  58. package/src/app/lib/agent/use-agent.ts +131 -37
  59. package/src/app/lib/desktop-host.ts +31 -0
  60. package/src/app/lib/desktop-routes.test.ts +54 -0
  61. package/src/app/lib/desktop-routes.ts +22 -0
  62. package/src/app/lib/desktop.ts +106 -0
  63. package/src/app/lib/export-pdf.ts +15 -7
  64. package/src/app/lib/inspector/color.ts +51 -0
  65. package/src/app/lib/inspector/fiber.ts +6 -0
  66. package/src/app/lib/inspector/use-editor.ts +2 -1
  67. package/src/app/lib/inspector/use-notes.test.ts +209 -0
  68. package/src/app/lib/inspector/use-notes.ts +331 -57
  69. package/src/app/lib/inspector/use-visual-editor.ts +9 -1
  70. package/src/app/lib/locale-store.ts +14 -2
  71. package/src/app/lib/note-markdown.test.ts +69 -5
  72. package/src/app/lib/note-markdown.ts +97 -22
  73. package/src/app/lib/transition.test.ts +84 -1
  74. package/src/app/lib/transition.ts +43 -0
  75. package/src/app/lib/unsaved.test.ts +253 -0
  76. package/src/app/lib/unsaved.ts +155 -0
  77. package/src/app/routes/home.tsx +1 -1
  78. package/src/app/routes/slide.tsx +114 -117
  79. package/src/app/styles.css +421 -1
  80. package/src/locale/en.ts +40 -15
  81. package/src/locale/es.ts +40 -17
  82. package/src/locale/ja.ts +40 -15
  83. package/src/locale/types.ts +19 -14
  84. package/src/locale/zh-cn.ts +40 -14
  85. package/src/locale/zh-tw.ts +40 -14
@@ -0,0 +1,172 @@
1
+ import { Sparkles, Zap } from 'lucide-react';
2
+ import {
3
+ type CSSProperties,
4
+ type KeyboardEvent,
5
+ type PointerEvent,
6
+ useEffect,
7
+ useRef,
8
+ useState,
9
+ } from 'react';
10
+ import { useLocale } from '@/lib/use-locale';
11
+ import { cn } from '@/lib/utils';
12
+ import type { AgentEffort, AgentProviderId } from '../../../agent/types';
13
+
14
+ export function EffortSlider({
15
+ levels,
16
+ value,
17
+ provider,
18
+ onChange,
19
+ }: {
20
+ levels: AgentEffort[];
21
+ value: AgentEffort | null;
22
+ provider: AgentProviderId;
23
+ onChange: (next: AgentEffort | null) => void;
24
+ }) {
25
+ const t = useLocale();
26
+ const trackRef = useRef<HTMLDivElement | null>(null);
27
+ const [drag, setDrag] = useState<number | null>(null);
28
+ const last = levels.length - 1;
29
+ const index = value ? levels.indexOf(value) : -1;
30
+ const auto = index < 0;
31
+ const settled = auto ? 0.5 : last > 0 ? index / last : 1;
32
+ const progress = drag ?? settled;
33
+ const peak = !auto && index === last && last > 0;
34
+
35
+ const previous = useRef(index);
36
+ const direction = index >= previous.current ? 'up' : 'down';
37
+ useEffect(() => {
38
+ previous.current = index;
39
+ }, [index]);
40
+
41
+ const select = (next: number) => {
42
+ const clamped = Math.max(0, Math.min(last, next));
43
+ if (clamped !== index) onChange(levels[clamped]);
44
+ };
45
+
46
+ const positionAt = (clientX: number) => {
47
+ const rect = trackRef.current?.getBoundingClientRect();
48
+ if (!rect || rect.width <= THUMB) return settled;
49
+ return Math.max(0, Math.min(1, (clientX - rect.left - THUMB / 2) / (rect.width - THUMB)));
50
+ };
51
+
52
+ const onPointerDown = (e: PointerEvent<HTMLDivElement>) => {
53
+ if (e.button !== 0 || drag !== null) return;
54
+ e.preventDefault();
55
+ e.currentTarget.setPointerCapture(e.pointerId);
56
+ e.currentTarget.focus();
57
+ const pos = positionAt(e.clientX);
58
+ setDrag(pos);
59
+ select(Math.round(pos * last));
60
+ };
61
+
62
+ const onPointerMove = (e: PointerEvent<HTMLDivElement>) => {
63
+ if (drag === null) return;
64
+ const pos = positionAt(e.clientX);
65
+ setDrag(pos);
66
+ select(Math.round(pos * last));
67
+ };
68
+
69
+ const endDrag = () => setDrag(null);
70
+
71
+ const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {
72
+ const from = auto ? Math.round(last / 2) : index;
73
+ const step: Record<string, number> = {
74
+ ArrowRight: from + 1,
75
+ ArrowUp: from + 1,
76
+ ArrowLeft: from - 1,
77
+ ArrowDown: from - 1,
78
+ PageUp: last,
79
+ End: last,
80
+ PageDown: 0,
81
+ Home: 0,
82
+ };
83
+ if (!(e.key in step)) return;
84
+ e.preventDefault();
85
+ select(step[e.key]);
86
+ };
87
+
88
+ const label = auto ? t.agent.effortAuto : t.agent.efforts[levels[index]];
89
+
90
+ return (
91
+ <div
92
+ className="effort-slider"
93
+ data-agent-provider={provider}
94
+ data-auto={auto || undefined}
95
+ data-peak={peak || undefined}
96
+ data-dragging={drag !== null || undefined}
97
+ style={{ '--p': progress } as CSSProperties}
98
+ >
99
+ <div className="flex items-center justify-between gap-2">
100
+ <span className="text-[11px] font-medium text-muted-foreground">{t.agent.reasoning}</span>
101
+ <button
102
+ type="button"
103
+ aria-pressed={auto}
104
+ onClick={() => onChange(null)}
105
+ className={cn(
106
+ 'h-5 rounded-full px-2 text-[10.5px] font-medium text-muted-foreground outline-none transition-[background-color,color,transform] duration-150 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30 active:scale-[0.96]',
107
+ auto ? 'bg-foreground text-background hover:text-background' : 'bg-muted',
108
+ )}
109
+ >
110
+ {t.agent.effortAuto}
111
+ </button>
112
+ </div>
113
+
114
+ <div className="mt-1.5 h-5 overflow-hidden">
115
+ <span
116
+ key={label}
117
+ data-direction={direction}
118
+ className="effort-slider-label effort-slider-level block truncate text-[14px] leading-5 font-semibold tracking-tight"
119
+ >
120
+ {label}
121
+ </span>
122
+ </div>
123
+
124
+ <div
125
+ ref={trackRef}
126
+ role="slider"
127
+ tabIndex={0}
128
+ aria-label={t.agent.reasoning}
129
+ aria-valuemin={0}
130
+ aria-valuemax={last}
131
+ aria-valuenow={auto ? Math.round(last / 2) : index}
132
+ aria-valuetext={label}
133
+ onPointerDown={onPointerDown}
134
+ onPointerMove={onPointerMove}
135
+ onPointerUp={endDrag}
136
+ onPointerCancel={endDrag}
137
+ onLostPointerCapture={endDrag}
138
+ onKeyDown={onKeyDown}
139
+ className="effort-slider-track"
140
+ >
141
+ <span aria-hidden className="effort-slider-rail" />
142
+ <span aria-hidden className="effort-slider-glow" />
143
+ <span aria-hidden className="effort-slider-fill" />
144
+ {levels.map((level, i) => (
145
+ <span
146
+ key={level}
147
+ aria-hidden
148
+ className="effort-slider-tick"
149
+ data-lit={(!auto && i <= index) || undefined}
150
+ style={{ '--at': last > 0 ? i / last : 1 } as CSSProperties}
151
+ />
152
+ ))}
153
+ <span aria-hidden className="effort-slider-thumb">
154
+ {peak && <span key={index} className="effort-slider-burst" />}
155
+ </span>
156
+ </div>
157
+
158
+ <div className="mt-1.5 flex items-center justify-between text-[10.5px] text-muted-foreground">
159
+ <span className="flex items-center gap-1">
160
+ <Zap className="size-3" aria-hidden />
161
+ {t.agent.effortFaster}
162
+ </span>
163
+ <span className="effort-slider-smarter flex items-center gap-1">
164
+ {t.agent.effortSmarter}
165
+ <Sparkles className="size-3" aria-hidden />
166
+ </span>
167
+ </div>
168
+ </div>
169
+ );
170
+ }
171
+
172
+ const THUMB = 16;
@@ -0,0 +1,170 @@
1
+ import { Check, ChevronDown, Settings2 } from 'lucide-react';
2
+ import { useState } from 'react';
3
+ import { Button } from '@/components/ui/button';
4
+ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
5
+ import { resolveModelChoice, setModelChoice, type useAgentStatus } from '@/lib/agent/use-agent';
6
+ import { format, useLocale } from '@/lib/use-locale';
7
+ import { cn } from '@/lib/utils';
8
+ import type { AgentEffort, AgentModelOption, AgentProviderId } from '../../../agent/types';
9
+ import { EffortSlider } from './effort-slider';
10
+ import { ProviderLogo } from './provider-logo';
11
+
12
+ type AgentStatusState = ReturnType<typeof useAgentStatus>;
13
+
14
+ function modelLabel(model: AgentModelOption, t: ReturnType<typeof useLocale>): string {
15
+ return model.id ? model.label : t.agent.modelDefault;
16
+ }
17
+
18
+ export function ModelMenu({
19
+ status,
20
+ providerId,
21
+ model,
22
+ effort,
23
+ modelChoices,
24
+ onManage,
25
+ }: {
26
+ status: AgentStatusState['status'];
27
+ providerId: AgentProviderId | null;
28
+ model: AgentModelOption | null;
29
+ effort: AgentEffort | null;
30
+ modelChoices: AgentStatusState['modelChoices'];
31
+ onManage: () => void;
32
+ }) {
33
+ const t = useLocale();
34
+ const [open, setOpen] = useState(false);
35
+ const providers = status?.enabled ? status.providers : [];
36
+ const [tab, setTab] = useState<AgentProviderId | null>(providerId);
37
+ const shownId = tab ?? providerId ?? providers[0]?.id ?? null;
38
+ const shown = providers.find((p) => p.id === shownId) ?? null;
39
+ const choice = shown?.ready ? resolveModelChoice(shown.models, modelChoices[shown.id]) : null;
40
+ const selectedModel = shown?.id === providerId ? (model ?? choice?.model) : choice?.model;
41
+ const selectedEffort = shown?.id === providerId ? effort : (choice?.effort ?? null);
42
+
43
+ return (
44
+ <Popover
45
+ open={open}
46
+ onOpenChange={(next) => {
47
+ setOpen(next);
48
+ if (next) setTab(providerId);
49
+ }}
50
+ >
51
+ <PopoverTrigger
52
+ type="button"
53
+ className="flex h-7 min-w-0 items-center gap-1.5 rounded-[6px] px-1.5 text-[12px] text-muted-foreground outline-none transition-colors duration-100 hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30 aria-expanded:bg-muted aria-expanded:text-foreground"
54
+ >
55
+ {providerId && <ProviderLogo provider={providerId} className="size-3.5 shrink-0" />}
56
+ <span className="truncate font-medium text-foreground">
57
+ {model ? modelLabel(model, t) : t.agent.title}
58
+ </span>
59
+ {effort && (
60
+ <span className={cn('shrink-0', effort === model?.efforts.at(-1) && 'effort-peak-text')}>
61
+ {t.agent.efforts[effort]}
62
+ </span>
63
+ )}
64
+ <ChevronDown className="size-3 shrink-0 opacity-70" aria-hidden />
65
+ </PopoverTrigger>
66
+ <PopoverContent
67
+ side="top"
68
+ align="start"
69
+ sideOffset={8}
70
+ className="w-[272px] p-1.5"
71
+ data-agent-model-menu
72
+ >
73
+ {providers.length > 1 && (
74
+ <div role="tablist" className="mb-1.5 flex gap-0.5 rounded-[6px] bg-muted p-0.5">
75
+ {providers.map((p) => (
76
+ <button
77
+ key={p.id}
78
+ type="button"
79
+ role="tab"
80
+ aria-selected={p.id === shownId}
81
+ onClick={() => setTab(p.id)}
82
+ className={cn(
83
+ 'flex h-7 flex-1 items-center justify-center gap-1.5 rounded-[5px] text-[12px] font-medium text-muted-foreground outline-none transition-colors duration-100 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30',
84
+ p.id === shownId && 'bg-background text-foreground shadow-edge',
85
+ )}
86
+ >
87
+ <ProviderLogo provider={p.id} className="size-3.5 shrink-0" />
88
+ {p.name}
89
+ </button>
90
+ ))}
91
+ </div>
92
+ )}
93
+
94
+ {shown && !shown.ready ? (
95
+ <div className="flex flex-col items-start gap-2 px-2 py-2.5">
96
+ <p className="text-[12px] leading-relaxed text-muted-foreground">
97
+ {shown.cliFound
98
+ ? format(t.agent.connectInstallHint, {
99
+ pkg: shown.sdkPackage,
100
+ pm: status?.packageManager ?? 'npm',
101
+ })
102
+ : format(t.agent.cliHint, { name: shown.name })}
103
+ </p>
104
+ <Button
105
+ size="xs"
106
+ variant="outline"
107
+ onClick={() => {
108
+ setOpen(false);
109
+ onManage();
110
+ }}
111
+ >
112
+ {t.agent.connect}
113
+ </Button>
114
+ </div>
115
+ ) : shown ? (
116
+ <div className="flex flex-col gap-px">
117
+ {shown.models.map((m) => {
118
+ const checked = m.id === selectedModel?.id;
119
+ return (
120
+ <button
121
+ key={m.id}
122
+ type="button"
123
+ aria-pressed={checked}
124
+ onClick={() =>
125
+ setModelChoice(shown.id, {
126
+ model: m.id,
127
+ effort: modelChoices[shown.id]?.effort ?? null,
128
+ })
129
+ }
130
+ className={cn(
131
+ 'flex h-7 items-center justify-between gap-2 rounded-[5px] px-2 text-left text-[12.5px] outline-none transition-colors duration-100 hover:bg-muted focus-visible:bg-muted',
132
+ checked && 'font-medium',
133
+ )}
134
+ >
135
+ <span className="truncate">{modelLabel(m, t)}</span>
136
+ {checked && <Check className="size-3.5 shrink-0" aria-hidden />}
137
+ </button>
138
+ );
139
+ })}
140
+ </div>
141
+ ) : null}
142
+
143
+ {shown?.ready && selectedModel && selectedModel.efforts.length > 0 && (
144
+ <div className="mt-1.5 border-t border-hairline px-2 pt-2.5 pb-2">
145
+ <EffortSlider
146
+ levels={selectedModel.efforts}
147
+ value={selectedEffort}
148
+ provider={shown.id}
149
+ onChange={(e) => setModelChoice(shown.id, { model: selectedModel.id, effort: e })}
150
+ />
151
+ </div>
152
+ )}
153
+
154
+ <div className="mt-1.5 border-t border-hairline pt-1.5">
155
+ <button
156
+ type="button"
157
+ onClick={() => {
158
+ setOpen(false);
159
+ onManage();
160
+ }}
161
+ className="flex h-7 w-full items-center gap-2 rounded-[5px] px-2 text-[12.5px] text-muted-foreground outline-none transition-colors duration-100 hover:bg-muted hover:text-foreground focus-visible:bg-muted"
162
+ >
163
+ <Settings2 className="size-3.5" />
164
+ {t.agent.manageConnections}
165
+ </button>
166
+ </div>
167
+ </PopoverContent>
168
+ </Popover>
169
+ );
170
+ }
@@ -0,0 +1,88 @@
1
+ import { Menu } from '@base-ui/react/menu';
2
+ import { Check, ChevronDown, FilePen, Hand, ShieldCheck, ShieldOff } from 'lucide-react';
3
+ import type { ComponentType } from 'react';
4
+ import {
5
+ DropdownMenu,
6
+ DropdownMenuContent,
7
+ DropdownMenuTrigger,
8
+ } from '@/components/ui/dropdown-menu';
9
+ import { setPermissionMode } from '@/lib/agent/use-agent';
10
+ import { useLocale } from '@/lib/use-locale';
11
+ import { cn } from '@/lib/utils';
12
+ import {
13
+ AGENT_PERMISSION_MODES,
14
+ type AgentPermissionMode,
15
+ type AgentProviderId,
16
+ isAgentPermissionMode,
17
+ } from '../../../agent/types';
18
+
19
+ const MODE_ICONS: Record<AgentPermissionMode, ComponentType<{ className?: string }>> = {
20
+ supervised: Hand,
21
+ acceptEdits: FilePen,
22
+ auto: ShieldCheck,
23
+ fullAccess: ShieldOff,
24
+ };
25
+
26
+ export function PermissionMenu({
27
+ mode,
28
+ providerId,
29
+ }: {
30
+ mode: AgentPermissionMode;
31
+ providerId: AgentProviderId | null;
32
+ }) {
33
+ const t = useLocale();
34
+ const Icon = MODE_ICONS[mode];
35
+ const hint = (m: AgentPermissionMode) =>
36
+ providerId === 'codex' ? t.agent.permissionHintsCodex[m] : t.agent.permissionHints[m];
37
+
38
+ return (
39
+ <DropdownMenu>
40
+ <DropdownMenuTrigger
41
+ type="button"
42
+ aria-label={`${t.agent.permissionMode}: ${t.agent.permissionModes[mode]}`}
43
+ title={hint(mode)}
44
+ data-permission-mode={mode}
45
+ className={cn(
46
+ 'flex h-7 min-w-0 shrink items-center gap-1 rounded-[6px] px-1.5 text-[12px] text-muted-foreground outline-none transition-colors duration-100 hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30 aria-expanded:bg-muted aria-expanded:text-foreground',
47
+ mode === 'fullAccess' &&
48
+ 'text-destructive hover:text-destructive aria-expanded:text-destructive',
49
+ )}
50
+ >
51
+ <Icon className="size-3.5 shrink-0" />
52
+ <span className="truncate">{t.agent.permissionModes[mode]}</span>
53
+ <ChevronDown className="size-3 shrink-0 opacity-70" aria-hidden />
54
+ </DropdownMenuTrigger>
55
+ <DropdownMenuContent side="top" align="start" sideOffset={8} className="min-w-[184px] p-1">
56
+ <Menu.RadioGroup
57
+ value={mode}
58
+ onValueChange={(next) => {
59
+ if (isAgentPermissionMode(next)) setPermissionMode(next);
60
+ }}
61
+ >
62
+ {AGENT_PERMISSION_MODES.map((m) => {
63
+ const ItemIcon = MODE_ICONS[m];
64
+ const danger = m === 'fullAccess';
65
+ return (
66
+ <Menu.RadioItem
67
+ key={m}
68
+ value={m}
69
+ closeOnClick
70
+ title={hint(m)}
71
+ className={cn(
72
+ 'flex h-8 cursor-default items-center gap-2.5 rounded-[5px] px-2 text-[12.5px] outline-none select-none focus:bg-foreground/[0.07] dark:focus:bg-foreground/10',
73
+ danger && 'text-destructive',
74
+ )}
75
+ >
76
+ <ItemIcon className={cn('size-3.5 shrink-0', !danger && 'text-muted-foreground')} />
77
+ <span className="flex-1 truncate">{t.agent.permissionModes[m]}</span>
78
+ <Menu.RadioItemIndicator className="text-foreground">
79
+ <Check className="size-3.5" />
80
+ </Menu.RadioItemIndicator>
81
+ </Menu.RadioItem>
82
+ );
83
+ })}
84
+ </Menu.RadioGroup>
85
+ </DropdownMenuContent>
86
+ </DropdownMenu>
87
+ );
88
+ }
@@ -40,24 +40,26 @@ export function Transcript({
40
40
  const node = e.currentTarget;
41
41
  stickRef.current = node.scrollHeight - node.scrollTop - node.clientHeight < 48;
42
42
  }}
43
- className="min-h-0 flex-1 overflow-y-auto px-4 py-4"
43
+ className="scroll-fade min-h-0 flex-1 overflow-y-auto px-4 py-4"
44
44
  >
45
45
  <ol className="flex flex-col gap-3">
46
- {toBlocks(session.items).map((block) => (
47
- <li key={block.key}>
48
- {'tools' in block ? (
49
- <ToolGroup tools={block.tools} />
50
- ) : (
51
- <TranscriptItem
52
- item={block.item}
53
- running={running}
54
- replyText={replies.get(block.item.id)}
55
- onRespond={(payload) => onRespond(block.item.id, payload)}
56
- onEdit={(text) => onEdit(block.item.id, text)}
57
- />
58
- )}
59
- </li>
60
- ))}
46
+ {toBlocks(session.items)
47
+ .filter(isShown)
48
+ .map((block) => (
49
+ <li key={block.key}>
50
+ {'tools' in block ? (
51
+ <ToolGroup tools={block.tools} />
52
+ ) : (
53
+ <TranscriptItem
54
+ item={block.item}
55
+ running={running}
56
+ replyText={replies.get(block.item.id)}
57
+ onRespond={(payload) => onRespond(block.item.id, payload)}
58
+ onEdit={(text) => onEdit(block.item.id, text)}
59
+ />
60
+ )}
61
+ </li>
62
+ ))}
61
63
  {running && !(lastItem?.kind === 'assistant' && lastItem.streaming) && (
62
64
  <li>
63
65
  <WorkingIndicator />
@@ -68,6 +70,10 @@ export function Transcript({
68
70
  );
69
71
  }
70
72
 
73
+ function isShown(block: Block): boolean {
74
+ return 'tools' in block || block.item.kind !== 'result';
75
+ }
76
+
71
77
  function WorkingIndicator() {
72
78
  const t = useLocale();
73
79
  return (
@@ -124,8 +130,6 @@ function TranscriptItem({
124
130
  return <PermissionItem item={item} onRespond={onRespond} />;
125
131
  case 'error':
126
132
  return <ErrorItem text={item.text} />;
127
- case 'result':
128
- return <ResultItem item={item} />;
129
133
  default:
130
134
  return null;
131
135
  }
@@ -217,7 +221,7 @@ function UserItem({
217
221
 
218
222
  return (
219
223
  <div className="group/message flex flex-col items-end">
220
- <div className="max-w-[88%] whitespace-pre-wrap rounded-[8px] rounded-br-[3px] bg-muted px-3 py-2 text-[12.5px] leading-[1.5]">
224
+ <div className="max-w-[88%] whitespace-pre-wrap rounded-[10px] rounded-br-[4px] bg-muted px-3 py-2 text-[13.5px] leading-[1.6]">
221
225
  {text}
222
226
  </div>
223
227
  <div className={cn(ACTIONS_REVEAL, '-mr-1.5 -mb-2 mt-0.5')}>
@@ -417,18 +421,6 @@ function ErrorItem({ text }: { text: string }) {
417
421
  );
418
422
  }
419
423
 
420
- function ResultItem({ item }: { item: Extract<AgentItem, { kind: 'result' }> }) {
421
- const t = useLocale();
422
- const parts = [item.aborted ? t.agent.resultStopped : t.agent.resultDone];
423
- if (item.durationMs !== null) {
424
- parts.push(
425
- format(t.agent.resultSeconds, { seconds: Math.max(1, Math.round(item.durationMs / 1000)) }),
426
- );
427
- }
428
- if (item.costUsd !== null && item.costUsd > 0) parts.push(`$${item.costUsd.toFixed(2)}`);
429
- return <p className="folio text-muted-foreground/70">{parts.join(' · ')}</p>;
430
- }
431
-
432
424
  function PermissionItem({
433
425
  item,
434
426
  onRespond,
@@ -1,6 +1,7 @@
1
1
  import { Presentation } from 'lucide-react';
2
2
  import { useMemo } from 'react';
3
3
  import { useNavigate } from 'react-router-dom';
4
+ import { openDeckInHost } from '@/lib/desktop';
4
5
  import { useLocale } from '@/lib/use-locale';
5
6
  import { useSlideTitles } from '@/lib/use-slide-titles';
6
7
  import type { Folder } from '../../lib/sdk';
@@ -32,7 +33,9 @@ export function HomeCommandMenu({
32
33
  label: titleMap[id] ?? loadedTitles[id] ?? id,
33
34
  icon: <Presentation />,
34
35
  keywords: [id],
35
- run: () => navigate(`/s/${id}`),
36
+ run: () => {
37
+ if (!openDeckInHost(id)) navigate(`/s/${id}`);
38
+ },
36
39
  }));
37
40
 
38
41
  const folderItems: CommandSpec[] = [
@@ -15,6 +15,7 @@ import {
15
15
  Sparkles,
16
16
  } from 'lucide-react';
17
17
  import { useNavigate } from 'react-router-dom';
18
+ import { openHomeInHost } from '@/lib/desktop';
18
19
  import { format, useLocale } from '@/lib/use-locale';
19
20
  import { type CommandGroupSpec, CommandMenu, type CommandSpec } from './command-menu';
20
21
 
@@ -122,7 +123,9 @@ export function SlideCommandMenu({
122
123
  label: t.commandMenu.backToSlides,
123
124
  icon: <ChevronLeft />,
124
125
  keywords: ['home', 'back', 'slides'],
125
- run: () => navigate('/'),
126
+ run: () => {
127
+ if (!openHomeInHost('/')) navigate('/');
128
+ },
126
129
  });
127
130
  }
128
131
 
@@ -48,7 +48,9 @@ export function PdfProgressToast({ progress }: { progress: PdfExportProgress })
48
48
  ? format(t.pdfToast.processing, pageCounts(progress))
49
49
  : progress.phase === 'printing'
50
50
  ? t.pdfToast.printing
51
- : t.pdfToast.done;
51
+ : progress.phase === 'saving'
52
+ ? t.pdfToast.saving
53
+ : t.pdfToast.done;
52
54
 
53
55
  return (
54
56
  <ExportProgressToast
@@ -175,7 +175,7 @@ export function AssetPickerDialog({
175
175
  <div className="absolute inset-0 bg-brand/5" />
176
176
  <div className="absolute inset-1 rounded-[8px] border border-dashed border-brand/40" />
177
177
  <div className="absolute inset-x-0 bottom-4 flex justify-center">
178
- <div className="flex items-center gap-2 rounded-[6px] border border-border bg-card px-3 py-1.5 text-[12px] font-medium shadow-floating">
178
+ <div className="flex items-center gap-2 rounded-[6px] border border-border bg-material px-3 py-1.5 text-[12px] font-medium shadow-floating backdrop-blur-xl backdrop-saturate-150">
179
179
  <ArrowDownToLine className="size-3.5 text-brand" />
180
180
  <span>{t.asset.dropToUpload}</span>
181
181
  </div>
@@ -624,7 +624,7 @@ function IslandHint({
624
624
  <div
625
625
  data-comment-hint
626
626
  className={cn(
627
- 'island-enter grid max-w-[calc(100%-2rem)] justify-items-start overflow-hidden rounded-full border bg-card/95 px-3 py-1.5 text-[11px] text-muted-foreground shadow-floating backdrop-blur',
627
+ 'island-enter grid max-w-[calc(100%-2rem)] justify-items-start overflow-hidden rounded-full border bg-material px-3 py-1.5 text-[11px] text-muted-foreground shadow-floating backdrop-blur-xl backdrop-saturate-150',
628
628
  'motion-safe:transition-[width] motion-safe:duration-500 motion-safe:ease-[cubic-bezier(0.32,0.72,0,1)]',
629
629
  tone === 'error' && 'text-destructive',
630
630
  )}
@@ -776,7 +776,7 @@ function CommentPin({
776
776
  <div
777
777
  ref={cardRef}
778
778
  data-comment-preview
779
- className="island-arrive pointer-events-none absolute w-72 origin-top-left rounded-[10px] border border-border/80 bg-card text-[12.5px] shadow-overlay"
779
+ className="island-arrive pointer-events-none absolute w-72 origin-top-left rounded-[10px] border border-border/80 bg-material text-[12.5px] shadow-overlay backdrop-blur-xl backdrop-saturate-150"
780
780
  style={card}
781
781
  >
782
782
  <div className="truncate px-3 pt-2 font-mono text-[10px] text-muted-foreground">
@@ -933,7 +933,7 @@ function CommentCard({
933
933
  <div
934
934
  {...props}
935
935
  className={cn(
936
- 'island-arrive pointer-events-auto absolute w-72 origin-top-left rounded-[10px] border border-border/80 bg-card shadow-overlay',
936
+ 'island-arrive pointer-events-auto absolute w-72 origin-top-left rounded-[10px] border border-border/80 bg-material shadow-overlay backdrop-blur-xl backdrop-saturate-150',
937
937
  className,
938
938
  )}
939
939
  />
@@ -1,6 +1,7 @@
1
1
  import { AlignCenter, AlignLeft, AlignRight, Bold, Italic, Minus, Plus } from 'lucide-react';
2
2
  import { type RefObject, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
3
  import { useHistory } from '@/components/history-provider';
4
+ import { rgbToHex } from '@/lib/inspector/color';
4
5
  import { findSlideSource } from '@/lib/inspector/fiber';
5
6
  import {
6
7
  isEditableTextContainer,
@@ -670,15 +671,3 @@ function caretRangeAtPoint(x: number, y: number): Range | null {
670
671
  range.collapse(true);
671
672
  return range;
672
673
  }
673
-
674
- function rgbToHex(value: string): string | null {
675
- const m = value.match(/^rgba?\(([^)]+)\)$/);
676
- if (!m) return null;
677
- const parts = m[1].split(',').map((s) => s.trim());
678
- if (parts.length < 3) return null;
679
- const bytes = parts.slice(0, 3).map((p) => {
680
- const n = Math.round(Number(p));
681
- return Math.max(0, Math.min(255, Number.isFinite(n) ? n : 0));
682
- });
683
- return `#${bytes.map((n) => n.toString(16).padStart(2, '0')).join('')}`;
684
- }