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/overleafProtocol.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/main/overleafProtocol.ts') diff --git a/src/main/overleafProtocol.ts b/src/main/overleafProtocol.ts index 884aff2..abee516 100644 --- a/src/main/overleafProtocol.ts +++ b/src/main/overleafProtocol.ts @@ -65,16 +65,21 @@ export function parseSocketMessage(raw: string): ParsedMessage | null { return null } case '6': { - // Ack: 6:::N+[jsonData] - const ackMatch = raw.match(/^6:::(\d+)\+([\s\S]*)/) - if (ackMatch) { + // Ack with data: 6:::N+[jsonData] + // Ack without data: 6:::N + const ackWithData = raw.match(/^6:::(\d+)\+([\s\S]*)/) + if (ackWithData) { try { - const data = JSON.parse(ackMatch[2]) - return { type: 'ack', id: parseInt(ackMatch[1]), data } + const data = JSON.parse(ackWithData[2]) + return { type: 'ack', id: parseInt(ackWithData[1]), data } } catch { - return { type: 'ack', id: parseInt(ackMatch[1]), data: null } + return { type: 'ack', id: parseInt(ackWithData[1]), data: null } } } + const ackNoData = raw.match(/^6:::(\d+)$/) + if (ackNoData) { + return { type: 'ack', id: parseInt(ackNoData[1]), data: null } + } return null } default: -- cgit v1.2.3