@filipc77/cowrite 0.6.14 → 0.6.15

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.
@@ -1108,7 +1108,7 @@ function createPreviewServer(store, projectDir, port, initialFile) {
1108
1108
  // bin/cowrite.ts
1109
1109
  import updateNotifier from "update-notifier";
1110
1110
  import "module";
1111
- var version = true ? "0.6.14" : createRequire(import.meta.url)("../package.json").version;
1111
+ var version = true ? "0.6.15" : createRequire(import.meta.url)("../package.json").version;
1112
1112
  var USAGE = `
1113
1113
  cowrite \u2014 Live commenting plugin for coding agent sessions
1114
1114
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipc77/cowrite",
3
- "version": "0.6.14",
3
+ "version": "0.6.15",
4
4
  "description": "Live commenting and inline editing plugin for coding agent sessions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -77,7 +77,11 @@ export function createEditor(container, options = {}) {
77
77
  export function setMarkdownContent(markdown) {
78
78
  if (!editor) return;
79
79
  isProgrammaticUpdate = true;
80
+ // Preserve scroll position — setContent resets cursor which causes scroll jumps
81
+ const scrollEl = editor.view.dom.closest('.content-panel') || editor.view.dom.parentElement;
82
+ const scrollTop = scrollEl?.scrollTop ?? 0;
80
83
  editor.commands.setContent(markdown, false);
84
+ if (scrollEl) scrollEl.scrollTop = scrollTop;
81
85
  isProgrammaticUpdate = false;
82
86
  }
83
87
 
@@ -5,6 +5,7 @@ import { send } from './ws-client.js';
5
5
  import { pushUndo } from './undo-manager.js';
6
6
  import { loadUndoStack } from './undo-manager.js';
7
7
  import { applyHighlights } from './comment-highlight.js';
8
+ import { renderComments } from './comment-sidebar.js';
8
9
  import { $ } from './utils.js';
9
10
 
10
11
  let pendingUpdate = null;
@@ -158,6 +159,8 @@ export function handleFileUpdate(msg) {
158
159
  if (editor) {
159
160
  // Apply content update
160
161
  setMarkdownContent(msg.content);
162
+ // Re-render comments so orphan checks run against fresh editor content
163
+ renderComments();
161
164
  postProcessContent().then(() => applyHighlights(editor, true));
162
165
  }
163
166
  }
@@ -174,6 +177,7 @@ export function applyPendingUpdate() {
174
177
  state.currentHtml = msg.html;
175
178
  state.editorDirty = false;
176
179
  setMarkdownContent(msg.content);
180
+ renderComments();
177
181
  const editor = getEditor();
178
182
  postProcessContent().then(() => applyHighlights(editor, true));
179
183
  }