Repository navigation
feat(regulations): add the collaborative LaTeX editor - #151
Draft
lorenzocorallo wants to merge 1 commit into
Draft
lorenzocorallo wants to merge 1 commit into
lorenzocorallo wants to merge 1 commit into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
The draft page becomes an Overleaf-like workspace over the collab service: - CodeMirror 6 bound to one Y.Text per source file (y-codemirror.next, Hocuspocus provider), with a single-use ticket from a server function on every (re)connect; a `state` message rebuilds the provider and the Y.Doc. - Source mode with LaTeX highlighting and completions for the grammar's macros (fresh ids) and \rif targets; visual mode as decorations over the same text, numbered across \input files. - File picker and outline, presence, parser and compiler problems inline. - Live PDF preview (pdf.js) that keeps the last good PDF while compiling or after a failure, with the log tail. - Comments anchored to Yjs relative positions (threads, resolve, reopen). - History: named snapshots, compare with the current text, restore.
lorenzocorallo
force-pushed
the
feat/regulations-editor
branch
from
November 2, 2026 20:12
fd4a400 to
4ab7f91
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regolamenti, part 2 of 2, stacked on #150: the Overleaf-like collaborative editor (spec decisions 2, 4, 7 and 8).
What's in it
Y.Textper source file throughy-codemirror.nextand the Hocuspocus provider (v4).ydoc.getMap("files"), with the draft id as the document name.issueCollabTicket, a server function, so the browser never holds an IdP token. The provider asks for a new one on every reconnect.{type:"state"}message (the draft froze or reopened) destroys the provider and the Y.Doc and builds new ones. This is the protocol the backend specified.\riftargets.\inputfiles; commi, lettere and elenco render as lists; commands and ids are hidden.compilemessage (with a polling fallback), keeps the last good PDF while compiling or after a failure, and shows the log tail.Y.encodeRelativePositionranges and highlighted in the text, with threads, replies, resolve, reopen and delete. No @mentions.Verified, in the browser in agent mode
AGENT_PERMISSIONS=none) gets a read-only editor and still sees the PDF.pnpm check,pnpm typecheck,pnpm test,pnpm build.Verified end to end against the backend's local stack
The real collab service, compile worker and RRI, seeded by backend #115. Three people with tokens from the dev IdP:
dev-direttivo,dev-editor,dev-commenter.dev-editor's typing appeared indev-direttivo's editor.dev-commenteris read-only, with Condividi hidden.dev-direttivoafter a reload.statemessage.Not verified / not done
PdfViewertoolbar is still in English.Do not merge without Lorenzo's OK.