pi-studio 0.11.12 → 0.11.13

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 CHANGED
@@ -4,6 +4,11 @@ All notable changes to `pi-studio` are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.11.13] — 2026-11-06
8
+
9
+ ### Fixed
10
+ - A workaround for a crash in Muxy 2.3.0's browser on Studio's tab title. Muxy can crash on some non-ASCII characters in a title, and Studio's title had them, such as the ellipsis in "Running…". Studio's tab titles are now plain ASCII, with " | " between their parts: "…" becomes "...", "·" and "—" within a part become "-", "●" becomes "*", "π" becomes "pi", accents are dropped, and each remaining run of other characters becomes "?". This applies to Studio's pages, the tab that waits for a new Studio tab, and the image viewer. Only titles change; page content keeps its characters. Files that open as themselves in a tab, such as a PDF, keep the title the browser gives them.
11
+
7
12
  ## [0.11.12] — 2026-11-05
8
13
 
9
14
  ### Changed
package/ROADMAP.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  This is the current planning source of truth for Studio work. `NEXT-STAGE.md` is historical; `TODO.md` tracks smaller backlog items that are not yet assigned to a release.
4
4
 
5
- ## Current status (5 Nov 2026)
5
+ ## Current status (6 Nov 2026)
6
6
 
7
- `0.11.12` is the current release. Studio is in a feature freeze from `0.11.9`, for use in normal work. Before the freeze, `0.11.9` added the images and PDFs a REPL entry's code saved, shown under the entry, and a PDF header that fits on one line. Each release since has been an approved exception. `0.11.10` works with pi-repl `0.12.1` so that, with both loaded, the agent is told each REPL record entry once. `0.11.11` gets Studio's URL out of a terminal too narrow to show it: `/studio --copy-url` copies it, and `PI_STUDIO_URL_FILE` keeps it in a file for programs ([#7](https://github.com/omaclaren/pi-studio/issues/7)). `0.11.12` makes **Follow** one switch, fixes two WebKit scrolling glitches in Muxy, and lines Working's sections up under their step. During the freeze, changes are limited to fixes for failures in normal use, lost data, effects on other people's processes or files, and security. [TODO.md](TODO.md) lists the known limits and what comes after the freeze.
7
+ `0.11.13` is the current release. Studio is in a feature freeze from `0.11.9`, for use in normal work. Before the freeze, `0.11.9` added the images and PDFs a REPL entry's code saved, shown under the entry, and a PDF header that fits on one line. Each release since has been an approved exception. `0.11.10` works with pi-repl `0.12.1` so that, with both loaded, the agent is told each REPL record entry once. `0.11.11` gets Studio's URL out of a terminal too narrow to show it: `/studio --copy-url` copies it, and `PI_STUDIO_URL_FILE` keeps it in a file for programs ([#7](https://github.com/omaclaren/pi-studio/issues/7)). `0.11.12` makes **Follow** one switch, fixes two WebKit scrolling glitches in Muxy, and lines Working's sections up under their step. `0.11.13` gives Studio's tabs ASCII titles, working around a crash in Muxy 2.3.0's browser on the ellipsis in Studio's title. During the freeze, changes are limited to fixes for failures in normal use, lost data, effects on other people's processes or files, and security. [TODO.md](TODO.md) lists the known limits and what comes after the freeze.
8
8
 
9
9
  `0.10.0` (14 Oct) made the buffer-first workspace the default, as **dual editor mode** (Prompt and Document), with **single editor mode** one switch away (footer button, `/studio --single`). It went through real course use as private alpha candidates 49–69. The `PI_STUDIO_*` flags described further down are development overrides only: when any is set it decides, and the mode switch is hidden.
10
10
 
@@ -4896,6 +4896,23 @@
4896
4896
  return "data:image/svg+xml," + encodeURIComponent(svg);
4897
4897
  }
4898
4898
 
4899
+ // shared/studio-title.js explains: Muxy 2.3.0's browser can crash on a non-ASCII tab title.
4900
+ // test/studio-title.test.js checks this copy against that one.
4901
+ function toStudioAsciiTitle(value) {
4902
+ return String(value ?? "")
4903
+ .replace(/…/g, "...")
4904
+ .replace(/[·•–—−]/g, "-")
4905
+ .replace(/●/g, "*")
4906
+ .replace(/[‘’]/g, "'")
4907
+ .replace(/[“”]/g, "\"")
4908
+ .replace(/π/g, "pi")
4909
+ .normalize("NFKD")
4910
+ .replace(/[̀-ͯ]/g, "")
4911
+ .replace(/\s+/g, " ")
4912
+ .replace(/[^\x20-\x7e]+/g, "?")
4913
+ .trim();
4914
+ }
4915
+
4899
4916
  function updateDocumentTitle() {
4900
4917
  const modelText = modelLabel && modelLabel.trim() ? modelLabel.trim() : "none";
4901
4918
  const terminalText = terminalSessionLabel && terminalSessionLabel.trim() ? terminalSessionLabel.trim() : "unknown";
@@ -4907,7 +4924,7 @@
4907
4924
  const titlePrefix = getDynamicTitlePrefix();
4908
4925
  if (titlePrefix) titleParts.unshift(titlePrefix);
4909
4926
 
4910
- const nextTitle = titleParts.join(" · ");
4927
+ const nextTitle = toStudioAsciiTitle(titleParts.join(" | "));
4911
4928
  if (document.title !== nextTitle) {
4912
4929
  document.title = nextTitle;
4913
4930
  }
package/index.ts CHANGED
@@ -135,6 +135,7 @@ import { buildStudioHostingBootstrapState, createStudioBufferServerStore, STUDIO
135
135
  import { createStudioTurns, readStudioEditorMode, resolveStudioEditorFlags, writeStudioEditorMode } from "./shared/studio-editor-mode.js";
136
136
  import { createStudioUrlFile, STUDIO_URL_FILE_ENV } from "./shared/studio-url-file.js";
137
137
  import { copyStudioUrl } from "./shared/studio-copy-url.js";
138
+ import { toStudioAsciiTitle } from "./shared/studio-title.js";
138
139
  import { canonicalStudioDocumentPath, studioDocumentPathsReferToSameFile } from "./shared/studio-document-paths.js";
139
140
  import { resolveStudioHostingPage, studioHostingCommandError, studioHostingLocalLinkError } from "./shared/studio-document-entrypoints.js";
140
141
  import { systemThemeLacksTrueColor } from "./shared/studio-system-theme.js";
@@ -13716,7 +13717,7 @@ function buildStudioHtml(
13716
13717
  <head>
13717
13718
  <meta charset="utf-8" />
13718
13719
  <meta name="viewport" content="width=device-width,initial-scale=1" />
13719
- <title>${appTitle}</title>
13720
+ <title>${toStudioAsciiTitle(appTitle)}</title>
13720
13721
  <link rel="icon" href="${faviconHref}" type="image/svg+xml" />
13721
13722
  <style>
13722
13723
  :root {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-studio",
3
- "version": "0.11.12",
3
+ "version": "0.11.13",
4
4
  "description": "Two-pane browser workspace for pi with prompt/response editing, annotations, critiques, active quiz, prompt/response history, live previews, and tmux-backed REPL/literate REPL workflows",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,3 +1,5 @@
1
+ import { toStudioAsciiTitle } from "./studio-title.js";
2
+
1
3
  // Read-only transport/view chrome only. Neither helper grants resources,
2
4
  // registers a workspace nor attaches a file to an editable buffer.
3
5
  /** @param {{token: string, kind: string, path: string, resourceDir?: string, page?: number | null}} options */
@@ -16,7 +18,8 @@ export function buildStudioReadOnlyImagePage({ label, dataUrl, nonce }) {
16
18
  if (typeof dataUrl !== "string" || !/^data:image\/(?:png|jpeg|gif|webp|svg\+xml);base64,[A-Za-z0-9+/]*={0,2}$/.test(dataUrl)) throw Error("Only supported image data may be shown in the image viewer.");
17
19
  const escape = value => String(value || "Image").replace(/[&<>"']/g, char => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[char]);
18
20
  const title = escape(label);
19
- return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${title}</title>
21
+ const tabTitle = escape(toStudioAsciiTitle(label));
22
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${tabTitle}</title>
20
23
  <style nonce="${nonce}">html,body{margin:0;background:#171717;color:#e7e7e7;font:14px system-ui,sans-serif}header{position:sticky;top:0;display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px;background:#222;border-bottom:1px solid #444}h1{font-size:14px;font-weight:600;margin:0;overflow-wrap:anywhere}nav{display:flex;gap:6px}button{font:inherit;padding:5px 12px;background:transparent;color:inherit;border:1px solid #777;border-radius:5px;cursor:pointer}button[aria-pressed="true"]{background:#444}button:focus-visible{outline:2px solid #9bd;outline-offset:2px}.hint{color:#aaa;font-size:12px}main{padding:12px;overflow:auto}img{display:block;margin:auto}body[data-scale="fit"] img{max-width:100%;max-height:calc(100vh - 100px);width:auto;height:auto}body[data-scale="actual"] img{max-width:none;max-height:none}</style></head><body data-scale="fit">
21
24
  <header><h1>${title}</h1><nav aria-label="Image size"><button id="mediaFit" type="button" aria-pressed="true">Fit</button><button id="mediaActual" type="button" aria-pressed="false">Actual size</button></nav><span class="hint">Read-only image</span></header>
22
25
  <main><img src="${dataUrl}" alt="${title}"></main>
@@ -55,12 +55,13 @@ export function buildStudioPendingPage(options) {
55
55
 
56
56
  const kindLabel = kind === "document" ? "document" : (kind === "export" ? "export" : "preview");
57
57
  const helperQuery = new URLSearchParams({ token }).toString();
58
+ // The title stays ASCII (shared/studio-title.js); the heading keeps its ellipsis.
58
59
  return `<!doctype html>
59
60
  <html lang="en">
60
61
  <head>
61
62
  <meta charset="utf-8" />
62
63
  <meta name="viewport" content="width=device-width,initial-scale=1" />
63
- <title>Preparing Studio tab…</title>
64
+ <title>Preparing Studio tab...</title>
64
65
  <style nonce="${escapeHtmlAttribute(nonce)}">
65
66
  :root { color-scheme: light dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
66
67
  body { min-height: 100vh; margin: 0; display: grid; place-items: center; background: Canvas; color: CanvasText; }
@@ -0,0 +1,21 @@
1
+ // Tab titles for Studio's pages, in ASCII. Muxy 2.3.0's built-in browser can crash on a tab
2
+ // title with some non-ASCII characters: "Reading file content… · pi Studio · …" did, at the
3
+ // ellipsis. Which characters can do it isn't known, so a title keeps only printable ASCII.
4
+ // Page content keeps its characters. client/studio-client.js has a copy of this function for
5
+ // the live title; test/studio-title.test.js checks that the two agree.
6
+
7
+ /** @param {unknown} value */
8
+ export function toStudioAsciiTitle(value) {
9
+ return String(value ?? "")
10
+ .replace(/…/g, "...")
11
+ .replace(/[·•–—−]/g, "-")
12
+ .replace(/●/g, "*")
13
+ .replace(/[‘’]/g, "'")
14
+ .replace(/[“”]/g, "\"")
15
+ .replace(/π/g, "pi")
16
+ .normalize("NFKD")
17
+ .replace(/[̀-ͯ]/g, "")
18
+ .replace(/\s+/g, " ")
19
+ .replace(/[^\x20-\x7e]+/g, "?")
20
+ .trim();
21
+ }