summaryrefslogtreecommitdiff
path: root/src/main/overleafProtocol.ts
diff options
context:
space:
mode:
authorhaoyuren <13851610112@163.com>2026-03-15 01:57:17 -0500
committerhaoyuren <13851610112@163.com>2026-03-15 01:57:17 -0500
commit7748999a8b0c3ab5e7b107bf7c42f24580cb23aa (patch)
tree44d897792cab654ed577e8324794b764a1536c70 /src/main/overleafProtocol.ts
parent99c663cdc9dc1ae23cec244bf7b0d79a16a62808 (diff)
Real-time comment sync, MCP server expansion, multi-tab terminal, UI fixes
- 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 <noreply@anthropic.com>
Diffstat (limited to 'src/main/overleafProtocol.ts')
-rw-r--r--src/main/overleafProtocol.ts17
1 files changed, 11 insertions, 6 deletions
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: