AI-native design editor. Open-source Figma alternative.
fix(collab): copy public desktop share links
rcoenen04ad2db00b9e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ecf505d78..20bd09173 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -37,6 +37,7 @@- Fix clone operations (duplicate, instance creation, clipboard copy) sharing mutable references with the original — editing fills, strokes, variable bindings, overrides, or vector networks on one no longer corrupts the other.- Fix instance overrides shallow-copied on clone — override values containing objects are now deep-copied.- Fix stale variable bindings not cleaned up when fills/strokes arrays shrink — any indexed sub-path is now handled, not just `/color`.+- Fix desktop "Share This File" links to use the public `https://app.openpencil.dev/share/{roomId}` URL instead of the internal `tauri://localhost` app scheme.- Fix tooltips around inspector dropdowns/popovers without breaking floating menu anchoring.- Harden MCP calls with bounded page-tree responses, oversized-result errors, JSON HTTP responses, and stale WebSocket cleanup.- Improve Figma boolean imports by preserving XOR operations as editable exclude nodes and falling back to imported fill geometry when boolean path reconstruction cannot produce a path.diff --git a/src/components/CollabPanel/context.ts b/src/components/CollabPanel/context.tsindex 454bc4953..df9bad421 100644--- a/src/components/CollabPanel/context.ts+++ b/src/components/CollabPanel/context.ts@@ -7,6 +7,7 @@ import { useI18n } from '@open-pencil/vue'import { DEFAULT_COLLAB_STATE, useCollabInjected } from '@/app/collab/use'import { toast } from '@/app/shell/ui'+import { getShareUrl } from '@/constants'function createCollabPanelContext() {const route = useRoute()@@ -26,7 +27,7 @@ function createCollabPanelContext() {const followingPeer = computed(() => collab?.followingPeer.value ?? null)const shareUrl = computed(() => {if (!state.value.roomId) return ''- return `${window.location.origin}/share/${state.value.roomId}`+ return getShareUrl(state.value.roomId)})const isJoining = computed(() => !!pendingRoomId.value && !state.value.connected)@@ -49,7 +50,7 @@ function createCollabPanelContext() {collab.setLocalName(nameDraft.value.trim())const roomId = collab.shareCurrentDoc()void router.push(`/share/${roomId}`)- void copy(`${window.location.origin}/share/${roomId}`)+ void copy(getShareUrl(roomId))toast.info('Link copied to clipboard')popoverOpen.value = false}diff --git a/src/components/MobileHud/context.ts b/src/components/MobileHud/context.tsindex 48bd480a8..bc84ffe42 100644--- a/src/components/MobileHud/context.ts+++ b/src/components/MobileHud/context.ts@@ -16,6 +16,7 @@ import { toolIcons } from '@/app/editor/icons'import { openFileDialog } from '@/app/shell/menu/use'import { toast } from '@/app/shell/ui'import type { ToolbarActionItem } from '@/components/Toolbar/types'+import { getShareUrl } from '@/constants'type MenuAction = ToolbarActionItem@@ -58,7 +59,7 @@ function createMobileHudContext() {if (!collab) returnconst roomId = collab.shareCurrentDoc()void router.push(`/share/${roomId}`)- void copy(`${window.location.origin}/share/${roomId}`)+ void copy(getShareUrl(roomId))toast.info('Link copied to clipboard')}diff --git a/src/constants.ts b/src/constants.tsindex c37d70c26..34706f632 100644--- a/src/constants.ts+++ b/src/constants.ts@@ -1,3 +1,5 @@+import { IS_BROWSER, IS_TAURI } from '@open-pencil/core/constants'+import ACP_DESIGN_CONTEXT from '@/app/ai/acp/design-context.md'export {@@ -65,6 +67,13 @@ export const TRYSTERO_APP_ID = 'openpencil'export const ROOM_ID_LENGTH = 8export const ROOM_ID_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789'+export const WEB_APP_ORIGIN = 'https://app.openpencil.dev'++export function getShareUrl(roomId: string): string {+ const base = IS_TAURI || !IS_BROWSER ? WEB_APP_ORIGIN : window.location.origin+ return `${base}/share/${roomId}`+}+export const PEER_COLORS: Color[] = [{ r: 0.96, g: 0.26, b: 0.21, a: 1 },{ r: 0.13, g: 0.59, b: 0.95, a: 1 },