Skip to content

Add Grist dataset-review surface to cockpit-admin#77

Merged
electron-rare merged 8 commits into
mainfrom
worktree-grist-review-surface
May 19, 2026
Merged

Add Grist dataset-review surface to cockpit-admin#77
electron-rare merged 8 commits into
mainfrom
worktree-grist-review-surface

Conversation

@electron-rare
Copy link
Copy Markdown
Contributor

Summary

Surfaces a Grist dataset-review experience inside the cockpit-admin
SPA (served at admin.ailiance.fr behind Keycloak SSO):

  • Vendors the static review-console widget into public/review-console/
    so the Vite build publishes it at /review-console/.
  • Adds a /review-datasets route embedding the Grist review doc in an
    <iframe>, with a graceful "not configured" fallback when the URL is
    unset, plus a Review nav link.
  • Threads a build-time VITE_GRIST_URL env var through
    vite-env.d.ts, the root Dockerfile, and deploy/docker-compose.yml
    (documented in deploy/.env.example).
  • Adds an nginx location /review-console/ block so the vendored
    widget returns a real 404 instead of the SPA shell on missing files.

7 commits, each spec-reviewed; final holistic review verdict
MERGE-READY.

Test plan

  • pnpm test — 45/45 green (14 files), including 2 new tests for
    the route (iframe rendered when VITE_GRIST_URL set; fallback shown
    when unset)
  • pnpm build — succeeds; widget lands in dist/review-console/;
    /review-datasets registered in the route tree
  • Post-merge: publish the Grist review doc, set VITE_GRIST_URL in
    the deployment env, rebuild & redeploy cockpit-admin
  • Point the Grist custom-widget page at
    https://admin.ailiance.fr/review-console/index.html

Copilot AI review requested due to automatic review settings May 19, 2026 18:48
@electron-rare electron-rare merged commit fca33a1 into main May 19, 2026
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a Grist dataset-review surface to the cockpit-admin SPA by embedding a configurable Grist review doc in a new route and vendoring a companion “review-console” widget under /review-console/ for use as a Grist custom widget.

Changes:

  • Add /review-datasets route (with “not configured” fallback) and a “Review” nav link in the admin header.
  • Vendor the review-console static widget into the admin build output and adjust nginx routing to return real 404s for missing /review-console/* assets.
  • Thread VITE_GRIST_URL through typing, Docker build args, and deployment env templates; add route-level tests.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Dockerfile Adds VITE_GRIST_URL build arg/env so Vite can bake the Grist URL into the admin build.
deploy/nginx/spa.conf Adds /review-console/ location to avoid SPA fallback for missing widget assets.
deploy/docker-compose.yml Passes VITE_GRIST_URL into the admin image build args.
deploy/.env.example Documents VITE_GRIST_URL for deployments.
apps/cockpit-admin/tests/review-datasets.test.tsx Adds tests for iframe vs. fallback behavior based on VITE_GRIST_URL.
apps/cockpit-admin/src/vite-env.d.ts Types import.meta.env.VITE_GRIST_URL.
apps/cockpit-admin/src/routeTree.gen.ts Registers the new /review-datasets route in the generated route tree.
apps/cockpit-admin/src/routes/review-datasets.index.tsx Implements the Grist iframe route + fallback message.
apps/cockpit-admin/src/routes/__root.tsx Adds “Review” link to the top navigation.
apps/cockpit-admin/public/review-console/index.html Adds the vendored Grist custom-widget HTML/JS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deploy/nginx/spa.conf
Comment on lines +15 to +18
# Review-console vendored widget — real 404 on missing files, no SPA fallback
location /review-console/ {
try_files $uri $uri/ =404;
}
Comment on lines +19 to +24
return (
<iframe
title="Grist dataset review"
src={gristUrl}
className="h-[calc(100vh-6rem)] w-full border-0"
/>
Comment on lines +48 to +49
const REVIEWER = "clems"; // adjust to the reviewer's Grist choice value

Comment on lines +10 to +14
vi.stubEnv('VITE_GRIST_URL', 'https://grist.saillant.cc/o/docs/abc');
render(<ReviewDatasetsPage />);
const frame = screen.getByTitle('Grist dataset review');
expect(frame.tagName).toBe('IFRAME');
expect(frame).toHaveAttribute('src', 'https://grist.saillant.cc/o/docs/abc');
@electron-rare electron-rare deleted the worktree-grist-review-surface branch May 19, 2026 20:01
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.

2 participants