Skip to content

Add a temporary Console / Work gate to the organization home - #1102

Merged
softmarshmallow merged 1 commit into
mainfrom
org-home-gate
Oct 12, 2026
Merged

softmarshmallow merged 1 commit into
mainfrom
org-home-gate

Conversation

@softmarshmallow

Copy link
Copy Markdown
Member

Why

People who sign up for the Console products, AI Gateway and FX, still land on grida.co/<org>. That is the legacy projects home (projects, forms, databases), and its empty state tells them to "Create your first project", which has nothing to do with what they came for.

Rebuilding the organization home is a larger job that belongs with a cleanup of the product catalogue and its links. This PR is a deliberately small, removable stopgap until then.

What

A two-card gate at /<org>. The page renders only the cards, with no sidebar, header, help button or command palette. The URL never changes.

Card Does Remembered?
Console: AI Gateway and FX keys, credits, usage, billing Links to the org's AI Gateway page, <console>/organizations/<org>/ai-gateway Never. Remembering it would turn the org home into a redirect off grida.co
Work: projects, forms, databases, documents Renders the existing projects home, unchanged Per organization, per browser: cookie grida-org-home=work; Path=/<org>

The server reads the cookie, so the right view renders directly with no flash. Nothing is stored in the database.

Console stays one click away once Work is chosen: there's a Console item above Settings in the workspace sidebar, and one pinned to the bottom of the organization settings sidebar.

One source for Console URLs. lib/platform/console-links.ts (ConsoleLinks.aiGateway) builds the outbound Console links. It uses the configured Console origin when there is one and falls back to https://console.grida.co, as in local development. The AI Gateway landing page's "Get API key" button now uses it instead of a hardcoded URL. Billing links still come from consoleBillingUrl, which keeps failing closed, and the module points to it and to organizationRoute.

Layout split. The workspace chrome moved from (workspace)/[org]/layout.tsx into a WorkspaceShell component. The Work home and the project page (through a new [proj]/layout.tsx) apply it; the gate doesn't. The org layout still handles sign-in, the org lookup and the shared Workspace state. One visible side effect: moving from the org home into a project now redraws the sidebar. Its open or collapsed state is still kept.

Not changed

/dashboard routing, the workspace data route, the shared Workspace state, the Console org-creation handoff (GRIDA-SEC-010), billing handoffs, and the (workbench) project console.

/dashboard still sends people with a recent project straight to /<org>/<project>, so the gate mostly reaches new and project-less users. That is the onboarding gap this targets.

Temporary

Every touchpoint is marked TODO(org-home-gate). The header comment in home-gate.tsx has the removal checklist:

rg "TODO\(org-home-gate\)" editor

Testing

  • lib/platform/console-links.test.ts: org page vs universal entry, and origin fallback.
  • Manual test case: test/workspace-org-home-gate.md (TC-WORKSPACE-HOME-001).
  • Checked in the browser against local Supabase with insiders auth:
    • The bare gate on first visit.
    • Work renders the projects home, and still does after a reload.
    • The project page keeps the sidebar.
    • The Console links in both sidebars and on the landing page.
  • pnpm --filter editor typecheck, vitest.platform.config.ts (483 tests), oxlint and oxfmt all pass.

Visitors who signed up for the Console products (AI Gateway, FX) landed on
grida.co/<org>, the legacy projects home whose empty state is "Create your
first project". The organization home now opens on a bare two-card gate:

- Console links to the organization's AI Gateway page in the Console.
  It is never remembered, so /<org> never becomes a redirect off grida.co.
- Work renders the existing projects home and is remembered per
  organization and browser in a cookie scoped to /<org>. The URL never
  changes and the server picks the view, so nothing flashes.

The workspace chrome (sidebar, header, help, command palette) moves from
the [org] layout into WorkspaceShell, applied by the Work home and the
project page, so the gate renders without it. Console is also linked from
the workspace sidebar (above Settings) and the organization settings
sidebar.

Outbound Console URLs now come from lib/platform/console-links.ts, which
the AI Gateway landing page's "Get API key" button also uses. It prefers
the configured Console origin and falls back to console.grida.co.

The gate is a stopgap until the product catalogue and its links are
reorganized; every touchpoint is marked TODO(org-home-gate), with the
removal checklist in home-gate.tsx. Manual TC: test/workspace-org-home-gate.md.
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api Ready Ready Preview Oct 12, 2026 8:15pm UTC
grida Ready Ready Preview Oct 12, 2026 8:15pm UTC
5 Skipped Deployments
Project Deployment Actions Updated
backgrounds Ignored Ignored Preview Oct 12, 2026 8:15pm UTC
blog Ignored Ignored Preview Oct 12, 2026 8:15pm UTC
code Ignored Ignored Oct 12, 2026 8:15pm UTC
docs Ignored Ignored Preview Oct 12, 2026 8:15pm UTC
viewer Ignored Ignored Preview Oct 12, 2026 8:15pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4c1000bf-b8b1-4773-84a0-50a0d9172a9f

📥 Commits

Reviewing files that changed from the base of the PR and between a21a96f and bac1735.


📒 Files selected for processing (15)
  • editor/app/(site)/organizations/[organization_name]/settings/_shell.tsx
  • editor/app/(site)/organizations/[organization_name]/settings/layout.tsx
  • editor/app/(workspace)/[org]/[proj]/layout.tsx
  • editor/app/(workspace)/[org]/_components/home-gate.tsx
  • editor/app/(workspace)/[org]/_components/org-home.ts
  • editor/app/(workspace)/[org]/_components/work-home.tsx
  • editor/app/(workspace)/[org]/_components/workspace-shell.tsx
  • editor/app/(workspace)/[org]/layout.tsx
  • editor/app/(workspace)/[org]/page.tsx
  • editor/app/(www)/(ai-gateway)/ai/gateway/page.tsx
  • editor/lib/platform/README.md
  • editor/lib/platform/console-links.test.ts
  • editor/lib/platform/console-links.ts
  • editor/scaffolds/workspace/sidebar.tsx
  • test/workspace-org-home-gate.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.



Walkthrough

The organization root now presents Console and Work choices. Selecting Work saves an organization-scoped cookie and displays the workspace. Console links use generated AI Gateway URLs in the organization home, workspace navigation, settings, and AI Gateway page.

Changes

Organization home and Console navigation

Layer / File(s) Summary
Console URLs and navigation
editor/lib/platform/console-links.ts, editor/lib/platform/console-links.test.ts, editor/lib/platform/README.md, editor/app/(www)/(ai-gateway)/ai/gateway/page.tsx, editor/app/(site)/organizations/[organization_name]/settings/*, editor/scaffolds/workspace/sidebar.tsx
ConsoleLinks.aiGateway builds universal or organization-specific URLs and falls back to the public Console URL when origin resolution fails. The AI Gateway page, settings sidebar, and workspace sidebar use Console URLs. Tests cover URL selection and origin fallbacks.
Organization home choice
editor/app/(workspace)/[org]/_components/org-home.ts, editor/app/(workspace)/[org]/_components/home-gate.tsx, editor/app/(workspace)/[org]/page.tsx, editor/app/(workspace)/[org]/layout.tsx, test/workspace-org-home-gate.md
The organization page checks the Work cookie and renders either the Console/Work gate or the workspace. Choosing Work writes an organization-scoped cookie and refreshes the router. The organization layout leaves the workspace chrome to the workspace route. The manual test case covers the gate and its persistence behavior.
Work workspace rendering
editor/app/(workspace)/[org]/_components/workspace-shell.tsx, editor/app/(workspace)/[org]/_components/work-home.tsx, editor/app/(workspace)/[org]/[proj]/layout.tsx
WorkspaceShell renders workspace controls and content. WorkHome displays project statistics, loading states, project creation, and project document views. The project layout passes the organization to WorkspaceShell.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant OrganizationHomePage
  participant OrgHome
  participant HomeGate
  participant ConsoleLinks
  participant Router
  OrganizationHomePage->>OrgHome: Check the organization cookie with isWork
  alt Work cookie is set
    OrganizationHomePage->>OrganizationHomePage: Render WorkHome in WorkspaceShell
  else Work cookie is not set
    OrganizationHomePage->>ConsoleLinks: Build the organization AI Gateway URL
    OrganizationHomePage->>HomeGate: Render with consoleHref
    HomeGate->>OrgHome: Build the Work cookie on selection
    HomeGate->>Router: Refresh after writing the cookie
  end
Loading

Merge Risk: ⚪ Minimal · up to bac17

The organization home gate and workspace navigation have no established merge-blocking issue. The universal Console destination remains unverified because its application is outside this repository.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 35.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 13 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding a temporary Console / Work gate to the organization home.
Description check Passed The description directly explains the gate behavior, Console and Work flows, cookie persistence, layout changes, temporary scope, and testing. It is fully related to the changeset.
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.

Full details: Docstring Coverage

Explanation

Docstring coverage is 35.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 13 files. (2 skipped: 2 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@softmarshmallow
softmarshmallow merged commit 7b243ff into main Oct 12, 2026
29 checks passed

This branch was successfully deployed

2 active deployments
Preview – grida — bac1735d Deployed Oct 12, 2026 by vercel[bot]
Preview – api — bac1735d Deployed Oct 12, 2026 by vercel[bot]
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.

1 participant