Skip to content

fix: finish UI cleanup and OpenRouter model catalog - #47

Merged
Programcode merged 26 commits into
mainfrom
cleanup/ui-model-catalog-ready
Sep 19, 2026
Merged

Programcode merged 26 commits into
mainfrom
cleanup/ui-model-catalog-ready

Conversation

@Programcode

@Programcode Programcode commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Problem

The app homepage no longer fit its feature count, navigation overflowed during startup and refresh, admin navigation appeared late, and the Factoids and Sparring layouts had alignment and space problems. The landing preview, debate prompts, and model catalog also no longer matched the product.

Result

  • Reorganizes the app homepage into the selected grouped Prepare, Practice, and Utilities layout while preserving the existing visual system.
  • Makes desktop and mobile navigation responsive without horizontal scrolling, keeps admin navigation stable during role loading, and replaces the unstyled startup flash with the themed shell.
  • Tightens the Factoids and Sparring layouts, removes redundant page copy, and updates the landing preview to mirror Generate, Crossfire, and Sparring.
  • Routes the shared ten-model Basic/Pro catalog through OpenRouter with Luna as the Basic default and Sonnet as the Pro default.
  • Keeps trial reasoning at Low and Pro reasoning at Low, Medium, or High. GLM and DeepSeek keep Medium visible but resolve it to Low server-side as specified.
  • Migrates the former GLM default safely: old local settings use Luna immediately, active Pro hydration restores GLM, and trial or former-Pro accounts keep Luna.
  • Rewrites the shared debate prompt style so Crossfire, Sparring, and streamed Ask use direct, familiar language.

Validation

  • npm run verify
    • docs, lint, TypeScript, and production build passed
    • 104 test files and 1,042 unit tests passed
    • 176 Edge Function tests passed
    • 157 desktop/mobile Chromium tests passed; 1 expected project-specific skip
  • CI=1 PORT=18080 PLAYWRIGHT_BASE_URL=http://127.0.0.1:18080 npm run test:e2e:webkit: 79 passed
  • ./.superset/db-gate.sh: 27 pgTAP tests passed; local Supabase was stopped afterward
  • Exact-head live OpenRouter matrix using the existing secrets SQLite key: 23/23 passed across all ten catalog models, native reasoning cases, Medium-to-Low fallback cases, trial streaming, Pro streaming, and Crossfire. Output artifacts were checked for secret leakage.
  • Visual browser review at 390px and 1440px covered landing, app home, Factoids, Sparring, Settings/admin navigation, and the landing Crossfire/Sparring preview modes. No horizontal overflow or page/console errors were observed.
  • Two independent final reviews reported no remaining actionable blocker.

Protected staging E2E was not run because STAGING_SUPABASE_URL, STAGING_SUPABASE_ANON_KEY, and STAGING_DEMO_CODE are absent. Production was not used as a substitute.

This PR is intentionally left unmerged for Adam's review.

Summary by CodeRabbit

  • New Features

    • Added an interactive homepage preview for Generate, Crossfire, and Sparring.
    • Expanded AI model selection to 10 models, with Luna Basic as the default and additional Pro-only options.
    • Added grouped home tools and a responsive desktop “More” navigation menu.
    • Added Crossfire and Sparring content to onboarding, marketing, and updates.
  • Improvements

    • Simplified Sparring setup with a compact format selector and collapsible speaking-order details.
    • Added a clearer startup loading screen and reloadable error state.
    • Improved AI responses with more concise, plain-language guidance.

Copilot AI lite review requested due to automatic review settings September 19, 2026 17:30
@vercel

vercel Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Sep 19, 2026 7:03pm UTC

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 692c555c-d369-4734-bd59-3e55f08a5240

📥 Commits

Reviewing files that changed from the base of the PR and between e9c4354 and 63725f6.

📒 Files selected for processing (60)
  • docs/architecture.md
  • e2e/authed-pages.spec.ts
  • e2e/home-navigation.spec.ts
  • e2e/quality-backlog.spec.ts
  • e2e/sparring.spec.ts
  • e2e/startup-shell.spec.ts
  • index.html
  • public/theme-init.js
  • src/bootstrap.ts
  • src/components/features/factoids/FactoidsForm.tsx
  • src/components/features/onboarding/OnboardingTour.tsx
  • src/components/features/sparring/SparringSetup.tsx
  • src/components/landing/Features.tsx
  • src/components/landing/Footer.tsx
  • src/components/landing/Hero.tsx
  • src/components/landing/SocialProof.tsx
  • src/components/landing/WhatsNew.tsx
  • src/components/layout/AppLayout.tsx
  • src/lib/stores/settings-store.ts
  • src/locales/en.json
  • src/locales/es.json
  • src/locales/hu.json
  • src/pages/AttackPage.tsx
  • src/pages/BrainstormPage.tsx
  • src/pages/CrossfirePage.tsx
  • src/pages/FactoidsPage.tsx
  • src/pages/FlowchartPage.tsx
  • src/pages/GeneratePage.tsx
  • src/pages/HistoryPage.tsx
  • src/pages/HomePage.tsx
  • src/pages/LibraryPage.tsx
  • src/pages/SettingsPage.tsx
  • src/pages/TimerPage.tsx
  • src/test/ai/streaming.test.ts
  • src/test/components/AppLayout.test.tsx
  • src/test/components/ModelSelector.test.tsx
  • src/test/components/SparringSetup.test.tsx
  • src/test/mocks/supabase.ts
  • src/test/observability.test.ts
  • src/test/pages/HistoryPage.test.tsx
  • src/test/pages/SettingsAdminNavigation.test.tsx
  • src/test/pages/SparringPage.test.tsx
  • src/test/pages/pages.test.tsx
  • src/test/providers.test.ts
  • src/test/security-hardening.test.ts
  • src/test/settings-store.test.ts
  • src/test/stores/settings-store-additional.test.ts
  • src/test/stores/settings-store-branches.test.ts
  • src/test/stores/settings-store-extended.test.ts
  • src/test/vercel-deployment-config.test.ts
  • supabase/README.md
  • supabase/functions/_shared/model-catalog.test.ts
  • supabase/functions/_shared/model-catalog.ts
  • supabase/functions/_shared/prompts.test.ts
  • supabase/functions/_shared/prompts.ts
  • supabase/functions/ai-stream/handler_test.ts
  • supabase/functions/ai-stream/index_test.ts
  • supabase/functions/ai-stream/prompt.test.ts
  • supabase/functions/ai/generate-honesty_test.ts
  • supabase/functions/ai/handler-research.test.ts
💤 Files with no reviewable changes (7)
  • src/pages/GeneratePage.tsx
  • src/pages/CrossfirePage.tsx
  • src/pages/FactoidsPage.tsx
  • src/pages/AttackPage.tsx
  • src/pages/BrainstormPage.tsx
  • src/pages/TimerPage.tsx
  • src/components/landing/Footer.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Model catalog and entitlement handling

Layer / File(s) Summary
Model catalog and entitlement handling
supabase/functions/_shared/model-catalog.ts, src/lib/stores/settings-store.ts, src/test/..., docs/architecture.md, supabase/README.md
The application now supports a ten-model OpenRouter catalog. GPT-5.6 Luna is the Basic default. Pro models require eligible access. Legacy configurations migrate to the new defaults.
Prompt behavior and AI validation
supabase/functions/_shared/prompts.ts, supabase/functions/_shared/*test.ts
Prompts now require concise, plain-language, evidence-based responses. Crossfire and sparring guidance is more specific.
Startup shell and bootstrap recovery
index.html, public/theme-init.js, src/bootstrap.ts, e2e/startup-shell.spec.ts
Private and login routes show a startup shell. Main-entry failures show a reloadable error. Jam recorder loading no longer blocks application startup.
Navigation, home, and onboarding
src/pages/HomePage.tsx, src/components/layout/AppLayout.tsx, src/components/features/onboarding/OnboardingTour.tsx, e2e/home-navigation.spec.ts, src/test/components/AppLayout.test.tsx
Home tools are grouped into Prepare, Practice, and Utilities. Desktop overflow routes use a More menu. Mobile navigation retains all routes. Onboarding targets visible elements.
Landing content and localized interface
src/components/landing/*, src/locales/*, src/pages/*Page.tsx
The landing preview now supports Generate, Crossfire, and Sparring selections. Feature, pricing, privacy, navigation, and page text were updated in English, Spanish, and Hungarian. Several subtitles were removed.
Sparring setup and responsive controls
src/components/features/sparring/SparringSetup.tsx, src/components/features/factoids/FactoidsForm.tsx, e2e/sparring.spec.ts, src/test/components/SparringSetup.test.tsx
Sparring uses a compact format selector and collapsible speaking-order details. Factoids labels use fixed sizing.
Admin access state and validation
src/pages/SettingsPage.tsx, src/test/pages/SettingsAdminNavigation.test.tsx, src/test/mocks/supabase.ts
Settings queries user_roles through React Query and renders loading, failure, retry, and role-based navigation states.

Estimated code review effort: 5 (Critical) | ~90 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant Bootstrap
  participant Main
  participant AppLayout
  participant HomePage
  Browser->>Bootstrap: load application
  Bootstrap->>Main: import entry module
  Main->>AppLayout: mount application shell
  AppLayout->>HomePage: render grouped tools
  HomePage-->>Browser: display responsive navigation
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

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

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Entitlement-read failures can permanently downgrade Pro models, empty Pro configs default incorrectly, and localized model claims remain stale.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

This PR completes UI/navigation cleanup and expands the shared OpenRouter model catalog.

Changes:

  • Improves responsive navigation, startup shells, homepage grouping, landing previews, and feature layouts.
  • Adds ten-model Basic/Pro routing, reasoning rules, migrations, prompt updates, translations, and tests.
  • Follow-up is needed for entitlement-read failures, empty Pro defaults, and stale localized model claims.
File Reviewed change
supabase/​README.md Documents the expanded model catalog.
supabase/​functions/​ai/​handler-research.test.ts Tests catalog routing and reasoning.
supabase/​functions/​ai/​generate-honesty_test.ts Updates model fixtures.
supabase/​functions/​ai-stream/​prompt.test.ts Tests shared prompt rules.
supabase/​functions/​ai-stream/​handler_test.ts Updates streaming model fixtures.
supabase/​functions/​_shared/​prompts.ts Adds plain-language prompt guidance.
supabase/​functions/​_shared/​prompts.test.ts Tests prompt calibration.
supabase/​functions/​_shared/​model-catalog.ts Defines the expanded model catalog.
supabase/​functions/​_shared/​model-catalog.test.ts Validates catalog and reasoning rules.
src/​test/​vercel-deployment-config.test.ts Tests startup-shell configuration.
src/​test/​stores/​settings-store-extended.test.ts Updates settings defaults.
src/​test/​stores/​settings-store-branches.test.ts Tests settings migration.
src/​test/​stores/​settings-store-additional.test.ts Updates settings behavior tests.
src/​test/​settings-store.test.ts Tests entitlement-aware model hydration.
src/​test/​security-hardening.test.ts Updates routing security assertions.
src/​test/​providers.test.ts Tests the provider catalog.
src/​test/​pages/​SparringPage.test.tsx Updates Sparring UI tests.
src/​test/​pages/​SettingsAdminNavigation.test.tsx Tests admin-role navigation.
src/​test/​pages/​pages.test.tsx Tests homepage and landing changes.
src/​test/​pages/​HistoryPage.test.tsx Updates heading tests.
src/​test/​observability.test.ts Updates model telemetry fixtures.
src/​test/​components/​SparringSetup.test.tsx Tests compact Sparring setup.
src/​test/​components/​ModelSelector.test.tsx Tests catalog and entitlement controls.
src/​test/​components/​AppLayout.test.tsx Tests responsive navigation.
src/​test/​ai/​streaming.test.ts Updates streaming model fixtures.
src/​pages/​TimerPage.tsx Removes redundant subtitle.
src/​pages/​SettingsPage.tsx Adds cached admin-role querying.
src/​pages/​LibraryPage.tsx Removes redundant descriptions.
src/​pages/​HomePage.tsx Groups tools into Prepare, Practice, and Utilities.
src/​pages/​HistoryPage.tsx Simplifies page content.
src/​pages/​GeneratePage.tsx Removes redundant subtitle.
src/​pages/​FlowchartPage.tsx Simplifies the header.
src/​pages/​FactoidsPage.tsx Removes redundant subtitle.
src/​pages/​CrossfirePage.tsx Removes redundant subtitle.
src/​pages/​BrainstormPage.tsx Removes redundant subtitle.
src/​pages/​AttackPage.tsx Removes redundant subtitle.
src/​locales/​hu.json Updates Hungarian translations.
src/​locales/​es.json Updates Spanish translations.
src/​locales/​en.json Updates English translations.
src/​lib/​stores/​settings-store.ts Adds model migration and entitlement normalization.
src/​components/​layout/​AppLayout.tsx Adds responsive desktop/mobile navigation.
src/​components/​landing/​WhatsNew.tsx Adds new tool highlights.
src/​components/​landing/​SocialProof.tsx Updates tool count.
src/​components/​landing/​Hero.tsx Adds interactive mode previews.
src/​components/​landing/​Footer.tsx Removes redundant tagline.
src/​components/​landing/​Features.tsx Adds Crossfire and Sparring.
src/​components/​features/​sparring/​SparringSetup.tsx Compacts setup controls.
src/​components/​features/​onboarding/​OnboardingTour.tsx Resolves visible tour targets.
src/​components/​features/​factoids/​FactoidsForm.tsx Aligns timeframe controls.
src/​bootstrap.ts Improves startup and recovery handling.
public/​theme-init.js Applies the startup shell and theme early.
index.html Adds themed startup and error shells.
e2e/​startup-shell.spec.ts Tests startup behavior.
e2e/​sparring.spec.ts Updates Sparring browser coverage.
e2e/​home-navigation.spec.ts Tests navigation responsiveness.
e2e/​authed-pages.spec.ts Tests Factoids alignment.
docs/​architecture.md Documents the expanded catalog.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib/stores/settings-store.ts Resolved
@Programcode
Programcode requested a lite review from Copilot September 19, 2026 17:55

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Programcode
Programcode merged commit 9689594 into main Sep 19, 2026
7 checks passed
@Programcode
Programcode deleted the cleanup/ui-model-catalog-ready branch September 19, 2026 19:22

This branch was successfully deployed

1 active deployment
Preview — 63725f6d Deployed Sep 19, 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.

2 participants