feat(ui): render the authenticated /app/* UI in PR previews (preview-session escape hatch) (#authed-route-preview) - #853
Merged
Conversation
…/app/* screenshots render the real UI (#authed-route-preview) The /app/* dashboard is guarded client-side, so per-PR preview screenshots (reviewbot) captured the sign-in wall instead of the page. useSession().signInPreview already mints a client-only synthetic demo session (login 'local-preview', all roles, no real token) but was gated to `vite dev` only, so it was a no-op on deployed previews. - session.ts: gate signInPreview on PREVIEW_SESSION_ALLOWED (DEV || VITE_PREVIEW==='1'). VITE_PREVIEW is set ONLY by the per-PR preview build; production never sets it, so the escape hatch is dead-code- eliminated from prod builds. - app-shell.tsx: when PREVIEW_SESSION_ALLOWED and the URL has ?preview=1, auto-start the synthetic session once hydration confirms no real session (self-heals via the session dep). Inert in prod / without the param. - ui-preview.yml: set VITE_PREVIEW=1 on the preview Build UI step (the prod ui-deploy.yml build does not). reviewbot appends ?preview=1 to gittensory /app/* routes (shipped separately). Each side is inert without the other. The synthetic session is client-only and grants no real API access — data panels that require a real token still show their unauthenticated/empty state; this renders the authenticated shell + layout for visual review, not live data.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #853 +/- ##
=======================================
Coverage 96.70% 96.70%
=======================================
Files 108 108
Lines 14642 14642
Branches 5299 5299
=======================================
Hits 14160 14160
Misses 102 102
Partials 380 380 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 31b0920 | Commit Preview URL Branch Preview URL |
Jun 18 2026, 05:08 AM |
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.




Problem
Per-PR preview screenshots (reviewbot) of the
/app/*dashboard captured the sign-in wall, not the page —/app/*is guarded client-side inAppShelland the headless browser has no session (real GitHub OAuth Device Flow can't be scripted). e.g. PR #831's/app/auditpreview was stuck at sign-in.Fix
useSession().signInPreview()already mints a client-only synthetic demo session (login: 'local-preview', all roles, no real token) — but it was gated tovite devonly, so it no-op'd on deployed previews.signInPreviewonPREVIEW_SESSION_ALLOWED = DEV || VITE_PREVIEW==='1'.?preview=1, auto-start the synthetic session after hydration confirms no real session (self-heals via thesessiondep). Inert in prod / without the param.VITE_PREVIEW=1on the preview Build UI step. The production build (ui-deploy.yml) does not set it, so the escape hatch is dead-code-eliminated from prod.Safety
?preview=1to/app/*routes (reviewbot#234); each side is inert without the other.Scope note
This renders the authenticated shell + layout for visual review. Data panels that need a real token still show their empty/unauthenticated state — populating them with demo data is a separate, per-panel follow-up.
Verify
ui:typecheck ✓ · ui:lint ✓ · preview build (
VITE_PREVIEW=1) ✓ · UI tests 7/7 ✓