pi-studio 0.1.4 → 0.1.5

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
@@ -12,7 +12,7 @@ All notable changes to `pi-studio` are documented here.
12
12
  - **Load response into editor** (for non-critique responses)
13
13
  - **Load critique (notes)**
14
14
  - **Load critique (full)**
15
- - **Copy response**
15
+ - **Copy response text**
16
16
  - Independent Markdown/Preview toggles for Editor and right pane.
17
17
  - `Auto-update response: On|Off` + `Get latest response` controls for terminal/editor-composability.
18
18
  - Source action: **Run editor text** to submit current editor text directly to the model.
@@ -22,7 +22,7 @@ All notable changes to `pi-studio` are documented here.
22
22
  - Math delimiter normalization before preview rendering for `\(...\)` and `\[...\]` syntax (fence-aware).
23
23
  - **Load file in editor** action in top controls (browser file picker into editor).
24
24
  - README screenshot gallery for dark/light workspace and critique/annotation views.
25
- - Response-side markdown highlighting toggle (`Highlight response: Off|On`) in `Response: Markdown` view, with local preference persistence.
25
+ - Response-side markdown highlighting toggle (`Highlight markdown: Off|On`) in `Response: Markdown` view, with local preference persistence.
26
26
  - Obsidian wiki-image syntax normalization (`![[path]]`, `![[path|alt]]`) before pandoc preview rendering.
27
27
 
28
28
  ### Changed
@@ -32,6 +32,7 @@ All notable changes to `pi-studio` are documented here.
32
32
  - Editor sync badge now tracks relation to latest response (`No response loaded`, `In sync with response`, `Edited since response`).
33
33
  - Footer continues to show explicit WS phase (`Connecting`, `Ready`, `Submitting`, `Disconnected`) alongside status text.
34
34
  - Running text and preparing annotated scaffolds are now separate explicit actions (no hidden header wrapping on send).
35
+ - Renamed file-backed header action from **Save Over** to **Save file**, with tooltip showing the current overwrite target.
35
36
  - Critique-specific load actions now focus on notes/full views and are only shown for structured critique responses.
36
37
  - Studio still live-updates latest response when assistant output arrives outside studio requests (e.g., manual send from pi editor).
37
38
  - Preview pane typography/style now follows the higher-fidelity `/preview-browser` rendering style more closely.
package/README.md CHANGED
@@ -31,7 +31,7 @@ Status: experimental alpha.
31
31
  - Response load helpers:
32
32
  - non-critique: **Load response into editor**
33
33
  - critique: **Load critique (notes)** / **Load critique (full)**
34
- - File actions: **Save As…**, **Save Over**, **Load file in editor**
34
+ - File actions: **Save As…**, **Save file**, **Load file in editor**
35
35
  - View toggles: `Editor: Markdown|Preview`, `Response: Markdown|Preview`
36
36
  - Optional markdown highlighting toggles for editor and response markdown views
37
37
  - Theme-aware browser UI based on current pi theme
package/WORKFLOW.md CHANGED
@@ -74,10 +74,10 @@ Rules:
74
74
 
75
75
  ## Required UI elements
76
76
 
77
- - Header actions: **Save As…**, **Save Over** (file-backed), **Load file in editor**
77
+ - Header actions: **Save As…**, **Save file** (file-backed), **Load file in editor**
78
78
  - Header view toggles: `Editor: Markdown|Preview`, `Response: Markdown|Preview`
79
79
  - Preview mode uses server-side `pandoc` rendering (math-aware) with plain-markdown fallback when renderer is unavailable.
80
- - Editor actions: **Insert annotation header**, **Run editor text**, **Critique editor text** (+ critique focus), **Send to pi editor**, **Copy editor**
80
+ - Editor actions: **Insert annotation header**, **Run editor text**, **Critique editor text** (+ critique focus), **Send to pi editor**, **Copy editor text**
81
81
  - Response actions include `Auto-update response: On|Off` + **Get latest response**
82
82
  - Source badge: `blank | last model response | file <path> | upload`
83
83
  - Response badge: `none | assistant response | assistant critique` (+ timestamp)
package/index.ts CHANGED
@@ -1477,9 +1477,9 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
1477
1477
  <option value="markdown">Response: Markdown</option>
1478
1478
  <option value="preview" selected>Response: Preview</option>
1479
1479
  </select>
1480
- <button id="saveAsBtn" type="button">Save As…</button>
1481
- <button id="saveOverBtn" type="button" disabled>Save Over</button>
1482
- <label class="file-label">Load file in editor<input id="fileInput" type="file" accept=".txt,.md,.markdown,.rst,.adoc,.tex,.json,.js,.ts,.py,.java,.c,.cpp,.go,.rs,.rb,.swift,.sh,.html,.css,.xml,.yaml,.yml,.toml" /></label>
1480
+ <button id="saveAsBtn" type="button" title="Save editor text to a new file path.">Save As…</button>
1481
+ <button id="saveOverBtn" type="button" title="Overwrite current file with editor text." disabled>Save file</button>
1482
+ <label class="file-label" title="Load a local file into editor text.">Load file in editor<input id="fileInput" type="file" accept=".txt,.md,.markdown,.rst,.adoc,.tex,.json,.js,.ts,.py,.java,.c,.cpp,.go,.rs,.rb,.swift,.sh,.html,.css,.xml,.yaml,.yml,.toml" /></label>
1483
1483
  </div>
1484
1484
  </header>
1485
1485
 
@@ -1502,10 +1502,10 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
1502
1502
  </select>
1503
1503
  <button id="critiqueBtn" type="button">Critique editor text</button>
1504
1504
  <button id="sendEditorBtn" type="button">Send to pi editor</button>
1505
- <button id="copyDraftBtn" type="button">Copy editor</button>
1505
+ <button id="copyDraftBtn" type="button">Copy editor text</button>
1506
1506
  <select id="highlightSelect" aria-label="Editor syntax highlighting">
1507
- <option value="off" selected>Highlight editor: Off</option>
1508
- <option value="on">Highlight editor: On</option>
1507
+ <option value="off" selected>Highlight markdown: Off</option>
1508
+ <option value="on">Highlight markdown: On</option>
1509
1509
  </select>
1510
1510
  </div>
1511
1511
  </div>
@@ -1530,14 +1530,14 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
1530
1530
  <option value="off">Auto-update response: Off</option>
1531
1531
  </select>
1532
1532
  <select id="responseHighlightSelect" aria-label="Response markdown highlighting">
1533
- <option value="off" selected>Highlight response: Off</option>
1534
- <option value="on">Highlight response: On</option>
1533
+ <option value="off" selected>Highlight markdown: Off</option>
1534
+ <option value="on">Highlight markdown: On</option>
1535
1535
  </select>
1536
1536
  <button id="pullLatestBtn" type="button" title="Fetch the latest assistant response when auto-update is off.">Get latest response</button>
1537
1537
  <button id="loadResponseBtn" type="button">Load response into editor</button>
1538
1538
  <button id="loadCritiqueNotesBtn" type="button" hidden>Load critique (notes)</button>
1539
1539
  <button id="loadCritiqueFullBtn" type="button" hidden>Load critique (full)</button>
1540
- <button id="copyResponseBtn" type="button">Copy response</button>
1540
+ <button id="copyResponseBtn" type="button">Copy response text</button>
1541
1541
  </div>
1542
1542
  </div>
1543
1543
  </section>
@@ -2030,10 +2030,25 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
2030
2030
  updateResultActionButtons();
2031
2031
  }
2032
2032
 
2033
+ function updateSaveFileTooltip() {
2034
+ if (!saveOverBtn) return;
2035
+
2036
+ const isFileBacked = sourceState.source === "file" && Boolean(sourceState.path);
2037
+ if (isFileBacked) {
2038
+ const target = sourceState.label || sourceState.path;
2039
+ saveOverBtn.title = "Overwrite current file: " + target;
2040
+ return;
2041
+ }
2042
+
2043
+ saveOverBtn.title = "Save file is available after opening a file or using Save As…";
2044
+ }
2045
+
2033
2046
  function syncActionButtons() {
2047
+ const canSaveOver = sourceState.source === "file" && Boolean(sourceState.path);
2048
+
2034
2049
  fileInput.disabled = uiBusy;
2035
2050
  saveAsBtn.disabled = uiBusy;
2036
- saveOverBtn.disabled = uiBusy || !(sourceState.source === "file" && sourceState.path);
2051
+ saveOverBtn.disabled = uiBusy || !canSaveOver;
2037
2052
  sendEditorBtn.disabled = uiBusy;
2038
2053
  sendRunBtn.disabled = uiBusy;
2039
2054
  copyDraftBtn.disabled = uiBusy;
@@ -2045,6 +2060,7 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
2045
2060
  insertHeaderBtn.disabled = uiBusy;
2046
2061
  critiqueBtn.disabled = uiBusy;
2047
2062
  lensSelect.disabled = uiBusy;
2063
+ updateSaveFileTooltip();
2048
2064
  updateResultActionButtons();
2049
2065
  }
2050
2066
 
@@ -2894,7 +2910,7 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
2894
2910
 
2895
2911
  try {
2896
2912
  await navigator.clipboard.writeText(latestResponseMarkdown);
2897
- setStatus("Copied response.", "success");
2913
+ setStatus("Copied response text.", "success");
2898
2914
  } catch (error) {
2899
2915
  setStatus("Clipboard write failed.", "warning");
2900
2916
  }
@@ -2930,7 +2946,7 @@ function buildStudioHtml(initialDocument: InitialStudioDocument | null, theme?:
2930
2946
 
2931
2947
  saveOverBtn.addEventListener("click", () => {
2932
2948
  if (!(sourceState.source === "file" && sourceState.path)) {
2933
- setStatus("Save Over is only available when source is a file path.", "warning");
2949
+ setStatus("Save file is only available when source is a file path.", "warning");
2934
2950
  return;
2935
2951
  }
2936
2952
 
@@ -3333,7 +3349,7 @@ export default function (pi: ExtensionAPI) {
3333
3349
  sendToClient(client, {
3334
3350
  type: "error",
3335
3351
  requestId: msg.requestId,
3336
- message: "Save Over is only available for file-backed documents.",
3352
+ message: "Save file is only available for file-backed documents.",
3337
3353
  });
3338
3354
  return;
3339
3355
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-studio",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Browser GUI for structured critique workflows in pi",
5
5
  "type": "module",
6
6
  "license": "MIT",