pi-studio 0.5.46 → 0.5.47

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,13 @@ All notable changes to `pi-studio` are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.5.47] — 2026-04-07
8
+
9
+ ### Changed
10
+ - Raw-editor and editor-preview commenting now feel more unified: both surfaces use a contextual **Comment** action for selected text, while the dock footer keeps a de-emphasised **Line comment** fallback for current-line comments in **Editor (Raw)**.
11
+ - Preview-side **Comment** affordances now focus the new comment textarea more reliably after creation, including when the comments rail has to open.
12
+ - Clicking comment **Jump** now suppresses the raw-editor selection **Comment** pill for that programmatic selection, so jump-to-highlight does not look like a fresh comment prompt.
13
+
7
14
  ## [0.5.46] — 2026-04-07
8
15
 
9
16
  ### Added
@@ -306,6 +306,9 @@
306
306
  let pendingReviewNoteFocusId = null;
307
307
  let pendingReviewNoteInlineFocusId = null;
308
308
  let activePreviewCommentSelection = null;
309
+ let suppressEditorSelectionComment = false;
310
+ let suppressedEditorSelectionStart = null;
311
+ let suppressedEditorSelectionEnd = null;
309
312
  const previewJumpHighlightState = new WeakMap();
310
313
  const PREVIEW_ANNOTATION_PLACEHOLDER_PREFIX = "PISTUDIOANNOT";
311
314
  const annotationHelpers = globalThis.PiStudioAnnotationHelpers;
@@ -5407,7 +5410,8 @@
5407
5410
  function updateEditorSelectionCommentUi() {
5408
5411
  if (!editorSelectionCommentBtn) return;
5409
5412
  const hasSelection = Boolean(
5410
- editorView === "markdown"
5413
+ !suppressEditorSelectionComment
5414
+ && editorView === "markdown"
5411
5415
  && document.activeElement === sourceTextEl
5412
5416
  && typeof sourceTextEl.selectionStart === "number"
5413
5417
  && typeof sourceTextEl.selectionEnd === "number"
@@ -5420,6 +5424,14 @@
5420
5424
  }
5421
5425
  }
5422
5426
 
5427
+ function clearSuppressedEditorSelectionComment() {
5428
+ if (!suppressEditorSelectionComment) return;
5429
+ suppressEditorSelectionComment = false;
5430
+ suppressedEditorSelectionStart = null;
5431
+ suppressedEditorSelectionEnd = null;
5432
+ updateEditorSelectionCommentUi();
5433
+ }
5434
+
5423
5435
  function updateReviewNotesUi() {
5424
5436
  const descriptor = getCurrentStudioDocumentDescriptor();
5425
5437
  const count = reviewNotes.length;
@@ -5667,9 +5679,11 @@
5667
5679
  if (editorSelectionCommentBtn) {
5668
5680
  editorSelectionCommentBtn.hidden = true;
5669
5681
  }
5682
+ const shouldOpenReviewNotes = !isReviewNotesOpen();
5670
5683
  pendingReviewNoteFocusId = note.id;
5671
5684
  setReviewNotes(reviewNotes.concat([note]));
5672
- if (!isReviewNotesOpen()) {
5685
+ if (shouldOpenReviewNotes) {
5686
+ pendingReviewNoteFocusId = note.id;
5673
5687
  openReviewNotes();
5674
5688
  }
5675
5689
  const schedule = typeof window.requestAnimationFrame === "function"
@@ -5713,6 +5727,10 @@
5713
5727
  setStatus("Could not find the anchored location for this comment.", "warning");
5714
5728
  return;
5715
5729
  }
5730
+ suppressEditorSelectionComment = true;
5731
+ suppressedEditorSelectionStart = range.start;
5732
+ suppressedEditorSelectionEnd = range.end;
5733
+ updateEditorSelectionCommentUi();
5716
5734
  setEditorView("markdown");
5717
5735
  setActivePane("left");
5718
5736
  sourceTextEl.focus();
@@ -5723,6 +5741,7 @@
5723
5741
  schedule(() => {
5724
5742
  scrollEditorRangeIntoView(range);
5725
5743
  revealReviewNoteInPreview(note);
5744
+ updateEditorSelectionCommentUi();
5726
5745
  });
5727
5746
  }
5728
5747
 
@@ -7218,6 +7237,7 @@
7218
7237
  if (activePreviewCommentSelection) {
7219
7238
  clearPreviewCommentSelection();
7220
7239
  }
7240
+ clearSuppressedEditorSelectionComment();
7221
7241
  renderSourcePreview({ previewDelayMs: PREVIEW_INPUT_DEBOUNCE_MS });
7222
7242
  scheduleEditorMetaUpdate();
7223
7243
  updateEditorSelectionCommentUi();
@@ -7228,6 +7248,14 @@
7228
7248
  });
7229
7249
 
7230
7250
  sourceTextEl.addEventListener("select", () => {
7251
+ if (suppressEditorSelectionComment) {
7252
+ const selectionStart = typeof sourceTextEl.selectionStart === "number" ? sourceTextEl.selectionStart : 0;
7253
+ const selectionEnd = typeof sourceTextEl.selectionEnd === "number" ? sourceTextEl.selectionEnd : selectionStart;
7254
+ const matchesSuppressedSelection = selectionStart === suppressedEditorSelectionStart && selectionEnd === suppressedEditorSelectionEnd;
7255
+ if (!matchesSuppressedSelection && selectionEnd > selectionStart) {
7256
+ clearSuppressedEditorSelectionComment();
7257
+ }
7258
+ }
7231
7259
  updateEditorSelectionCommentUi();
7232
7260
  });
7233
7261
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-studio",
3
- "version": "0.5.46",
3
+ "version": "0.5.47",
4
4
  "description": "Two-pane browser workspace for pi with prompt/response editing, annotations, critiques, prompt/response history, and live Markdown/LaTeX/code preview",
5
5
  "type": "module",
6
6
  "license": "MIT",