diff --git a/examples/DEMO-106--VALUATION-NEW--20260628-1628.omz b/examples/DEMO-106--VALUATION-NEW--20260628-1628.omz index b5edb83..65d9ee0 100644 Binary files a/examples/DEMO-106--VALUATION-NEW--20260628-1628.omz and b/examples/DEMO-106--VALUATION-NEW--20260628-1628.omz differ diff --git a/media/om-core-logo-transparent-new.png b/media/om-core-logo-transparent-new.png index 9662e95..c8039e5 100644 Binary files a/media/om-core-logo-transparent-new.png and b/media/om-core-logo-transparent-new.png differ diff --git a/package.json b/package.json index 37e12e4..fa33964 100644 --- a/package.json +++ b/package.json @@ -381,10 +381,10 @@ "vscode:prepublish": "npm run build", "build": "node scripts/build.mjs", "build:ext": "esbuild ./src/extension.ts --bundle --platform=node --format=cjs --external:vscode --loader:.md=text --outfile=dist/extension.js", - "build:webview": "esbuild ./webview/main.ts --bundle --platform=browser --format=iife --outfile=dist/webview.js && node -e \"require('fs').copyFileSync('webview/index.html','dist/index.html')\"", + "build:webview": "esbuild ./webview/main.ts --bundle --platform=browser --format=iife --loader:.png=dataurl --outfile=dist/webview.js && node -e \"require('fs').copyFileSync('webview/index.html','dist/index.html')\"", "build:bridge": "esbuild ./bridge/server.ts --bundle --platform=node --format=cjs --external:ws --outfile=dist/bridge.js", "watch:ext": "esbuild ./src/extension.ts --bundle --platform=node --format=cjs --external:vscode --loader:.md=text --outfile=dist/extension.js --watch", - "watch:webview": "esbuild ./webview/main.ts --bundle --platform=browser --format=iife --outfile=dist/webview.js --watch", + "watch:webview": "esbuild ./webview/main.ts --bundle --platform=browser --format=iife --loader:.png=dataurl --outfile=dist/webview.js --watch", "compile": "tsc --noEmit", "test": "esbuild ./test-harness.ts --bundle --platform=node --format=cjs --external:vscode --outfile=dist/test-harness.js && node dist/test-harness.js", "web": "npm run build && node dist/bridge.js", diff --git a/scripts/build.mjs b/scripts/build.mjs index de256b0..a6d2ebe 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -48,13 +48,13 @@ await build({ }); await build({ entryPoints: ["webview/main.ts"], bundle: true, platform: "browser", format: "iife", - define: guiDefine, outfile: "dist/webview.js", + define: guiDefine, loader: { ".png": "dataurl" }, outfile: "dist/webview.js", }); await build({ // ESM variant of the om-gui library: exports mount()/transports, no self-mount. // Hosts that can import modules (om-tools-web, future embedders) use this. entryPoints: ["webview/index.ts"], bundle: true, platform: "browser", format: "esm", - define: guiDefine, outfile: "dist/webview.mjs", + define: guiDefine, loader: { ".png": "dataurl" }, outfile: "dist/webview.mjs", }); copyFileSync("webview/index.html", "dist/index.html"); // Bundled examples: repo-root examples/ + shared/catalog.json → dist/examples/. diff --git a/shared/messages.ts b/shared/messages.ts index 7af9d9d..17ca9c7 100644 --- a/shared/messages.ts +++ b/shared/messages.ts @@ -14,6 +14,7 @@ export const LINKS = { github: "https://github.com/cloudcell/om-tools", discord: "https://discord.gg/GfU5ypAbaD", docs: "https://cloudcell.github.io/om-docs/", + vscodeExt: "https://marketplace.visualstudio.com/items?itemName=cloudcell.om-tools", } as const; export const LINK_URLS: readonly string[] = Object.values(LINKS); diff --git a/src/assets.d.ts b/src/assets.d.ts index c94d67b..23e750b 100644 --- a/src/assets.d.ts +++ b/src/assets.d.ts @@ -2,3 +2,7 @@ declare module "*.md" { const content: string; export default content; } +declare module "*.png" { + const src: string; // bundled as a data-URI (esbuild loader:.png=dataurl) + export default src; +} diff --git a/src/extension.ts b/src/extension.ts index fcf8d94..269e9d4 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -982,7 +982,7 @@ function getHtml(context: vscode.ExtensionContext, webview: vscode.Webview): str - + ${uiStateMeta}OM Core diff --git a/webview/app.ts b/webview/app.ts index 87c3c41..0f2e1cc 100644 --- a/webview/app.ts +++ b/webview/app.ts @@ -40,7 +40,8 @@ export async function mount(root: HTMLElement, opts: MountOptions): Promise shell.openExampleById(id) }); // Status updates from the host (connecting/connected/disconnected/error). transport.onStatus((status, message, extra) => { diff --git a/webview/assets/om-core-logo.png b/webview/assets/om-core-logo.png new file mode 100644 index 0000000..efb8ac9 Binary files /dev/null and b/webview/assets/om-core-logo.png differ diff --git a/webview/components/appShell.ts b/webview/components/appShell.ts index 60f01ab..1284d50 100644 --- a/webview/components/appShell.ts +++ b/webview/components/appShell.ts @@ -7,6 +7,8 @@ import { el, clear, ICONS, NOT_IN_MVP_TITLE } from "../dom"; import { materialIconSvg as msym, brandIconSvg, type MaterialIcon } from "../menuIcons"; import { tipsEnabled, setTipsEnabled, resetTips } from "../tips"; import { startTour } from "../tour"; +import { guiVersionShort } from "../version"; +import logoPng from "../assets/om-core-logo.png"; import { ModelBrowser } from "./modelBrowser"; import { MultilevelGrid } from "./multilevelGrid"; import { RulePanel } from "./rulePanel"; @@ -490,7 +492,7 @@ export class AppShell { document.addEventListener("keydown", (e) => this.onShortcut(e), true); window.addEventListener("blur", () => this.closeAllMenus()); mb.appendChild(el("div", { class: "spacer" })); - const indicator = el("div", { class: "engine-indicator" }, [ + const indicator = el("div", { class: "engine-indicator", "data-tour": "engine-status" }, [ el("span", { class: "engine-dot" }, []), el("span", { class: "engine-text" }, ["disconnected"]), ]); @@ -537,11 +539,18 @@ export class AppShell { * (native new-tab navigation, keyboard-focusable, no popup-blocker involvement); buttons * in the VS Code webview that ask the host to open the URL — which it only does when the * URL is one of the fixed `LINKS` destinations. */ + /** One external-URL open path for menu items: native new-tab in a browser + * host, the LINKS-allowlisted openExternal bridge in the VS Code webview. */ + private openExternalLink(url: string): void { + if (this.store.api.supportsNativeExternalLinks) window.open(url, "_blank", "noopener"); + else void this.store.api.openExternal(url); + } + private buildLinkButtons(): HTMLElement { - const defs: { icon: string; title: string; label: string; url: string }[] = [ + const defs: { icon: string; title: string; label: string; url: string; tour?: string }[] = [ { icon: brandIconSvg("github"), title: "Open Modeling on GitHub", label: "GitHub repository", url: LINKS.github }, - { icon: brandIconSvg("discord"), title: "Open Modeling Discord", label: "Discord community", url: LINKS.discord }, - { icon: msym("menu_book"), title: "Open Modeling documentation", label: "Documentation", url: LINKS.docs }, + { icon: brandIconSvg("discord"), title: "Open Modeling Discord", label: "Discord community", url: LINKS.discord, tour: "link-discord" }, + { icon: msym("menu_book"), title: "Open Modeling documentation", label: "Documentation", url: LINKS.docs, tour: "link-docs" }, ]; const group = el("div", { class: "link-btns", role: "group", "aria-label": "External links" }); for (const d of defs) { @@ -549,6 +558,7 @@ export class AppShell { class: "link-btn", title: d.title, "aria-label": `${d.title} — opens in your browser`, + ...(d.tour ? { "data-tour": d.tour } : {}), }; const children = [el("span", { class: "link-icon", html: d.icon })]; group.appendChild( @@ -760,8 +770,10 @@ export class AppShell { { icon: msym("menu_book"), label: "Take the Tour…", fn: () => startTour() }, { icon: msym("info"), label: "Show Tips", checked: tipsEnabled(), fn: () => setTipsEnabled(!tipsEnabled()) }, { icon: msym("refresh"), label: "Reset Tips…", fn: () => resetTips() }, + { icon: msym("open_in_new"), label: "Get the VS Code Extension…", fn: () => this.openExternalLink(LINKS.vscodeExt) }, { sep: true }, - { icon: msym("info"), label: "About OM Core", fn: () => alertDialog("About OM Core", "OM Core — multidimensional modeling engine GUI.\nVSCode/VSCodium extension connecting to the om-core runtime.\n\nhttps://cloudcell.github.io/om-docs/") }, + { icon: msym("info"), label: "About OM Core", fn: () => alertDialog("About OM Core", + `OM Core — multidimensional modeling engine for structured financial,\noperational, and analytical models.\n\nCopyright © 2026 Alexander Bikeyev.\nPublished by Cloudcell Limited.\n\nLicensed under the GNU Affero General Public License v3.0.\nCommercial licensing may be available separately.\n\nhttps://cloudcell.github.io/om-docs/\n\nVersion: gui ${guiVersionShort}`, logoPng) }, ]; } @@ -899,6 +911,16 @@ export class AppShell { private async openExample() { const ex = await examplePickerDialog("Open Example", CATALOG); if (!ex) return; + await this.openExampleById(ex.id); + } + + /** Open a catalog example by id — used by Open Example… and the guided tour + * (which loads a real model to tour against). Same flow as the picker: + * .omz session first, plain model load otherwise, confirmDirty protects + * unsaved work. */ + async openExampleById(id: string): Promise { + const ex = CATALOG.find((e) => e.id === id); + if (!ex) return; const ref = `om-example:${ex.id}`; // .omz examples carry a saved session — apply it the way File → Open does // for a picked bundle; anything unreadable falls back to the model load. diff --git a/webview/components/dialogs.ts b/webview/components/dialogs.ts index 242f0d1..4290025 100644 --- a/webview/components/dialogs.ts +++ b/webview/components/dialogs.ts @@ -168,7 +168,7 @@ export function choiceDialog(title: string, message: string, choices: DialogChoi } /** Show an alert dialog. Returns when dismissed. */ -export function alertDialog(title: string, message: string): Promise { +export function alertDialog(title: string, message: string, image?: string): Promise { return new Promise((resolve) => { const ov = ensureOverlay(); clear(ov); @@ -179,10 +179,16 @@ export function alertDialog(title: string, message: string): Promise { fontFamily: "-apple-system, system-ui, sans-serif", } }) as HTMLElement; - const label = el("div", { style: { fontSize: "13px", fontWeight: "600", marginBottom: "8px", color: "var(--dlg-title)" } }, [title]); + // An image (e.g. the About logo) switches the dialog to Qt's centred layout. + const centered = image ? { textAlign: "center" } : {}; + if (image) dlg.appendChild(el("img", { src: image, alt: "", style: { + display: "block", margin: "0 auto 12px", maxWidth: "240px", maxHeight: "120px", objectFit: "contain", + } })); + + const label = el("div", { style: { fontSize: "13px", fontWeight: "600", marginBottom: "8px", color: "var(--dlg-title)", ...centered } }, [title]); dlg.appendChild(label); - const msg = el("div", { style: { fontSize: "13px", color: "var(--dlg-text)", marginBottom: "16px", lineHeight: "1.4", whiteSpace: "pre-line" } }, [message]); + const msg = el("div", { style: { fontSize: "13px", color: "var(--dlg-text)", marginBottom: "16px", lineHeight: "1.4", whiteSpace: "pre-line", ...centered } }, [message]); dlg.appendChild(msg); const btnRow = el("div", { style: { display: "flex", justifyContent: "flex-end", gap: "8px" } }) as HTMLElement; diff --git a/webview/components/modelBrowser.ts b/webview/components/modelBrowser.ts index d8af725..b13dd21 100644 --- a/webview/components/modelBrowser.ts +++ b/webview/components/modelBrowser.ts @@ -33,19 +33,24 @@ export class ModelBrowser { private refresh(tree: HTMLElement) { clear(tree); - // Dimensions root + // Dimensions root — data-tour anchors the guided tour's concept step. const dimRoot = this.makeTreeNode("Dimensions", kindIcon("dimension"), true, () => this.dimRootMenu()); + (dimRoot.querySelector(".tree-row") as HTMLElement).dataset.tour = "dims"; const dimChildren = (dimRoot as any)._children as HTMLElement; for (const dim of [...this.store.visibleDims()].sort(ModelBrowser.byName)) { const node = this.makeTreeNode(`${dim.name} (${dim.items})`, kindIcon("dimension"), false, () => this.dimMenu(dim)); // Sequential dimension: the same link mark as its pivot chip (issue #2; was "→"). if (this.store.dimIsSeq(dim.id)) node.querySelector(".tree-label .tree-count")?.before(seqLinkIcon()); + // data-tour anchors the guided tour's set-vs-sequence steps; "@" is covered by its own. + if (dim.name !== "@") (node.querySelector(".tree-row") as HTMLElement).dataset.tour = + this.store.dimIsSeq(dim.id) ? "dim-seq" : "dim-set"; dimChildren.appendChild(node); } tree.appendChild(dimRoot); // Cubes root const cubeRoot = this.makeTreeNode("Cubes", kindIcon("cube"), true, () => this.cubeRootMenu()); + (cubeRoot.querySelector(".tree-row") as HTMLElement).dataset.tour = "cubes"; const cubeChildren = (cubeRoot as any)._children as HTMLElement; for (const cube of [...this.store.visibleCubes()].sort(ModelBrowser.byName)) { cubeChildren.appendChild(this.makeTreeNode(`${cube.name} (${cube.dimensions})`, kindIcon("cube"), false, () => this.cubeMenu(cube))); @@ -54,6 +59,7 @@ export class ModelBrowser { // Views root const viewRoot = this.makeTreeNode("Views", kindIcon("view"), true, () => this.viewRootMenu()); + (viewRoot.querySelector(".tree-row") as HTMLElement).dataset.tour = "views"; const viewChildren = (viewRoot as any)._children as HTMLElement; for (const view of [...this.store.visibleViews()].sort(ModelBrowser.byName)) { const viewNode = this.makeTreeNode(view.name, kindIcon("view"), false, () => this.viewMenu(view)); diff --git a/webview/components/pivotBar.ts b/webview/components/pivotBar.ts index 105ca94..afbe059 100644 --- a/webview/components/pivotBar.ts +++ b/webview/components/pivotBar.ts @@ -55,8 +55,8 @@ export class PivotBar { const container = el("div", { class: "pivot-canvas" }); const frame = el("div", { class: "pc-frame" }); - const topLeft = el("div", { class: "pc-topleft drop-zone", "data-zone": "page" }); - const gridMount = el("div", { class: "pc-grid" }); + const topLeft = el("div", { class: "pc-topleft drop-zone", "data-zone": "page", "data-tour": "pivot" }); + const gridMount = el("div", { class: "pc-grid", "data-tour": "grid" }); const pageRight = el("div", { class: "pc-pageright drop-zone", "data-zone": "col" }); const bottom = el("div", { class: "pc-bottom drop-zone", "data-zone": "row" }); @@ -117,7 +117,7 @@ export class PivotBar { const curName = items.find((it) => it.id === curId)?.name || (items[0]?.name || "\u2014"); const label = el("span", {}, [`${name}: ${curName}`]); const arrow = el("span", { class: "chip-arrow" }); - const chip = el("div", { class: cls, draggable: "true", title: `Drag to move; click to pick ${name} item` }, + const chip = el("div", { class: cls, draggable: "true", title: `Drag to move; click to pick ${name} item`, "data-tour": dimId === "@" ? "at-dim" : null }, [grip, label, seqMark, arrow].filter(Boolean) as HTMLElement[]); chip.addEventListener("click", (e) => { e.stopPropagation(); this.showPageDropdown(chip, dimId, items); }); this.setupChipDrag(chip, dimId, zone); @@ -125,7 +125,7 @@ export class PivotBar { } // AxisChip / HeaderChip: grip + name - const chip = el("div", { class: cls, draggable: "true", title: `Drag to move ${name}` }, + const chip = el("div", { class: cls, draggable: "true", title: `Drag to move ${name}`, "data-tour": dimId === "@" ? "at-dim" : null }, [grip, el("span", {}, [name]), seqMark].filter(Boolean) as HTMLElement[]); this.setupChipDrag(chip, dimId, zone); return chip; diff --git a/webview/components/rulePanel.ts b/webview/components/rulePanel.ts index 25396a0..c80dab4 100644 --- a/webview/components/rulePanel.ts +++ b/webview/components/rulePanel.ts @@ -128,7 +128,7 @@ export class RulePanel { // Channel pills (Qt `ChannelFilterBar`): a filter on the `@` system dimension, not on cubes (issue #3). // Click selects one channel (click again clears), Ctrl/Cmd+click adds or removes; none selected = all rules. // Qt disables the bar while a rule is edited. - const filterBar = el("div", { class: "channel-filter", role: "group", "aria-label": "Filter rules by channel" }); + const filterBar = el("div", { class: "channel-filter", role: "group", "aria-label": "Filter rules by channel", "data-tour": "channel-filter" }); for (const ch of RULE_CHANNELS) { const n = counts.get(ch.id) || 0, on = this.selectedChannels.has(ch.id); const short = ch.id.replace("@.", ""); diff --git a/webview/styles.css b/webview/styles.css index ad702d2..4c8926f 100644 --- a/webview/styles.css +++ b/webview/styles.css @@ -892,9 +892,14 @@ body.splitter-dragging-y, body.splitter-dragging-y * { cursor: row-resize !impor .om-tour { position: fixed; z-index: 2600; width: 280px; padding: 12px 14px; - background: var(--popup-bg); color: var(--text); - border: 1px solid var(--border-strong); border-radius: 10px; - box-shadow: var(--dlg-shadow); font-size: 13px; line-height: 1.4; + /* Bubble matches the pointer: one solid cream shape in both themes (dark text + * pinned for contrast — --text is light in the dark theme). The shadow is a + * filter, not box-shadow, so the arrow child shares one silhouette. */ + --tour-bg: #fdefd9; + background: var(--tour-bg); color: #1c1c1e; + border-radius: 10px; + filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35)); + font-size: 13px; line-height: 1.4; animation: om-tip-in .18s ease-out; } .om-tour.centered { left: 50%; top: 50%; transform: translate(-50%, -50%); } @@ -907,9 +912,24 @@ body.splitter-dragging-y, body.splitter-dragging-y * { cursor: row-resize !impor color: var(--text-muted); font: inherit; font-size: 12px; cursor: pointer; } .om-tour-skip:hover { color: var(--text); } +/* Step link (e.g. marketplace CTA) — own line under the text, accent-coloured; + * in a browser host,