Point collaboration provider at self-hosted docs-collab-server - #409
Open
jhodapp wants to merge 5 commits into
Open
Point collaboration provider at self-hosted docs-collab-server#409jhodapp wants to merge 5 commits into
jhodapp wants to merge 5 commits into
Conversation
Provider init now gates on siteConfig.env.docsCollabUrl instead of tiptapAppId, but the editor-cache-context and connection-status test mocks still only defined tiptapAppId. With docsCollabUrl undefined, initializeProvider early-returned, no TiptapCollabProvider was created, and the test helpers threw on the missing provider instance.
NEXT_PUBLIC_* vars are inlined at build time; the Dockerfile never declared NEXT_PUBLIC_DOCS_COLLAB_URL as an ARG/ENV, so the CI build arg was dropped and docsCollabUrl resolved undefined in the browser bundle, causing the collab provider to fail to connect. Declare it across the base/builder/runner stages alongside the other NEXT_PUBLIC_* vars.
Sync the docs-collab FE branch with main (159 commits). Adopts the renamed recurring-series endpoint (POST /coaching_session_series), replacing the removed POST /coaching_sessions/recurring path. Collab provider wiring (docsCollabUrl) and Dockerfile build args preserved.
jhodapp
marked this pull request as ready for review
July 22, 2026 03:42
Contributor
Greptile SummaryThis PR redirects the TipTap collaborative editor from TipTap Cloud to a self-hosted
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/components/ui/coaching-sessions/editor-cache-context.tsx | Switches provider guard and constructor option from tiptapAppId/appId to docsCollabUrl/baseUrl; all surrounding logic (JWT flow, awareness, error handling) is unchanged. |
| src/site.config.ts | Adds docsCollabUrl mapped from NEXT_PUBLIC_DOCS_COLLAB_URL; tiptapAppId is retained for easy rollback as documented. |
| Dockerfile | Correctly redeclares NEXT_PUBLIC_DOCS_COLLAB_URL as ARG and ENV in all three build stages where other NEXT_PUBLIC_* vars live. |
| .github/workflows/build_and_push_nonproduction_images.yml | Passes NEXT_PUBLIC_DOCS_COLLAB_URL from the DOCS_COLLAB_URL GitHub Actions repo variable into the Docker build args, consistent with the existing pattern. |
| .github/workflows/build_and_push_production_images.yml | Same DOCS_COLLAB_URL variable wiring as non-production workflow; change is symmetric. |
| tests/components/ui/coaching-sessions/editor-cache-context.test.tsx | Mock updated from tiptapAppId to docsCollabUrl, keeping the test aligned with the new config key. |
| tests/components/ui/coaching-sessions/coaching-notes/connection-status.test.tsx | Mock updated from tiptapAppId to docsCollabUrl, consistent with the editor-cache-context test change. |
Sequence Diagram
sequenceDiagram
participant FE as EditorCacheProvider
participant SC as siteConfig
participant TC as TiptapCollabProvider
participant DCS as docs-collab-server
FE->>SC: read docsCollabUrl
alt docsCollabUrl is falsy
FE-->>FE: return early, no provider
else docsCollabUrl is set
FE->>TC: new TiptapCollabProvider with baseUrl
TC->>DCS: WebSocket connect
DCS-->>TC: synced event
TC-->>FE: enableEditing called
FE-->>FE: setCache isReady true
end
Note over TC,DCS: Previously appId pointed to TipTap Cloud, now baseUrl points to self-hosted server
Reviews (2): Last reviewed commit: "fix(ci): pass NEXT_PUBLIC_DOCS_COLLAB_UR..." | Re-trigger Greptile
NEXT_PUBLIC_* vars are inlined into the client bundle at build time, so the docs-collab URL has to reach the image as a build-arg. 6ebe091 declared the ARG/ENV across the Dockerfile stages but neither image-publishing workflow passed a value, leaving an empty URL baked into the bundle. initializeProvider early-returns on a falsy docsCollabUrl, so notes would open local-only with no error surfaced. Requires a repo-scoped DOCS_COLLAB_URL variable; environment-scoped will not resolve, since neither publishing job declares an environment key.
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.
Description
Repoints the collaborative coaching-notes provider from TipTap Cloud to the self-hosted docs-collab-server. This is a config-only change:
TiptapCollabProvidernow connects viabaseUrl(the newNEXT_PUBLIC_DOCS_COLLAB_URL) instead ofappId. Editor behavior, awareness/presence, theY.Doc, and the JWT/token flow are unchanged.Coordinated with the backend PR refactor-group/refactor-platform-rs#342 (the new server).
tiptapAppIdis left in place so reverting to TipTap Cloud stays a one-line change.GitHub Issue: link if applicable
Changes
editor-cache-context.tsx: provider construction usesbaseUrl: siteConfig.env.docsCollabUrlinstead ofappId, and the connect guard keys ondocsCollabUrl.site.config.ts: surfacedocsCollabUrlfromNEXT_PUBLIC_DOCS_COLLAB_URL.Screenshots / Videos Showing UI Changes (if applicable)
No visual change; the editor is identical. The useful verification artifact is a short screen recording of two browser windows on the same coaching session syncing text and presence/cursors in real time against a running docs-collab-server.
Testing Strategy
npm run lint,npx tsc --noEmit, andnpm run buildare clean. No type changes were needed (the base-classbaseUrloverride type-checks).docs/test-plans/docs-collab-server-local-e2e.md): real-time two-window text sync, presence, persistence across a server restart, and CRDT offline merge.Concerns
NEXT_PUBLIC_DOCS_COLLAB_URL, and its JWT signing key must match the app backend'stiptap_jwt_signing_key. Merge/deploy must be coordinated with Self-hosted docs-collab-server + deployment (replaces TipTap Cloud) refactor-platform-rs#371.NEXT_PUBLIC_DOCS_COLLAB_URLmust be provisioned per environment (.env*is gitignored in this repo).