From 8061ecab452224a53d5448e3e714ffa215d76c88 Mon Sep 17 00:00:00 2001 From: Jim Hodapp Date: Sun, 31 May 2026 19:43:25 -0500 Subject: [PATCH 1/4] feat: point collaboration provider at self-hosted docs-collab-server --- src/components/ui/coaching-sessions/editor-cache-context.tsx | 4 ++-- src/site.config.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ui/coaching-sessions/editor-cache-context.tsx b/src/components/ui/coaching-sessions/editor-cache-context.tsx index 3b05124b..d887af71 100644 --- a/src/components/ui/coaching-sessions/editor-cache-context.tsx +++ b/src/components/ui/coaching-sessions/editor-cache-context.tsx @@ -278,7 +278,7 @@ export const EditorCacheProvider: FC = ({ // Provider initialization: sets up TipTap collaboration with awareness const initializeProvider = useCallback(async () => { - if (!jwt || !siteConfig.env.tiptapAppId || !userSession) { + if (!jwt || !siteConfig.env.docsCollabUrl || !userSession) { return; } @@ -287,7 +287,7 @@ export const EditorCacheProvider: FC = ({ try { const provider = new TiptapCollabProvider({ name: jwt.sub, - appId: siteConfig.env.tiptapAppId, + baseUrl: siteConfig.env.docsCollabUrl, token: jwt.token, document: doc, user: userSession.display_name, diff --git a/src/site.config.ts b/src/site.config.ts index 7c5b4c3e..d8059bd3 100644 --- a/src/site.config.ts +++ b/src/site.config.ts @@ -29,6 +29,7 @@ export const siteConfig = { frontendServicePort: process.env.FRONTEND_SERVICE_PORT, frontendServiceInterface: process.env.FRONTEND_SERVICE_INTERFACE, tiptapAppId: process.env.NEXT_PUBLIC_TIPTAP_APP_ID, + docsCollabUrl: process.env.NEXT_PUBLIC_DOCS_COLLAB_URL, }, }; From 75e77f9f4b7d589cd6968b5fa88e3603c07b9b95 Mon Sep 17 00:00:00 2001 From: Jim Hodapp Date: Wed, 3 Jun 2026 09:13:00 -0500 Subject: [PATCH 2/4] test: mock docsCollabUrl in collab provider tests 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. --- .../coaching-sessions/coaching-notes/connection-status.test.tsx | 2 +- .../ui/coaching-sessions/editor-cache-context.test.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/components/ui/coaching-sessions/coaching-notes/connection-status.test.tsx b/__tests__/components/ui/coaching-sessions/coaching-notes/connection-status.test.tsx index f795892f..fcf147fb 100644 --- a/__tests__/components/ui/coaching-sessions/coaching-notes/connection-status.test.tsx +++ b/__tests__/components/ui/coaching-sessions/coaching-notes/connection-status.test.tsx @@ -34,7 +34,7 @@ vi.mock('@/lib/hooks/logout-cleanup-registry', () => { vi.mock('@/site.config', () => ({ siteConfig: { env: { - tiptapAppId: 'test-app-id' + docsCollabUrl: 'http://test-collab' } } })) diff --git a/__tests__/components/ui/coaching-sessions/editor-cache-context.test.tsx b/__tests__/components/ui/coaching-sessions/editor-cache-context.test.tsx index 1aa17044..1db61654 100644 --- a/__tests__/components/ui/coaching-sessions/editor-cache-context.test.tsx +++ b/__tests__/components/ui/coaching-sessions/editor-cache-context.test.tsx @@ -32,7 +32,7 @@ vi.mock('@/lib/hooks/logout-cleanup-registry', () => { vi.mock('@/site.config', () => ({ siteConfig: { env: { - tiptapAppId: 'test-app-id' + docsCollabUrl: 'http://test-collab' } } })) From 6ebe091d54534e78128c45a1f1e3e4d67191566b Mon Sep 17 00:00:00 2001 From: Jim Hodapp Date: Fri, 17 Jul 2026 17:02:26 -0500 Subject: [PATCH 3/4] fix(docker): wire NEXT_PUBLIC_DOCS_COLLAB_URL build arg into image 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. --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index debf2b05..30a0f923 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ ARG NEXT_PUBLIC_BACKEND_SERVICE_PORT ARG NEXT_PUBLIC_BACKEND_SERVICE_API_PATH ARG NEXT_PUBLIC_BACKEND_API_VERSION ARG NEXT_PUBLIC_TIPTAP_APP_ID +ARG NEXT_PUBLIC_DOCS_COLLAB_URL ARG NEXT_PUBLIC_BASE_PATH ARG GIT_COMMIT_SHA ARG FRONTEND_SERVICE_INTERFACE @@ -50,6 +51,7 @@ ARG NEXT_PUBLIC_BACKEND_SERVICE_PORT ARG NEXT_PUBLIC_BACKEND_SERVICE_API_PATH ARG NEXT_PUBLIC_BACKEND_API_VERSION ARG NEXT_PUBLIC_TIPTAP_APP_ID +ARG NEXT_PUBLIC_DOCS_COLLAB_URL ARG NEXT_PUBLIC_BASE_PATH ARG GIT_COMMIT_SHA @@ -60,6 +62,7 @@ ENV NEXT_PUBLIC_BACKEND_SERVICE_PORT=$NEXT_PUBLIC_BACKEND_SERVICE_PORT ENV NEXT_PUBLIC_BACKEND_SERVICE_API_PATH=$NEXT_PUBLIC_BACKEND_SERVICE_API_PATH ENV NEXT_PUBLIC_BACKEND_API_VERSION=$NEXT_PUBLIC_BACKEND_API_VERSION ENV NEXT_PUBLIC_TIPTAP_APP_ID=$NEXT_PUBLIC_TIPTAP_APP_ID +ENV NEXT_PUBLIC_DOCS_COLLAB_URL=$NEXT_PUBLIC_DOCS_COLLAB_URL ENV NEXT_PUBLIC_BASE_PATH=$NEXT_PUBLIC_BASE_PATH ENV GIT_COMMIT_SHA=$GIT_COMMIT_SHA @@ -93,6 +96,7 @@ ARG NEXT_PUBLIC_BACKEND_SERVICE_PORT ARG NEXT_PUBLIC_BACKEND_SERVICE_API_PATH ARG NEXT_PUBLIC_BACKEND_API_VERSION ARG NEXT_PUBLIC_TIPTAP_APP_ID +ARG NEXT_PUBLIC_DOCS_COLLAB_URL ARG NEXT_PUBLIC_BASE_PATH ARG GIT_COMMIT_SHA ARG FRONTEND_SERVICE_INTERFACE @@ -104,6 +108,7 @@ ENV NEXT_PUBLIC_BACKEND_SERVICE_PORT=$NEXT_PUBLIC_BACKEND_SERVICE_PORT ENV NEXT_PUBLIC_BACKEND_SERVICE_API_PATH=$NEXT_PUBLIC_BACKEND_SERVICE_API_PATH ENV NEXT_PUBLIC_BACKEND_API_VERSION=$NEXT_PUBLIC_BACKEND_API_VERSION ENV NEXT_PUBLIC_TIPTAP_APP_ID=$NEXT_PUBLIC_TIPTAP_APP_ID +ENV NEXT_PUBLIC_DOCS_COLLAB_URL=$NEXT_PUBLIC_DOCS_COLLAB_URL ENV NEXT_PUBLIC_BASE_PATH=$NEXT_PUBLIC_BASE_PATH ENV GIT_COMMIT_SHA=$GIT_COMMIT_SHA From a2baf35542f5a092adb78676e10f972894336bff Mon Sep 17 00:00:00 2001 From: Jim Hodapp Date: Fri, 7 Aug 2026 11:28:23 -0500 Subject: [PATCH 4/4] fix(ci): pass NEXT_PUBLIC_DOCS_COLLAB_URL as a Docker build-arg 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. 6ebe091d 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. --- .github/workflows/build_and_push_nonproduction_images.yml | 1 + .github/workflows/build_and_push_production_images.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build_and_push_nonproduction_images.yml b/.github/workflows/build_and_push_nonproduction_images.yml index fd984447..ebaf583d 100644 --- a/.github/workflows/build_and_push_nonproduction_images.yml +++ b/.github/workflows/build_and_push_nonproduction_images.yml @@ -182,6 +182,7 @@ jobs: NEXT_PUBLIC_BACKEND_SERVICE_API_PATH=${{ vars.BACKEND_SERVICE_API_PATH }} NEXT_PUBLIC_BACKEND_API_VERSION=${{ vars.BACKEND_API_VERSION }} NEXT_PUBLIC_TIPTAP_APP_ID=${{ vars.TIPTAP_APP_ID }} + NEXT_PUBLIC_DOCS_COLLAB_URL=${{ vars.DOCS_COLLAB_URL }} GIT_COMMIT_SHA=${{ github.sha }} FRONTEND_SERVICE_PORT=${{ vars.FRONTEND_SERVICE_PORT }} FRONTEND_SERVICE_INTERFACE=${{ vars.FRONTEND_SERVICE_INTERFACE }} diff --git a/.github/workflows/build_and_push_production_images.yml b/.github/workflows/build_and_push_production_images.yml index ebb687e7..06b95362 100644 --- a/.github/workflows/build_and_push_production_images.yml +++ b/.github/workflows/build_and_push_production_images.yml @@ -116,6 +116,7 @@ jobs: NEXT_PUBLIC_BACKEND_SERVICE_API_PATH=${{ vars.BACKEND_SERVICE_API_PATH }} NEXT_PUBLIC_BACKEND_API_VERSION=${{ vars.BACKEND_API_VERSION }} NEXT_PUBLIC_TIPTAP_APP_ID=${{ vars.TIPTAP_APP_ID }} + NEXT_PUBLIC_DOCS_COLLAB_URL=${{ vars.DOCS_COLLAB_URL }} FRONTEND_SERVICE_PORT=${{ vars.FRONTEND_SERVICE_PORT }} FRONTEND_SERVICE_INTERFACE=${{ vars.FRONTEND_SERVICE_INTERFACE }} tags: ${{ steps.tags.outputs.frontend_tags }} # Use "stable" tag from previous step