From 7748999a8b0c3ab5e7b107bf7c42f24580cb23aa Mon Sep 17 00:00:00 2001 From: haoyuren <13851610112@163.com> Date: Sun, 15 Mar 2026 01:57:17 -0500 Subject: Real-time comment sync, MCP server expansion, multi-tab terminal, UI fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix Socket.IO v0.9 ack parser to handle acks without data (6:::N format), fixing comment creation stuck at "sending" - Rewrite comment sync to use local state updates from socket events (new-comment, resolve-thread, reopen-thread, delete-thread, edit-message, delete-message) instead of REST re-fetches — instant UI updates - Optimistic updates for all comment actions (resolve, reopen, delete, reply, edit) - Fetch threads + contexts on project connect so editor highlights are correct from startup, not only when review panel is opened - Add comment context to store immediately after creation for instant highlight - Rename MCP server from overleaf-comments to lattex, add 6 new tools: reopen_comment, delete_comment, get_chat_messages, send_chat_message, list_project_files, compile_latex — all auto-granted permissions - Refactor terminal from fixed Terminal/Claude tabs to dynamic multi-tab with bottom tab bar and unlimited new terminal creation - Fix chat panel layout overflow pushing other components Co-Authored-By: Claude Opus 4.6 --- src/main/overleafSocket.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/main/overleafSocket.ts') diff --git a/src/main/overleafSocket.ts b/src/main/overleafSocket.ts index 195eb05..96d9138 100644 --- a/src/main/overleafSocket.ts +++ b/src/main/overleafSocket.ts @@ -301,11 +301,8 @@ export class OverleafSocket extends EventEmitter { this.joinedDocs.delete(docId) } - async applyOtUpdate(docId: string, ops: unknown[], version: number, hash: string): Promise { - // Use emitWithAck so the server's callback response comes back as a Socket.IO ack - // Do NOT send hash — Overleaf's document-updater hash check causes disconnect + rollback on mismatch - const result = await this.emitWithAck('applyOtUpdate', [docId, { doc: docId, op: ops, v: version }]) - if (result) console.log(`[applyOtUpdate] ack for ${docId} v=${version}`) + async applyOtUpdate(docId: string, ops: unknown[], version: number, hash?: string): Promise { + await this.emitWithAck('applyOtUpdate', [docId, { doc: docId, op: ops, v: version }]) } /** Get list of connected users with their cursor positions */ -- cgit v1.2.3