@dexhq/canvas 0.13.0 → 0.15.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.
- package/CHANGELOG.md +53 -0
- package/README.md +21 -18
- package/app/canvas/activity.tsx +8 -15
- package/app/canvas/anchoring.ts +3 -5
- package/app/canvas/canvas-input.ts +151 -14
- package/app/canvas/canvas-keys.ts +9 -0
- package/app/canvas/canvas-model.ts +5 -42
- package/app/canvas/canvas-panels.ts +1 -17
- package/app/canvas/canvas-scene.ts +7 -3
- package/app/canvas/canvas-ui.ts +2 -1
- package/app/canvas/canvas.css +61 -26
- package/app/canvas/change-notice.tsx +10 -1
- package/app/canvas/comment-layer.tsx +2 -1
- package/app/canvas/comments.tsx +204 -82
- package/app/canvas/element-picker.ts +200 -27
- package/app/canvas/engine/canvas-gestures.ts +72 -17
- package/app/canvas/engine/canvas-store.ts +17 -1
- package/app/canvas/engine/engine.css +6 -3
- package/app/canvas/find-bar.tsx +817 -0
- package/app/canvas/find-model.ts +135 -0
- package/app/canvas/flow-canvas.tsx +18 -2
- package/app/canvas/follow-pin.ts +26 -6
- package/app/canvas/frame-node.tsx +43 -26
- package/app/canvas/imported-reviews.tsx +12 -22
- package/app/canvas/layout.ts +27 -0
- package/app/canvas/live-page.ts +142 -19
- package/app/canvas/page-find.ts +220 -0
- package/app/canvas/page-style.ts +23 -0
- package/app/canvas/section-node.tsx +2 -0
- package/app/canvas/spec-threads.ts +24 -23
- package/app/canvas/thread-focus.tsx +14 -12
- package/app/canvas/tool-cursors.ts +16 -16
- package/app/canvas/use-activity.ts +0 -8
- package/app/canvas/use-agent-changes.tsx +34 -40
- package/app/canvas/use-canvas-clipboard.tsx +11 -14
- package/app/canvas/xray.ts +3 -12
- package/app/frame.tsx +5 -0
- package/app/i18n/locales/en/messages.po +114 -12
- package/app/i18n/locales/en/messages.ts +1 -1
- package/app/i18n/locales/pseudo/messages.po +114 -12
- package/app/i18n/locales/pseudo/messages.ts +1 -1
- package/app/icons/{sets/lucide.tsx → glyphs.tsx} +7 -5
- package/app/icons/index.tsx +3 -3
- package/app/icons/types.ts +3 -10
- package/app/index.html +3 -3
- package/app/main.tsx +3 -0
- package/app/pages/canvas-settings.tsx +35 -0
- package/app/pages/canvas.tsx +27 -8
- package/app/pages/commands-settings.tsx +16 -2
- package/app/shell/about.tsx +5 -4
- package/app/shell/feedback-details.ts +0 -3
- package/app/shell/feedback-form.tsx +10 -21
- package/app/shell/feedback-link.tsx +2 -1
- package/app/shell/instructions-editor.tsx +1 -1
- package/app/shell/presence-style.ts +59 -0
- package/app/shell/presence.tsx +6 -3
- package/app/shell/scaled-frame.tsx +21 -9
- package/app/shell/settings-sections.ts +12 -0
- package/app/shell/sidebar.tsx +1 -1
- package/app/studio-ui.d.ts +0 -9
- package/app/types.ts +21 -205
- package/app/ui/file-drop.ts +128 -0
- package/app/ui/prompt-editor.tsx +1 -1
- package/app/ui/shadcn/input-group.tsx +2 -2
- package/dist/cli/banner.d.mts +4 -2
- package/dist/cli/banner.mjs +34 -11
- package/dist/cli/commands/app.mjs +19 -11
- package/dist/cli/commands/create.d.mts +26 -14
- package/dist/cli/commands/create.mjs +13 -7
- package/dist/cli/commands/dev.mjs +2 -3
- package/dist/cli/commands/hook.mjs +2 -1
- package/dist/cli/commands/init.d.mts +11 -6
- package/dist/cli/help.d.mts +1 -1
- package/dist/cli/help.mjs +3 -3
- package/dist/cli/main.d.mts +22 -12
- package/dist/config/index.d.mts +6 -5
- package/dist/config/project-files.d.mts +6 -3
- package/dist/config/project-files.mjs +14 -5
- package/dist/config/renamed.d.mts +0 -2
- package/dist/config/renamed.mjs +1 -3
- package/dist/config/schema.d.mts +0 -5
- package/dist/config/schema.mjs +0 -5
- package/dist/content/capture.d.mts +2 -2
- package/dist/content/capture.mjs +2 -2
- package/dist/content/content.d.mts +3 -141
- package/dist/content/content.mjs +7 -65
- package/dist/content/flow-specs.mjs +1 -1
- package/dist/content/prototype-summary.d.mts +3 -39
- package/dist/content/prototype-summary.mjs +2 -3
- package/dist/content/prototypes.mjs +1 -1
- package/dist/content/snapshot-client.mjs +1 -1
- package/dist/content/text-replace.d.mts +30 -0
- package/dist/content/text-replace.mjs +309 -0
- package/dist/content/thread-module.mjs +1 -1
- package/dist/content/threads.mjs +1 -1
- package/dist/paths.d.mts +0 -2
- package/dist/paths.mjs +1 -3
- package/dist/server/agent-env.d.mts +5 -1
- package/dist/server/agent-env.mjs +7 -2
- package/dist/server/agent-session.d.mts +14 -1
- package/dist/server/agent-session.mjs +84 -19
- package/dist/server/brief.mjs +3 -3
- package/dist/server/build-pictures.mjs +1 -1
- package/dist/server/channel.d.mts +19 -24
- package/dist/server/channel.mjs +70 -37
- package/dist/server/claimed-presence.d.mts +18 -0
- package/dist/server/claimed-presence.mjs +58 -0
- package/dist/server/close-check.mjs +2 -2
- package/dist/server/comments/actions.d.mts +153 -0
- package/dist/server/comments/actions.mjs +154 -0
- package/dist/server/comments/routes.d.mts +25 -0
- package/dist/server/comments/routes.mjs +88 -0
- package/dist/server/comments/tools.d.mts +6 -0
- package/dist/server/comments/tools.mjs +154 -0
- package/dist/server/dev-server.mjs +36 -13
- package/dist/server/file-errors.d.mts +7 -2
- package/dist/server/file-errors.mjs +31 -8
- package/dist/server/file-lock.d.mts +2 -2
- package/dist/server/file-lock.mjs +130 -36
- package/dist/server/mcp.d.mts +0 -2
- package/dist/server/mcp.mjs +7 -8
- package/dist/server/me.d.mts +1 -1
- package/dist/server/open-page.d.mts +22 -0
- package/dist/server/open-page.mjs +20 -2
- package/dist/server/outcome.d.mts +22 -0
- package/dist/server/outcome.mjs +8 -0
- package/dist/server/own-copies.mjs +2 -2
- package/dist/server/people.d.mts +1 -1
- package/dist/server/port.d.mts +12 -0
- package/dist/server/port.mjs +66 -14
- package/dist/server/presence.d.mts +4 -1
- package/dist/server/presence.mjs +2 -2
- package/dist/server/requests.d.mts +5 -1
- package/dist/server/requests.mjs +32 -47
- package/dist/server/studio-for.d.mts +5 -0
- package/dist/server/studio-for.mjs +18 -4
- package/dist/server/sync-install.d.mts +8 -12
- package/dist/server/sync-install.mjs +12 -30
- package/dist/server/thread-source.mjs +2 -2
- package/dist/server/tools/describe.d.mts +1 -1
- package/dist/server/tools/describe.mjs +1 -1
- package/dist/server/tools/feedback.d.mts +1 -1
- package/dist/server/tools/reading.mjs +13 -4
- package/dist/server/tools/show.d.mts +1 -1
- package/dist/server/tools/snapshot.d.mts +1 -1
- package/dist/server/tools/thread-list.mjs +1 -1
- package/dist/server/tools/watch.mjs +5 -3
- package/dist/server/vite.mjs +28 -31
- package/dist/server/web-app.mjs +7 -10
- package/dist/server/work-groups.mjs +1 -1
- package/dist/setup/apply.mjs +8 -14
- package/dist/setup/create.d.mts +4 -2
- package/dist/setup/create.mjs +118 -36
- package/dist/setup/design-system-checks.mjs +3 -12
- package/dist/setup/desktop-app-script.mjs +4 -3
- package/dist/setup/desktop-app-start.d.mts +8 -2
- package/dist/setup/desktop-app-start.mjs +64 -29
- package/dist/setup/desktop-app.d.mts +8 -0
- package/dist/setup/desktop-app.mjs +20 -4
- package/dist/setup/detect.d.mts +14 -7
- package/dist/setup/detect.mjs +56 -10
- package/dist/setup/doctor.mjs +2 -4
- package/dist/setup/existing-setup.d.mts +1 -3
- package/dist/setup/existing-setup.mjs +10 -11
- package/dist/setup/migrate/row-titles.mjs +1 -1
- package/dist/setup/own-app.d.mts +1 -2
- package/dist/setup/own-app.mjs +4 -5
- package/dist/setup/plan.d.mts +8 -6
- package/dist/setup/plan.mjs +64 -48
- package/dist/setup/project.d.mts +6 -17
- package/dist/setup/project.mjs +17 -61
- package/dist/setup/prompts.d.mts +5 -5
- package/dist/setup/prompts.mjs +28 -61
- package/dist/setup/questions.d.mts +12 -4
- package/dist/setup/questions.mjs +10 -25
- package/dist/setup/starters.d.mts +2 -0
- package/dist/setup/starters.mjs +26 -9
- package/dist/setup/workspace-setup.d.mts +1 -2
- package/dist/setup/workspace-setup.mjs +4 -6
- package/dist/setup/write.d.mts +15 -5
- package/dist/setup/write.mjs +35 -9
- package/dist/shared/annotations-core.mjs +1 -1
- package/dist/shared/canvas-core.mjs +1 -1
- package/dist/shared/canvas-file.d.mts +201 -0
- package/dist/shared/canvas-file.mjs +1 -0
- package/dist/shared/comments/routes.d.mts +53 -0
- package/dist/shared/comments/routes.mjs +37 -0
- package/dist/shared/feedback.d.mts +8 -0
- package/dist/shared/feedback.mjs +10 -2
- package/dist/shared/page-review.d.mts +2 -11
- package/dist/shared/page-review.mjs +4 -13
- package/dist/shared/presence-core.d.mts +11 -0
- package/dist/shared/presence-core.mjs +11 -2
- package/dist/shared/review-file.d.mts +5 -0
- package/dist/shared/review-file.mjs +23 -13
- package/dist/shared/server-page.mjs +7 -1
- package/dist/shared/signup.d.mts +2 -5
- package/dist/shared/signup.mjs +2 -35
- package/dist/shared/studio-events.d.mts +0 -6
- package/dist/shared/studio-events.mjs +1 -5
- package/dist/shared/studio-files.d.mts +12 -0
- package/dist/shared/studio-files.mjs +6 -1
- package/dist/shared/studio-routes.d.mts +16 -62
- package/dist/shared/studio-routes.mjs +1 -69
- package/dist/shared/threads-core.d.mts +2 -2
- package/dist/shared/threads-core.mjs +1 -1
- package/extension/dist/feedback.js +148 -138
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/picker.js +146 -136
- package/package.json +3 -20
- package/src/cli/banner.ts +45 -11
- package/src/cli/commands/app.ts +23 -8
- package/src/cli/commands/create.ts +17 -9
- package/src/cli/commands/dev.ts +0 -3
- package/src/cli/commands/hook.ts +4 -1
- package/src/cli/help.ts +3 -3
- package/src/config/index.ts +6 -5
- package/src/config/project-files.ts +21 -11
- package/src/config/renamed.ts +0 -3
- package/src/config/schema.ts +0 -1
- package/src/content/capture.ts +6 -12
- package/src/content/content.ts +7 -244
- package/src/content/flow-specs.ts +2 -1
- package/src/content/prototype-summary.ts +4 -44
- package/src/content/review-pages.ts +2 -1
- package/src/content/snapshot-client.ts +1 -1
- package/src/content/text-replace.ts +449 -0
- package/src/paths.ts +0 -8
- package/src/server/agent-env.ts +12 -2
- package/src/server/agent-session.ts +124 -34
- package/src/server/brief.ts +8 -3
- package/src/server/channel.ts +121 -52
- package/src/server/claimed-presence.ts +93 -0
- package/src/server/comments/actions.ts +352 -0
- package/src/server/comments/routes.ts +176 -0
- package/src/server/comments/tools.ts +317 -0
- package/src/server/dev-server.ts +49 -15
- package/src/server/file-errors.ts +47 -13
- package/src/server/file-lock.ts +205 -54
- package/src/server/mcp.ts +13 -14
- package/src/server/me.ts +2 -5
- package/src/server/open-page.ts +54 -4
- package/src/server/outcome.ts +26 -0
- package/src/server/people.ts +2 -1
- package/src/server/port.ts +94 -20
- package/src/server/presence.ts +11 -3
- package/src/server/requests.ts +60 -70
- package/src/server/studio-for.ts +27 -3
- package/src/server/sync-install.ts +35 -26
- package/src/server/thread-place.ts +2 -4
- package/src/server/tools/reading.ts +16 -3
- package/src/server/tools/watch.ts +7 -7
- package/src/server/vite.ts +37 -40
- package/src/server/web-app.ts +14 -12
- package/src/setup/apply.ts +10 -16
- package/src/setup/create.ts +143 -37
- package/src/setup/design-system-checks.ts +7 -15
- package/src/setup/desktop-app-script.ts +4 -3
- package/src/setup/desktop-app-start.ts +94 -26
- package/src/setup/desktop-app.ts +24 -3
- package/src/setup/detect.ts +56 -14
- package/src/setup/doctor.ts +4 -4
- package/src/setup/existing-setup.ts +10 -12
- package/src/setup/own-app.ts +2 -5
- package/src/setup/plan.ts +93 -84
- package/src/setup/project.ts +25 -118
- package/src/setup/prompts.ts +44 -127
- package/src/setup/questions.ts +27 -29
- package/src/setup/starters.ts +35 -10
- package/src/setup/workspace-setup.ts +8 -18
- package/src/setup/write.ts +52 -9
- package/src/shared/canvas-file.ts +205 -0
- package/src/shared/comments/routes.ts +79 -0
- package/src/shared/feedback.ts +14 -4
- package/src/shared/page-review.ts +11 -16
- package/src/shared/presence-core.ts +16 -2
- package/src/shared/review-file.ts +28 -12
- package/src/shared/server-page.ts +11 -1
- package/src/shared/signup.ts +4 -28
- package/src/shared/studio-events.ts +0 -13
- package/src/shared/studio-files.ts +14 -0
- package/src/shared/studio-routes.ts +21 -64
- package/src/shared/threads-core.ts +2 -2
- package/templates/methods/review.md +2 -2
- package/templates/rules/canvas-frames.md +104 -0
- package/templates/rules/canvas.md +8 -142
- package/templates/rules/prototypes.md +1 -1
- package/templates/rules/snapshots.md +52 -0
- package/templates/starters/standalone/README.md +7 -7
- package/templates/starters/standalone/components.json +1 -1
- package/templates/starters/standalone/package.json +1 -2
- package/templates/starters/turborepo/README.md +6 -6
- package/templates/starters/turborepo/apps/web/components.json +1 -1
- package/templates/starters/turborepo/apps/web/package.json +1 -2
- package/templates/starters/turborepo/apps/web/src/app.tsx +4 -5
- package/templates/starters/turborepo/packages/ui/components.json +1 -1
- package/templates/starters/turborepo/packages/ui/package.json +1 -2
- package/templates/starters/vite/README.md +7 -6
- package/templates/starters/vite/components.json +1 -1
- package/templates/starters/vite/package.json +1 -2
- package/templates/starters/vite/src/app.tsx +3 -4
- package/templates/starters/vite/src/components/ui/accordion.tsx +71 -0
- package/templates/starters/vite/src/components/ui/attachment.tsx +1 -1
- package/templates/starters/vite/src/components/ui/badge.tsx +2 -2
- package/templates/starters/vite/src/components/ui/button.tsx +17 -12
- package/templates/starters/vite/src/components/ui/card.tsx +1 -1
- package/templates/starters/vite/src/components/ui/checkbox.tsx +28 -0
- package/templates/starters/vite/src/components/ui/dialog.tsx +5 -5
- package/templates/starters/vite/src/components/ui/dropdown-menu.tsx +17 -14
- package/templates/starters/vite/src/components/ui/field.tsx +3 -1
- package/templates/starters/vite/src/components/ui/input-group.tsx +5 -3
- package/templates/starters/vite/src/components/ui/input.tsx +1 -1
- package/templates/starters/vite/src/components/ui/label.tsx +2 -0
- package/templates/starters/vite/src/components/ui/native-select.tsx +3 -4
- package/templates/starters/vite/src/components/ui/popover.tsx +1 -1
- package/templates/starters/vite/src/components/ui/separator.tsx +2 -0
- package/templates/starters/vite/src/components/ui/spinner.tsx +3 -7
- package/templates/starters/vite/src/components/ui/switch.tsx +1 -1
- package/templates/starters/vite/src/components/ui/textarea.tsx +1 -1
- package/templates/starters/vite/src/components/ui/toggle.tsx +4 -2
- package/templates/starters/vite/src/index.css +533 -111
- package/app/icons/sets/hugeicons.tsx +0 -259
- package/app/icons/sets/phosphor.tsx +0 -251
- package/dist/server/icon-set.d.mts +0 -15
- package/dist/server/icon-set.mjs +0 -31
- package/dist/server/tools/close-reply.d.mts +0 -6
- package/dist/server/tools/close-reply.mjs +0 -138
- package/dist/server/tools/comment.d.mts +0 -6
- package/dist/server/tools/comment.mjs +0 -49
- package/dist/shared/icon-sets.d.mts +0 -9
- package/dist/shared/icon-sets.mjs +0 -21
- package/src/server/icon-set.ts +0 -56
- package/src/server/tools/close-reply.ts +0 -271
- package/src/server/tools/comment.ts +0 -96
- package/src/shared/icon-sets.ts +0 -23
- /package/app/public/{sudio-192.png → dex-192.png} +0 -0
- /package/app/public/{sudio-512.png → dex-512.png} +0 -0
- /package/app/public/{apple-touch-icon.png → dex-apple-touch-icon.png} +0 -0
- /package/app/public/{favicon-32.png → dex-icon-32.png} +0 -0
- /package/app/public/{favicon.svg → dex-icon.svg} +0 -0
- /package/app/public/{sudio-maskable-512.png → dex-maskable-512.png} +0 -0
package/app/icons/types.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import type { ComponentType, SVGAttributes } from "react";
|
|
2
|
-
import type { glyphs } from "./
|
|
2
|
+
import type { glyphs } from "./glyphs";
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Every icon the studio's interface draws, by lucide's name. The config's
|
|
6
|
-
* `ui.icons` picks the set that draws them, and only that set is bundled
|
|
7
|
-
* (see node/vite.mjs).
|
|
8
|
-
*/
|
|
4
|
+
/** Every icon the studio's interface draws, by Lucide's name. */
|
|
9
5
|
export type IconName = keyof typeof glyphs;
|
|
10
6
|
|
|
11
|
-
/** What every glyph takes
|
|
7
|
+
/** What every glyph takes. */
|
|
12
8
|
export type GlyphProps = Omit<SVGAttributes<SVGSVGElement>, "name"> & {
|
|
13
9
|
size?: number;
|
|
14
10
|
};
|
|
15
11
|
|
|
16
12
|
export type Glyph = ComponentType<GlyphProps>;
|
|
17
|
-
|
|
18
|
-
/** A set: a glyph for every name in the vocabulary. */
|
|
19
|
-
export type IconGlyphs = Record<IconName, Glyph>;
|
package/app/index.html
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
media="(prefers-color-scheme: dark)"
|
|
17
17
|
>
|
|
18
18
|
<!-- A browser that reads SVG prefers it to a PNG of a fixed size. -->
|
|
19
|
-
<link rel="icon" href="/
|
|
20
|
-
<link rel="icon" href="/
|
|
21
|
-
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
|
19
|
+
<link rel="icon" href="/dex-icon-32.png" sizes="32x32" type="image/png">
|
|
20
|
+
<link rel="icon" href="/dex-icon.svg" type="image/svg+xml">
|
|
21
|
+
<link rel="apple-touch-icon" href="/dex-apple-touch-icon.png">
|
|
22
22
|
<title>Dex</title>
|
|
23
23
|
<script>
|
|
24
24
|
"use strict";
|
package/app/main.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import { StudioI18n } from "./i18n/provider";
|
|
|
12
12
|
import { carryOverStorage } from "./renamed-storage";
|
|
13
13
|
// Chrome offers Install once, as the page loads: kept for Settings.
|
|
14
14
|
import "./shell/install-prompt";
|
|
15
|
+
import { refuseStrayFileDrops } from "./ui/file-drop";
|
|
15
16
|
import { StudioThemeProvider } from "./ui/theme-provider";
|
|
16
17
|
|
|
17
18
|
// A view's address from before views had a page of their own goes there.
|
|
@@ -23,6 +24,8 @@ const view = viewAt(
|
|
|
23
24
|
const frameAddress = view && framePage(view.slug, view.view, view.search);
|
|
24
25
|
// What the browser kept under Sudio's keys, under Dex's from now on.
|
|
25
26
|
carryOverStorage();
|
|
27
|
+
// A file dropped where nothing takes it is never opened in place of Dex.
|
|
28
|
+
refuseStrayFileDrops(window);
|
|
26
29
|
const root = document.getElementById("root");
|
|
27
30
|
if (!root) {
|
|
28
31
|
throw new Error("Dex needs a #root element in index.html.");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useLingui } from "@lingui/react/macro";
|
|
2
|
+
import {
|
|
3
|
+
type PresenceStyle,
|
|
4
|
+
setPresenceStyle,
|
|
5
|
+
usePresenceStyle,
|
|
6
|
+
} from "../shell/presence-style";
|
|
7
|
+
import { SettingRow, SettingsCard } from "../shell/settings-ui";
|
|
8
|
+
import { Segmented } from "../ui/segmented";
|
|
9
|
+
|
|
10
|
+
// Settings → Canvas: how the canvas looks to you, in this browser.
|
|
11
|
+
|
|
12
|
+
export const CanvasSettings = () => {
|
|
13
|
+
const { t } = useLingui();
|
|
14
|
+
const style = usePresenceStyle();
|
|
15
|
+
const styles: { id: PresenceStyle; label: string }[] = [
|
|
16
|
+
{ id: "blocks", label: t`Blocks` },
|
|
17
|
+
{ id: "edge", label: t`Edge only` },
|
|
18
|
+
{ id: "off", label: t`Off` },
|
|
19
|
+
];
|
|
20
|
+
return (
|
|
21
|
+
<SettingsCard>
|
|
22
|
+
<SettingRow
|
|
23
|
+
hint={t`How a frame an agent is changing shows it: drawn in blocks while it works, an edge round the frame, or nothing.`}
|
|
24
|
+
label={t`Agents at work`}
|
|
25
|
+
>
|
|
26
|
+
<Segmented
|
|
27
|
+
label={t`Agents at work`}
|
|
28
|
+
onChange={setPresenceStyle}
|
|
29
|
+
segments={styles}
|
|
30
|
+
value={style}
|
|
31
|
+
/>
|
|
32
|
+
</SettingRow>
|
|
33
|
+
</SettingsCard>
|
|
34
|
+
);
|
|
35
|
+
};
|
package/app/pages/canvas.tsx
CHANGED
|
@@ -59,8 +59,10 @@ import { ActionNotice, TopNotices } from "../canvas/change-notice";
|
|
|
59
59
|
import {
|
|
60
60
|
CommentsPanel,
|
|
61
61
|
FloatingCommentCard,
|
|
62
|
+
showWhileHidden,
|
|
62
63
|
useHideCommentsWhile,
|
|
63
64
|
useIsTeamComment,
|
|
65
|
+
useOpenedWhileHidden,
|
|
64
66
|
} from "../canvas/comments";
|
|
65
67
|
import { DrawLayer } from "../canvas/draw-layer";
|
|
66
68
|
import type { DrawKind } from "../canvas/draw-model";
|
|
@@ -68,6 +70,7 @@ import {
|
|
|
68
70
|
CanvasViewProvider,
|
|
69
71
|
useCanvasView,
|
|
70
72
|
} from "../canvas/engine/canvas-view";
|
|
73
|
+
import { FindBar } from "../canvas/find-bar";
|
|
71
74
|
import { FlowCanvas } from "../canvas/flow-canvas";
|
|
72
75
|
import { askName } from "../canvas/flow-naming";
|
|
73
76
|
import { CommentsOrReviewsBody } from "../canvas/imported-reviews";
|
|
@@ -184,6 +187,8 @@ const savedCanvas = (editor: CanvasEditor) =>
|
|
|
184
187
|
const CanvasFloatingComment = ({ threads }: { threads: ThreadsApi }) => {
|
|
185
188
|
const ui = useCanvasUiStore();
|
|
186
189
|
const floating = useCanvasUi((state) => state.floating);
|
|
190
|
+
const specThread = useCanvasUi((state) => state.specThread);
|
|
191
|
+
useOpenedWhileHidden(floating, specThread);
|
|
187
192
|
return (
|
|
188
193
|
<FloatingCommentCard
|
|
189
194
|
floating={floating}
|
|
@@ -285,23 +290,22 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
|
|
|
285
290
|
const seeChange = useRef<(thread: Thread) => void>(() => undefined);
|
|
286
291
|
// The heads-up opens comments with one function for good, so the
|
|
287
292
|
// canvas rendering never renders it again.
|
|
288
|
-
const openThreadNow = useRef<(id: string
|
|
289
|
-
() => undefined
|
|
290
|
-
);
|
|
293
|
+
const openThreadNow = useRef<(id: string) => void>(() => undefined);
|
|
291
294
|
const openFromBar = useCallback(
|
|
292
|
-
(id: string
|
|
295
|
+
(id: string) => openThreadNow.current(id),
|
|
293
296
|
[]
|
|
294
297
|
);
|
|
295
298
|
// A spec's thread opens beside its spec, where its words are: on the
|
|
296
299
|
// canvas when the spec is placed there, else with the spec full screen.
|
|
297
300
|
// A document's, and any other, as a floating card.
|
|
298
301
|
const openAnyThread = useCallback(
|
|
299
|
-
(id: string, at
|
|
302
|
+
(id: string, at?: ScreenPoint) => {
|
|
300
303
|
const thread = threads.threads.find((entry) => entry.id === id);
|
|
301
304
|
// Reading a completed comment counts its change as seen.
|
|
302
305
|
if (thread) {
|
|
303
306
|
seeChange.current(thread);
|
|
304
307
|
}
|
|
308
|
+
showWhileHidden(id);
|
|
305
309
|
const spec =
|
|
306
310
|
thread?.target.kind === "spec" ? thread.target.spec : undefined;
|
|
307
311
|
if (spec === undefined || spec.startsWith("docs/")) {
|
|
@@ -315,9 +319,6 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
|
|
|
315
319
|
},
|
|
316
320
|
[threads.threads, ui, openThread, editor.canvas, fullScreenSpec]
|
|
317
321
|
);
|
|
318
|
-
useLayoutEffect(() => {
|
|
319
|
-
openThreadNow.current = openAnyThread;
|
|
320
|
-
}, [openAnyThread]);
|
|
321
322
|
const focusThread = useThreadFocus(
|
|
322
323
|
threads.threads,
|
|
323
324
|
editor.canvas,
|
|
@@ -432,6 +433,23 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
|
|
|
432
433
|
threads: threads.threads,
|
|
433
434
|
});
|
|
434
435
|
seeChange.current = agentChanges.see;
|
|
436
|
+
// From the heads-up, the canvas moves to the comment, and its card opens
|
|
437
|
+
// at its pin. One an agent completed outlines where its change landed,
|
|
438
|
+
// and goes there when the comment has no pin (a request for a view, or a
|
|
439
|
+
// comment on the whole file).
|
|
440
|
+
const { outline } = agentChanges;
|
|
441
|
+
useLayoutEffect(() => {
|
|
442
|
+
openThreadNow.current = (id) => {
|
|
443
|
+
const thread = threads.threads.find((entry) => entry.id === id);
|
|
444
|
+
if (!thread) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
const atPin = focusThread(thread);
|
|
448
|
+
if (thread.status === "resolved") {
|
|
449
|
+
outline([thread], { move: !atPin });
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
}, [threads.threads, focusThread, outline]);
|
|
435
453
|
const { toggle: togglePanel } = panels;
|
|
436
454
|
const toggleStickers = useCallback(
|
|
437
455
|
() => togglePanel("stickers"),
|
|
@@ -696,6 +714,7 @@ const CanvasWorkspace = ({ prototype }: { prototype: Prototype }) => {
|
|
|
696
714
|
GUEST_REVIEW && !focused && panels.right === "comments"
|
|
697
715
|
}
|
|
698
716
|
/>
|
|
717
|
+
<FindBar writable={studio.local} />
|
|
699
718
|
<ServerNotice />
|
|
700
719
|
<TopNotices>
|
|
701
720
|
<ActionNotice notice={inspect.notice} />
|
|
@@ -16,7 +16,13 @@ import {
|
|
|
16
16
|
import { Switch } from "@studio/ui/shadcn/switch";
|
|
17
17
|
import { Textarea } from "@studio/ui/shadcn/textarea";
|
|
18
18
|
import { cn } from "cn";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
type DragEvent,
|
|
21
|
+
Fragment,
|
|
22
|
+
type ReactNode,
|
|
23
|
+
useId,
|
|
24
|
+
useState,
|
|
25
|
+
} from "react";
|
|
20
26
|
import {
|
|
21
27
|
type Command,
|
|
22
28
|
type CommandSwitch,
|
|
@@ -254,6 +260,13 @@ const QuickBarPicker = ({
|
|
|
254
260
|
}) => {
|
|
255
261
|
const { t } = useLingui();
|
|
256
262
|
const [dragging, setDragging] = useState<string>();
|
|
263
|
+
// Only a skill being moved, on dragenter as on dragover (file-drop.ts says
|
|
264
|
+
// why): a file dragged over the quick bar is not one of its skills.
|
|
265
|
+
const takeMove = (event: DragEvent) => {
|
|
266
|
+
if (dragging) {
|
|
267
|
+
event.preventDefault();
|
|
268
|
+
}
|
|
269
|
+
};
|
|
257
270
|
const choose = useStudioAction(
|
|
258
271
|
(quick: string[]) =>
|
|
259
272
|
studioRequest("commands", { method: "PUT", body: { quick } }),
|
|
@@ -307,7 +320,8 @@ const QuickBarPicker = ({
|
|
|
307
320
|
draggable
|
|
308
321
|
key={name}
|
|
309
322
|
onDragEnd={() => setDragging(undefined)}
|
|
310
|
-
|
|
323
|
+
onDragEnter={takeMove}
|
|
324
|
+
onDragOver={takeMove}
|
|
311
325
|
onDragStart={() => setDragging(name)}
|
|
312
326
|
onDrop={() => {
|
|
313
327
|
if (dragging && dragging !== name) {
|
package/app/shell/about.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
DialogTitle,
|
|
9
9
|
} from "@studio/ui/shadcn/dialog";
|
|
10
10
|
import { useEffect, useState } from "react";
|
|
11
|
-
import {
|
|
11
|
+
import { license, name, version } from "../../package.json";
|
|
12
12
|
import { PRODUCT } from "../../src/shared/product.ts";
|
|
13
13
|
import { versionsLine } from "../../src/shared/update-core.ts";
|
|
14
14
|
import { CAN_WRITE } from "../live/studio-api";
|
|
@@ -25,7 +25,8 @@ import { useCopied } from "./use-copied";
|
|
|
25
25
|
// Dexes" (server/roster.ts). Reporting one is Feedback's, at the foot of
|
|
26
26
|
// the sidebar, so it isn't here too.
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// Dex's page on npm, where its source is too (the Code tab).
|
|
29
|
+
const PACKAGE_URL = `https://www.npmjs.com/package/${name}`;
|
|
29
30
|
|
|
30
31
|
export const AboutDialog = ({
|
|
31
32
|
onOpenChange,
|
|
@@ -103,11 +104,11 @@ export const AboutDialog = ({
|
|
|
103
104
|
<div className="flex items-center justify-between gap-2">
|
|
104
105
|
<a
|
|
105
106
|
className="studio-small text-muted-foreground hover:text-foreground hover:underline"
|
|
106
|
-
href={
|
|
107
|
+
href={PACKAGE_URL}
|
|
107
108
|
rel="noopener"
|
|
108
109
|
target="_blank"
|
|
109
110
|
>
|
|
110
|
-
<Trans>
|
|
111
|
+
<Trans>{PRODUCT} on npm</Trans>
|
|
111
112
|
</a>
|
|
112
113
|
<Button
|
|
113
114
|
onClick={() => copy(details)}
|
|
@@ -24,7 +24,6 @@ export interface FeedbackContext {
|
|
|
24
24
|
environment: IssueEnvironment;
|
|
25
25
|
/** Unreleased features turned on (only in a copy being worked on). */
|
|
26
26
|
features: string[];
|
|
27
|
-
icons: string | undefined;
|
|
28
27
|
locale: string | undefined;
|
|
29
28
|
workspace: string;
|
|
30
29
|
}
|
|
@@ -70,7 +69,6 @@ export const feedbackDetails = (
|
|
|
70
69
|
["Design system", designSystemDetail(context.designSystem)],
|
|
71
70
|
["Agents", context.agents.join(", ")],
|
|
72
71
|
["Default agent", context.defaultAgent],
|
|
73
|
-
["Icons", context.icons],
|
|
74
72
|
["Language", context.locale],
|
|
75
73
|
["Features on", context.features.join(", ")],
|
|
76
74
|
]),
|
|
@@ -105,7 +103,6 @@ export const useFeedbackDetails = (): FeedbackDetailGroup[] => {
|
|
|
105
103
|
},
|
|
106
104
|
agents: [...new Set(agents.map((connected) => agentName(connected.agent)))],
|
|
107
105
|
defaultAgent: agent && AGENT_NAMES[agent],
|
|
108
|
-
icons: ui.icons,
|
|
109
106
|
locale: ui.locale,
|
|
110
107
|
features: Object.entries(features)
|
|
111
108
|
.filter(([, on]) => on)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Plural, Trans, useLingui } from "@lingui/react/macro";
|
|
2
2
|
import { Icon } from "@studio/icons";
|
|
3
|
+
import { useFileDrop } from "@studio/ui/file-drop";
|
|
3
4
|
import { Segmented } from "@studio/ui/segmented";
|
|
4
5
|
import {
|
|
5
6
|
Attachment,
|
|
@@ -23,7 +24,6 @@ import { Textarea } from "@studio/ui/shadcn/textarea";
|
|
|
23
24
|
import { cn } from "cn";
|
|
24
25
|
import {
|
|
25
26
|
type ClipboardEvent,
|
|
26
|
-
type DragEvent,
|
|
27
27
|
type FormEvent,
|
|
28
28
|
type KeyboardEvent,
|
|
29
29
|
type ReactNode,
|
|
@@ -53,7 +53,9 @@ import { PRODUCT } from "../../src/shared/product.ts";
|
|
|
53
53
|
// what was written when it doesn't go. The same form serves Dex's dialog
|
|
54
54
|
// and the extension's page (extension/feedback.tsx), which starts it with the
|
|
55
55
|
// page's screenshot attached; Markup ports it, line for line, into its shadow
|
|
56
|
-
// root.
|
|
56
|
+
// root. Each puts it on a surface with no padding of its own: the form pads
|
|
57
|
+
// itself, so it fills the surface to the edge and a file dropped anywhere on
|
|
58
|
+
// what looks like the form lands on it, not on the page, which would open it.
|
|
57
59
|
|
|
58
60
|
/**
|
|
59
61
|
* Dex information, sent when the person keeps "Add Dex information"
|
|
@@ -117,7 +119,6 @@ export const FeedbackForm = ({
|
|
|
117
119
|
const [files, setFiles] = useState<File[]>(draft.files ?? []);
|
|
118
120
|
const [withDetails, setWithDetails] = useState(true);
|
|
119
121
|
const [status, setStatus] = useState<Status>({ step: "writing" });
|
|
120
|
-
const [over, setOver] = useState(false);
|
|
121
122
|
|
|
122
123
|
const feedback: Feedback = {
|
|
123
124
|
kind,
|
|
@@ -149,6 +150,9 @@ export const FeedbackForm = ({
|
|
|
149
150
|
// Every file, so one it can't take stays to say why, not vanish.
|
|
150
151
|
setFiles((current) => [...current, ...more]);
|
|
151
152
|
|
|
153
|
+
// A file dropped anywhere on the form attaches.
|
|
154
|
+
const { over, zone } = useFileDrop(attach);
|
|
155
|
+
|
|
152
156
|
if (status.step === "sent") {
|
|
153
157
|
return <Thanks email={status.email} onClose={onClose} />;
|
|
154
158
|
}
|
|
@@ -164,24 +168,9 @@ export const FeedbackForm = ({
|
|
|
164
168
|
// biome-ignore lint/a11y/noNoninteractiveElementInteractions: ⌘Enter sends from any field, and files dropped anywhere on the form attach
|
|
165
169
|
<form
|
|
166
170
|
aria-labelledby={`${ids}-title`}
|
|
167
|
-
className="flex min-w-0 flex-col gap-4"
|
|
171
|
+
className="flex min-w-0 flex-col gap-4 p-6"
|
|
168
172
|
noValidate
|
|
169
|
-
|
|
170
|
-
if (!event.currentTarget.contains(event.relatedTarget as Node)) {
|
|
171
|
-
setOver(false);
|
|
172
|
-
}
|
|
173
|
-
}}
|
|
174
|
-
onDragOver={(event: DragEvent) => {
|
|
175
|
-
if (event.dataTransfer.types.includes("Files")) {
|
|
176
|
-
event.preventDefault();
|
|
177
|
-
setOver(true);
|
|
178
|
-
}
|
|
179
|
-
}}
|
|
180
|
-
onDrop={(event: DragEvent) => {
|
|
181
|
-
event.preventDefault();
|
|
182
|
-
setOver(false);
|
|
183
|
-
attach([...event.dataTransfer.files]);
|
|
184
|
-
}}
|
|
173
|
+
{...zone}
|
|
185
174
|
onKeyDown={(event: KeyboardEvent) => {
|
|
186
175
|
if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
|
|
187
176
|
event.preventDefault();
|
|
@@ -608,7 +597,7 @@ const Thumbnail = ({ file }: { file: File }) => {
|
|
|
608
597
|
|
|
609
598
|
/** Sent: thanks, where a reply would go, and a way out. */
|
|
610
599
|
const Thanks = ({ email, onClose }: { email: string; onClose: () => void }) => (
|
|
611
|
-
<div className="flex flex-col items-center gap-3 py-
|
|
600
|
+
<div className="flex flex-col items-center gap-3 px-6 py-10 text-center">
|
|
612
601
|
<span className="flex size-10 items-center justify-center rounded-xl bg-muted">
|
|
613
602
|
<Icon className="size-5" name="CircleCheck" />
|
|
614
603
|
</span>
|
|
@@ -32,9 +32,10 @@ export const FeedbackLink = ({ className }: { className: string }) => {
|
|
|
32
32
|
</Tip>
|
|
33
33
|
</TipGroup>
|
|
34
34
|
<Dialog onOpenChange={setOpen} open={open}>
|
|
35
|
+
{/* No padding: the form pads itself, so a file dropped on its edge lands on it. */}
|
|
35
36
|
<DialogContent
|
|
36
37
|
aria-label={t`Send feedback`}
|
|
37
|
-
className="max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-md"
|
|
38
|
+
className="max-h-[calc(100dvh-2rem)] overflow-y-auto p-0 sm:max-w-md"
|
|
38
39
|
showCloseButton={false}
|
|
39
40
|
>
|
|
40
41
|
<DexFeedback onClose={() => setOpen(false)} />
|
|
@@ -404,7 +404,7 @@ const SlashMenu = ({
|
|
|
404
404
|
{/* biome-ignore lint/a11y/useKeyWithClickEvents: the editor's keys choose (arrows, Enter), as focus stays in the text */}
|
|
405
405
|
<div
|
|
406
406
|
aria-selected={index === active}
|
|
407
|
-
className="studio-small flex min-h-7 cursor-default items-center gap-2 rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
|
|
407
|
+
className="studio-small flex min-h-7 shrink-0 cursor-default items-center gap-2 rounded-lg px-2.5 py-1 aria-selected:bg-studio-hover"
|
|
408
408
|
id={`${MENU_ID}-${index}`}
|
|
409
409
|
onClick={() => choose(format)}
|
|
410
410
|
// Keep the caret in the editor.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
// How an agent at work shows on a frame, as each person likes it: drawn in
|
|
4
|
+
// blocks (presence.tsx), only the edge round the frame, or not at all. Kept
|
|
5
|
+
// in this browser, and the same in every tab of it.
|
|
6
|
+
|
|
7
|
+
export const PRESENCE_STYLES = ["blocks", "edge", "off"] as const;
|
|
8
|
+
export type PresenceStyle = (typeof PRESENCE_STYLES)[number];
|
|
9
|
+
|
|
10
|
+
const KEY = "dex.presence.style";
|
|
11
|
+
const DEFAULT: PresenceStyle = "blocks";
|
|
12
|
+
|
|
13
|
+
const listeners = new Set<() => void>();
|
|
14
|
+
/** The choice made where storage is refused (a private window). */
|
|
15
|
+
let unsaved: PresenceStyle | undefined;
|
|
16
|
+
|
|
17
|
+
const read = (): PresenceStyle => {
|
|
18
|
+
if (unsaved) {
|
|
19
|
+
return unsaved;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const saved = window.localStorage.getItem(KEY);
|
|
23
|
+
return PRESENCE_STYLES.find((style) => style === saved) ?? DEFAULT;
|
|
24
|
+
} catch {
|
|
25
|
+
return DEFAULT;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const subscribe = (listener: () => void) => {
|
|
30
|
+
listeners.add(listener);
|
|
31
|
+
// Another tab chose.
|
|
32
|
+
const onStorage = (event: StorageEvent) => {
|
|
33
|
+
if (event.key === KEY) {
|
|
34
|
+
listener();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
window.addEventListener("storage", onStorage);
|
|
38
|
+
return () => {
|
|
39
|
+
listeners.delete(listener);
|
|
40
|
+
window.removeEventListener("storage", onStorage);
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** How this person has agents at work shown. */
|
|
45
|
+
export const usePresenceStyle = (): PresenceStyle =>
|
|
46
|
+
useSyncExternalStore(subscribe, read, () => DEFAULT);
|
|
47
|
+
|
|
48
|
+
/** Show agents at work as `style`, here and in this browser's other tabs. */
|
|
49
|
+
export const setPresenceStyle = (style: PresenceStyle): void => {
|
|
50
|
+
try {
|
|
51
|
+
window.localStorage.setItem(KEY, style);
|
|
52
|
+
} catch {
|
|
53
|
+
// Not remembered, in a private window: it holds until reload.
|
|
54
|
+
unsaved = style;
|
|
55
|
+
}
|
|
56
|
+
for (const listener of listeners) {
|
|
57
|
+
listener();
|
|
58
|
+
}
|
|
59
|
+
};
|
package/app/shell/presence.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
useState,
|
|
7
7
|
} from "react";
|
|
8
8
|
import type { Sketch } from "../types";
|
|
9
|
+
import { usePresenceStyle } from "./presence-style";
|
|
9
10
|
import {
|
|
10
11
|
type Bone,
|
|
11
12
|
changedElements,
|
|
@@ -400,7 +401,8 @@ const PresenceBlocks = ({
|
|
|
400
401
|
* An agent at work on a view, while `active`. Given the frame's `iframe`,
|
|
401
402
|
* the view in blocks from its layout; with `blank`, a page still to come,
|
|
402
403
|
* in blocks as `guess` has it or as a generic page; with neither, only an
|
|
403
|
-
* edge round it.
|
|
404
|
+
* edge round it. Each person may have only the edge, or nothing
|
|
405
|
+
* (presence-style.ts).
|
|
404
406
|
*/
|
|
405
407
|
export const Presence = ({
|
|
406
408
|
active,
|
|
@@ -413,11 +415,12 @@ export const Presence = ({
|
|
|
413
415
|
guess?: Guess;
|
|
414
416
|
iframe?: HTMLIFrameElement | null;
|
|
415
417
|
}) => {
|
|
418
|
+
const style = usePresenceStyle();
|
|
416
419
|
const { leaving, shown } = usePresenceExit(active);
|
|
417
|
-
if (!shown) {
|
|
420
|
+
if (!shown || style === "off") {
|
|
418
421
|
return null;
|
|
419
422
|
}
|
|
420
|
-
if (iframe === undefined && !blank) {
|
|
423
|
+
if (style === "edge" || (iframe === undefined && !blank)) {
|
|
421
424
|
return <PresenceEdge leaving={leaving} />;
|
|
422
425
|
}
|
|
423
426
|
return (
|
|
@@ -7,8 +7,20 @@ import {
|
|
|
7
7
|
useState,
|
|
8
8
|
} from "react";
|
|
9
9
|
import { withBase } from "../base";
|
|
10
|
+
import { setPageStyle } from "../canvas/page-style";
|
|
10
11
|
import { VIEWPORTS } from "../canvas/viewports";
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Holds a thumbnail's page still (see the effect in ScaledFrame); Safari
|
|
15
|
+
* before 18.2 knows only the -webkit- way to hide a scrollbar.
|
|
16
|
+
*/
|
|
17
|
+
const STILL_ID = "studio-still";
|
|
18
|
+
const STILL_CSS = `
|
|
19
|
+
html, body { overflow: hidden !important; }
|
|
20
|
+
* { scrollbar-width: none !important; }
|
|
21
|
+
::-webkit-scrollbar { display: none !important; }
|
|
22
|
+
`;
|
|
23
|
+
|
|
12
24
|
/** How a scaled page sits in its box: its size there, and how far across. */
|
|
13
25
|
interface Fitted {
|
|
14
26
|
left: number;
|
|
@@ -89,23 +101,23 @@ export const ScaledFrame = ({
|
|
|
89
101
|
);
|
|
90
102
|
// A thumbnail is a still of the page's top: nobody can scroll it, so its
|
|
91
103
|
// page doesn't scroll, at its root or its body (either can be the
|
|
92
|
-
// document's scroller), and no scrollbar shows in it or narrows the page
|
|
104
|
+
// document's scroller), and no scrollbar shows in it or narrows the page,
|
|
105
|
+
// nor on a scroller in the view (an app's main pane): the still is what
|
|
106
|
+
// the page looks like where scrollbars only show while scrolling.
|
|
93
107
|
// A page in use scrolls as it would anywhere; back to a still, it shows
|
|
94
|
-
// its top again.
|
|
108
|
+
// its top again.
|
|
95
109
|
useEffect(() => {
|
|
96
110
|
if (!iframe) {
|
|
97
111
|
return;
|
|
98
112
|
}
|
|
99
113
|
const hold = () => {
|
|
100
114
|
const page = iframe.contentDocument;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
if (!interactive && page?.body) {
|
|
106
|
-
iframe.contentWindow?.scrollTo(0, 0);
|
|
107
|
-
page.body.scrollTop = 0;
|
|
115
|
+
setPageStyle(page, STILL_ID, STILL_CSS, !interactive);
|
|
116
|
+
if (interactive || !page?.body) {
|
|
117
|
+
return;
|
|
108
118
|
}
|
|
119
|
+
iframe.contentWindow?.scrollTo(0, 0);
|
|
120
|
+
page.body.scrollTop = 0;
|
|
109
121
|
};
|
|
110
122
|
hold();
|
|
111
123
|
iframe.addEventListener("load", hold);
|
|
@@ -61,6 +61,18 @@ export const SETTINGS_SECTIONS: SettingsPageRow[] = [
|
|
|
61
61
|
() => import("../pages/profile"),
|
|
62
62
|
"ProfileSettings"
|
|
63
63
|
),
|
|
64
|
+
page(
|
|
65
|
+
{
|
|
66
|
+
group: PERSONAL,
|
|
67
|
+
id: "canvas",
|
|
68
|
+
icon: "Eye",
|
|
69
|
+
label: msg`Canvas`,
|
|
70
|
+
lead: msg`How the canvas shows you what agents are doing. Kept in this browser.`,
|
|
71
|
+
running: true,
|
|
72
|
+
},
|
|
73
|
+
() => import("../pages/canvas-settings"),
|
|
74
|
+
"CanvasSettings"
|
|
75
|
+
),
|
|
64
76
|
page(
|
|
65
77
|
{
|
|
66
78
|
group: WORKSPACE,
|
package/app/shell/sidebar.tsx
CHANGED
|
@@ -84,5 +84,5 @@ export const SidebarSection = ({
|
|
|
84
84
|
/** Dex's own mark, from the app's icon. */
|
|
85
85
|
export const ProductMark = () => (
|
|
86
86
|
// biome-ignore lint/performance/noImgElement: the studio runs on Vite, not Next
|
|
87
|
-
<img alt="" height={18} src={`${BASE}/
|
|
87
|
+
<img alt="" height={18} src={`${BASE}/dex-icon.svg`} width={18} />
|
|
88
88
|
);
|
package/app/studio-ui.d.ts
CHANGED
|
@@ -10,8 +10,6 @@ declare module "virtual:studio-ui" {
|
|
|
10
10
|
export const ui: {
|
|
11
11
|
/** `ui.chromeTheme`: the interface's variables mapped to the design system's. */
|
|
12
12
|
chromeTheme?: ChromeTheme;
|
|
13
|
-
/** `ui.icons`: the set the interface draws with, Lucide if unset. */
|
|
14
|
-
icons?: "phosphor" | "lucide" | "hugeicons";
|
|
15
13
|
locale?: string;
|
|
16
14
|
subtitle?: string;
|
|
17
15
|
theme?: "studio" | "design-system";
|
|
@@ -58,13 +56,6 @@ declare module "virtual:studio-threads" {
|
|
|
58
56
|
export const threads: PublicThread[];
|
|
59
57
|
}
|
|
60
58
|
|
|
61
|
-
declare module "virtual:studio-icons" {
|
|
62
|
-
import type { IconGlyphs } from "./icons/types";
|
|
63
|
-
|
|
64
|
-
/** The chosen set's glyphs (`ui.icons`), by name. */
|
|
65
|
-
export const glyphs: IconGlyphs;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
59
|
declare module "virtual:studio-design-system" {
|
|
69
60
|
import type { StudioDesignSystem } from "../src/shared/design-system.ts";
|
|
70
61
|
|