Skip to content

Railway-only deployment docs + document-viewer UX cleanup#511

Merged
BigSimmo merged 12 commits into
mainfrom
claude/production-deployment-setup-d83ef8
Jul 12, 2026
Merged

Railway-only deployment docs + document-viewer UX cleanup#511
BigSimmo merged 12 commits into
mainfrom
claude/production-deployment-setup-d83ef8

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

Two independent changes on this branch (one commit each).

1. Railway is the sole deployment platform of record (ca37957)

  • Removed all Fly.io / Cloud Run references from the deployment docs and CI.
  • Rewrote docs/deployment-architecture.md Railway-first (decided + live), adding a measured Singapore↔Sydney connection section (physical RTT ~94 ms; authed PostgREST round-trip ~145–340 ms; ~+0.6–2 s per novel answer) with in-place optimisations and Railway-native mitigations (Supabase Singapore read replica; reduce sequential DB depth).
  • Pointed staging at a Railway environment; added reproducible per-service config-as-code (railway.app.json, railway.worker.json) mirroring the live app + worker services.

2. Document-viewer UX cleanup — 20 fixes (c60bf69)

Navigation chrome, overview cards, actions, PDF toolbar, evidence/tables, and desktop layout. Highlights: single back affordance (no hamburger, no duplicate mode toggle), real "Jump to p.N" chips, de-duplicated overview, derived document-type eyebrow, rebalanced 2×2 actions, one-row mobile PDF toolbar, benefit-labelled zoom mode, page-fit canvas height, de-emphasised empty evidence, table-leads / raw image behind a "Show original" toggle, flowing right rail, sticky header, and a floating composer that clears the right rail.

Clinical governance preflight

Presentational and infrastructural only. The viewer changes are layout / labels / visibility — no change to retrieval, answer generation, ranking, document access or permissions, privacy, or clinical output. No ingestion, answer-generation, or source-governance logic is touched.

Verification

  • npm run typecheck, eslint, and prettier --check pass on the changed files.
  • Browser QA (Chromium; mobile 390 px + desktop 1280 px) on live demo documents: no JS/hydration errors; all 20 items verified visually.

🤖 Generated with Claude Code

BigSimmo and others added 2 commits July 12, 2026 23:16
Remove Fly.io and Cloud Run from the deployment docs and CI. Rewrite
docs/deployment-architecture.md Railway-first (now decided + live), add a
measured Singapore->Sydney connection section with optimisations and
Railway-native mitigations, point staging at a Railway environment, and
add reproducible per-service config-as-code (railway.app.json,
railway.worker.json) mirroring the live services.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Twenty focused UX fixes to the document viewer:
- one clear back affordance (ArrowLeft on all breakpoints) and drop the
  redundant Answer|Documents mode toggle (the global shell owns mode)
- remove the misleading chevrons from the inert overview cards; replace
  fake wireframe thumbnails with real "Jump to p.N" chips
- show the overview sentence once (landing card), not again in the rail
- derive the document-type eyebrow from labels instead of hardcoding it
- rebalance the landing actions to a clean 2x2 / single row; rename
  "Scope" to "Add to scope"
- collapse the mobile PDF toolbar to one compact row; tighten the page
  indicator; move the verbose helper to a tooltip; relabel the viewer
  mode toggle around the benefit ("Sharper zoom" / "Standard view")
- fit the canvas holder to the rendered page (reserve height only while
  loading)
- de-emphasise the empty pinned-evidence state
- when a structured table exists, let the table lead and collapse the
  raw table image behind a "Show original" toggle
- let the right rail flow with the page (no nested scroll), make the
  header sticky with consistent offsets, and keep the floating composer
  within the main column so it clears the right rail

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@supabase

supabase Bot commented Jul 12, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Railway production and staging deployment configuration, shared health-check handling, and document viewer presentation behavior were updated. The viewer changes cover summaries, evidence, tables, PDF controls, overview navigation, and responsive layout.

Changes

Railway deployment

Layer / File(s) Summary
Railway service configuration
.github/workflows/docker-image.yml, railway.app.json, railway.worker.json
Railway Docker builds, healthchecks, restart policies, regional placement, replica settings, and build-environment documentation are defined.
Production architecture and operations
docs/deployment-architecture.md
Production topology, cross-region latency, ingestion, queue recovery, secrets, staging, rollout, rollback, and observability documentation are updated.
Railway staging runbook
docs/staging-setup.md
Staging now uses Railway remote Docker builds, Southeast Asia placement, Railway service settings, and Railway-managed secrets.

Health-check consolidation

Layer / File(s) Summary
Shared health response and readiness route
src/lib/health-response.ts, src/app/api/health/route.ts, src/app/api/health/ready/route.ts, tests/health-route.test.ts
Health response construction is shared between endpoints, and the readiness route performs the configured deep-probe flow with a corresponding test.

Document viewer presentation

Layer / File(s) Summary
Summary, evidence, and table rendering
src/components/DocumentViewer.tsx, src/components/AccessibleTable.tsx
Clinical summary lead visibility, structured table presentation, image toggles, table wrapping, and pinned evidence empty states are revised.
PDF viewer controls
src/components/DocumentViewer.tsx
PDF toolbar layout, canvas spacing, and view-mode labels are updated.
Document overview and navigation
src/components/DocumentViewer.tsx, src/app/globals.css
Overview actions, previews, useful-page chips, navigation labels, composer positioning, and right-rail layout are redesigned.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Railway
  participant ReadinessRoute
  participant HealthResponse
  participant Supabase
  Railway->>ReadinessRoute: GET /api/health/ready
  ReadinessRoute->>HealthResponse: request deep readiness response
  HealthResponse->>Supabase: run deep probe
  Supabase-->>HealthResponse: return probe result
  HealthResponse-->>ReadinessRoute: return health JSON
  ReadinessRoute-->>Railway: respond 200 or 503
Loading

✅ Pre-merge checks override applied

The pre-merge checks have been overridden successfully. You can now proceed with the merge.

Overridden by @BigSimmo via checkbox on 2026-07-12T16:15:50.627Z.

❌ Failed checks (2 errors, 1 warning)

Check name Status Explanation Resolution
Verification Claims ❌ Error [IGNORED] PR description claims typecheck/lint/prettier and browser QA passed, but not in the required exact command/result format. Rewrite verification notes as explicit lines like “Ran npm run verify:cheap: passed” or “Not run: reason,” and avoid vague pass claims.
Api Route Failure Handling ❌ Error [IGNORED] healthResponse catches errors, but probeSupabaseHealth does a plain select().limit(1) with no AbortSignal/timeout or cache. Add a short timeout and bounded cache to the deep Supabase probe (or wire an AbortController into the query) so stalled DBs fail fast instead of hanging readiness checks.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 70.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (8 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately captures the two main changes: Railway deployment docs and document-viewer UX cleanup.
Description check ✅ Passed The description includes the required Summary, Verification, and Clinical governance sections and is detailed enough despite some checklist formatting differences.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Generated And Sensitive Files ✅ Passed No committed secrets or sensitive artifacts found; new Railway config/docs and tests use placeholders or documented values only.
Risky Git Or Deployment Actions ✅ Passed No force-push/reset/clean/delete/rebase instructions found; deploy docs use Railway rollouts/rollback and staging adds confirm_cost/--confirm-staging guards.
Supabase Project And Schema Safety ✅ Passed Touched files keep the live Supabase ref sjrfecxgysukkwxsowpy, use placeholders for staging, and include no SQL/migration/RLS/policy changes.
Runtime And Package Manager Integrity ✅ Passed Diff keeps npm/package-lock flow intact: package.json still targets npm@11.17.0/Node 24.x, .npmrc keeps engine-strict=true, and no lockfile or install-flag changes appear.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/production-deployment-setup-d83ef8
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/production-deployment-setup-d83ef8

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c60bf69c76

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/globals.css
Comment thread src/components/DocumentViewer.tsx
Non-dense tables used table-fixed plus overflow-wrap:anywhere with a
forced-equal colgroup, so a word wider than its column (e.g.
"Constipation" or "glucose/HbA1c" in a narrow right-rail column) was
chopped mid-character. Switch non-dense tables to auto layout and drop
the :anywhere override (keeping break-words), so columns size to their
content (min-content = longest word), cells wrap at word boundaries, and
a table too wide for its container scrolls via the existing
overflow-x-auto wrapper. The dense preview keeps its fixed
single-line-ellipsis layout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@BigSimmo
BigSimmo enabled auto-merge (squash) July 12, 2026 15:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c9a02bc37

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/DocumentViewer.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/staging-setup.md (1)

72-79: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Require a staging-only OpenAI key.

This runbook permits a shared key, but docs/deployment-architecture.md requires separate production, staging, and CI keys to preserve rotation boundaries and limit blast radius. Remove “or shared” and explicitly reject production-key reuse in staging.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/staging-setup.md` around lines 72 - 79, Update the Runtime secrets table
in the staging setup documentation so OPENAI_API_KEY requires a staging-only
OpenAI key. Remove the “or shared” wording and explicitly state that the
production key must not be reused in staging, consistent with the deployment
architecture requirements.
src/components/DocumentViewer.tsx (1)

1423-1433: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Widen the fullscreen exit button. iconButton resolves to toolbarButton, which is a fixed h-tap w-tap square, so the visible Exit label will clip or overflow at sm+. Use the wider Fit-button sizing here instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/DocumentViewer.tsx` around lines 1423 - 1433, Update the
fullscreen exit button in DocumentViewer’s fullscreenActive branch to use the
wider Fit-button sizing instead of iconButton/toolbarButton, preserving its
existing click handler, label, icon, and accessibility attributes.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/staging-setup.md`:
- Line 67: Add the appropriate language identifier to the fenced code block in
the staging setup documentation, changing the opening fence to use dotenv syntax
while leaving the block contents unchanged.

In `@railway.app.json`:
- Around line 7-8: Update the Railway deploy healthcheck configuration to target
a readiness endpoint or supported deep health probe that Railway can call
without query parameters or a secret token. Ensure the selected path actually
validates application readiness and does not pass solely because environment
variables are present, while preserving the existing healthcheck configuration
structure.

In `@src/components/DocumentViewer.tsx`:
- Around line 1793-1819: Update DocumentPagePreview so activating the “Jump to
p.X” chip changes the PDF viewer’s selected page by updating the page query or
invoking the existing page-change handler, rather than only scrolling to
`#pdf-preview-section`. Ensure the target page is passed through the existing
initialPage flow consumed by PdfCanvasViewer and NativePdfEmbed, while
preserving the current navigation label and fallback behavior.
- Around line 455-531: Update the hasStructuredTable logic used by the
image-collapse decision so it reflects whether AccessibleTable can actually
render content, requiring explicit rows or successfully parsable markdown rather
than tableColumns alone. Preserve inline image behavior for columns-only records
and unparseable pipe-filled snippets, while retaining the collapsed “Show
original” behavior when a structured table is renderable.

---

Outside diff comments:
In `@docs/staging-setup.md`:
- Around line 72-79: Update the Runtime secrets table in the staging setup
documentation so OPENAI_API_KEY requires a staging-only OpenAI key. Remove the
“or shared” wording and explicitly state that the production key must not be
reused in staging, consistent with the deployment architecture requirements.

In `@src/components/DocumentViewer.tsx`:
- Around line 1423-1433: Update the fullscreen exit button in DocumentViewer’s
fullscreenActive branch to use the wider Fit-button sizing instead of
iconButton/toolbarButton, preserving its existing click handler, label, icon,
and accessibility attributes.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bc27a79-ff8a-41dd-8c9a-1000dc9a442b

📥 Commits

Reviewing files that changed from the base of the PR and between 9f384d5 and c60bf69.

📒 Files selected for processing (7)
  • .github/workflows/docker-image.yml
  • docs/deployment-architecture.md
  • docs/staging-setup.md
  • railway.app.json
  • railway.worker.json
  • src/app/globals.css
  • src/components/DocumentViewer.tsx

Comment thread docs/staging-setup.md
Comment thread railway.app.json Outdated
Comment thread src/components/DocumentViewer.tsx Outdated
Comment thread src/components/DocumentViewer.tsx Outdated
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Cannot run autofix: This PR has merge conflicts.

Please resolve the conflicts with the base branch and try again.

Alternatively, use @coderabbitai resolve merge conflict to automatically resolve the conflicts.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/AccessibleTable.tsx`:
- Around line 159-163: Update the header class logic in AccessibleTable so the
dense-preview Actions header retains fixed-layout, single-line truncation with
ellipsis instead of wrapping. Apply the existing dense-preview truncation
classes conditionally for actionsHeader while preserving the current wrapping
behavior for regular headers.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e6042e17-2691-4664-9e45-f70dd85a06f4

📥 Commits

Reviewing files that changed from the base of the PR and between c60bf69 and 5c9a02b.

📒 Files selected for processing (1)
  • src/components/AccessibleTable.tsx

Comment thread src/components/AccessibleTable.tsx
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Cannot run autofix: This PR has merge conflicts.

Please resolve the conflicts with the base branch and try again.

Alternatively, use @coderabbitai resolve merge conflict to automatically resolve the conflicts.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Cannot run autofix: This PR has merge conflicts.

Please resolve the conflicts with the base branch and try again.

Alternatively, use @coderabbitai resolve merge conflict to automatically resolve the conflicts.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Cannot run autofix: This PR has merge conflicts.

Please resolve the conflicts with the base branch and try again.

Alternatively, use @coderabbitai resolve merge conflict to automatically resolve the conflicts.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot please resolve merge conflicts

@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent resolve merge conflict

@cursor

cursor Bot commented Jul 12, 2026

Copy link
Copy Markdown

You need to increase your spend limit or enable usage-based billing to run background agents. Go to Cursor

@BigSimmo

Copy link
Copy Markdown
Owner Author

@anthropic-code-agent[agent] Resolve merge conflicts

@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

auto-merge was automatically disabled July 12, 2026 16:28

Head branch was pushed to by a user without write access

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved and pushed in 7428b4a (merge commit). The branch now merges cleanly with main and conflict markers have been removed.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts on this branch.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 12, 2026 16:36
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Cannot run autofix: This PR has merge conflicts.

Please resolve the conflicts with the base branch and try again.

Alternatively, use @coderabbitai resolve merge conflict to automatically resolve the conflicts.

…roduction-deployment-setup-d83ef8

# Conflicts:
#	docs/deployment-architecture.md
#	docs/staging-setup.md
#	src/components/DocumentViewer.tsx

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Resolved and pushed in d7fb7ec (merge commit). The branch now merges cleanly and conflict markers are removed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
src/lib/health-response.ts (1)

21-43: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: isDemoMode() invoked twice per request.

isDemoMode() is called once inside the deep branch (line 21) and again for the response body (line 43). Not a correctness bug (deterministic within a request), but capturing it once avoids redundant recomputation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/health-response.ts` around lines 21 - 43, Capture the result of
isDemoMode() once at the start of the health-response flow, then reuse that
value in both the Supabase branch condition and the response body's demoMode
field. Remove the duplicate invocation while preserving the existing branch
behavior.
tests/health-route.test.ts (1)

66-78: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

LGTM on the assertions for the demo-mode branch — they match healthResponse's logic correctly.

Gap: the actual unauthenticated-live-probe branch (demoMode: false, configured: true) is untested. That's the path where the auth bypass actually results in a real Supabase probe attempt, and it's the security-relevant one for this new route. Consider adding a case that mocks @/lib/supabase/admin / @/lib/supabase/health dynamic imports to assert both the ok and error outcomes are surfaced correctly without requiring the deep-probe header.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/health-route.test.ts` around lines 66 - 78, Extend the GET
/api/health/ready tests with configured, non-demo-mode cases that omit the
diagnostic probe token and mock the dynamic `@/lib/supabase/admin` and
`@/lib/supabase/health` imports. Assert that healthResponse surfaces both
successful and failed Supabase probe outcomes with the expected response status
and checks, confirming the unauthenticated live-probe branch works.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/api/health/ready/route.ts`:
- Around line 6-10: Correct the misleading comment above GET so it accurately
states that unauthenticated callers receive coarse readiness and
configuration/reachability check states, including Supabase and OpenAI results,
while avoiding diagnostic detail claims. Keep the existing healthResponse
behavior and allowUnauthenticatedDeep setting unchanged.

In `@src/app/globals.css`:
- Around line 1435-1437: Update the left positioning rule for
.document-viewer-composer.floating-composer-edge to include the same
centered-shell offset used by right, while preserving the existing minimum 2rem
and safe-area-left constraints. Ensure wide viewports position the composer
within the centered document column rather than the outer gutter.

In `@src/lib/health-response.ts`:
- Around line 10-34: Update the deep Supabase probe flow in healthResponse to
enforce a short timeout around probeSupabaseHealth and cache the resulting
status for a few seconds, reusing the cached result for subsequent requests.
Ensure timeout or probe failures produce the existing "error" status and
preserve the unauthorized, skipped, and normal fresh-probe behavior.

---

Nitpick comments:
In `@src/lib/health-response.ts`:
- Around line 21-43: Capture the result of isDemoMode() once at the start of the
health-response flow, then reuse that value in both the Supabase branch
condition and the response body's demoMode field. Remove the duplicate
invocation while preserving the existing branch behavior.

In `@tests/health-route.test.ts`:
- Around line 66-78: Extend the GET /api/health/ready tests with configured,
non-demo-mode cases that omit the diagnostic probe token and mock the dynamic
`@/lib/supabase/admin` and `@/lib/supabase/health` imports. Assert that
healthResponse surfaces both successful and failed Supabase probe outcomes with
the expected response status and checks, confirming the unauthenticated
live-probe branch works.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: da563dc5-3883-4e6b-bc7c-f285ecff749a

📥 Commits

Reviewing files that changed from the base of the PR and between d7fb7ec and a67d2a1.

📒 Files selected for processing (9)
  • docs/staging-setup.md
  • railway.app.json
  • src/app/api/health/ready/route.ts
  • src/app/api/health/route.ts
  • src/app/globals.css
  • src/components/AccessibleTable.tsx
  • src/components/DocumentViewer.tsx
  • src/lib/health-response.ts
  • tests/health-route.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • railway.app.json
  • src/components/AccessibleTable.tsx
  • docs/staging-setup.md

Comment thread src/app/api/health/ready/route.ts
Comment thread src/app/globals.css
Comment thread src/lib/health-response.ts
# Conflicts:
#	src/app/api/health/route.ts
@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts on this branch.

@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex resolve all comments

cursoragent and others added 2 commits July 12, 2026 17:54
- Restore compact sticky-header h1 for document title and error states so
  DOM integrity and Playwright smoke tests match the viewer contract
- Add aria-hidden to Lucide icons flagged by require-lucide-icon-aria
- Regenerate docs/site-map.md for the new /api/health/ready route

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
…loyment-setup-d83ef8

# Conflicts:
#	docs/deployment-architecture.md
auto-merge was automatically disabled July 12, 2026 17:55

Head branch was pushed to by a user without write access

Copilot AI commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Resolved and pushed in 631f0a3 (merge commit). The branch now merges cleanly and conflict markers are removed.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 12, 2026 17:58
@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

Testing

  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm ci
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npx prettier --check src/app/api/health/ready/route.ts src/app/globals.css src/lib/health-response.ts tests/health-route.test.ts
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npx vitest run tests/health-route.test.ts --reporter=dot
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npx eslint src/app/api/health/ready/route.ts src/lib/health-response.ts tests/health-route.test.ts
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm run typecheck -- --pretty false
  • git diff --check

View task →

@BigSimmo BigSimmo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@BigSimmo BigSimmo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96af452baf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/components/DocumentViewer.tsx
Comment thread src/components/DocumentViewer.tsx

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57c2e58f0f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/deployment-architecture.md
@BigSimmo
BigSimmo merged commit 56ad16c into main Jul 12, 2026
18 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7cca301849

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/staging-setup.md
supabase link --project-ref <staging-ref>
supabase db push # applies supabase/migrations/* → matches schema.sql
```
```dotenv

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Close the schema command fence

In the staging setup runbook, this starts a literal ```dotenv marker inside the four-backtick bash block opened above, so the following health-check prose is rendered as part of the shell snippet. When an operator copies the “Apply the schema” commands, they can paste the stray fence/prose into a shell before running the health check; close the bash fence after supabase db push and keep the health note as normal text.

Useful? React with 👍 / 👎.

@BigSimmo
BigSimmo deleted the claude/production-deployment-setup-d83ef8 branch July 13, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants