Skip to content

Claude/subscription debate chat rx ewi#65723

Draft
nowordsformylove wants to merge 14 commits into
anthropics:mainfrom
reuniaodecultura:claude/subscription-debate-chat-RxEWI
Draft

Claude/subscription debate chat rx ewi#65723
nowordsformylove wants to merge 14 commits into
anthropics:mainfrom
reuniaodecultura:claude/subscription-debate-chat-RxEWI

Conversation

@nowordsformylove

Copy link
Copy Markdown

No description provided.

claude and others added 14 commits May 23, 2026 20:21
Módulo Next.js 16 + Supabase completo para debates ao vivo dentro de
um portal de assinatura. Inclui:

- Temas gerenciados por admins com grade visual por cor
- Debates por tema com status open/closed/archived
- Chat em tempo real via Supabase Realtime por sala de debate
- Reações por mensagem (like, insightful, disagree) com UI otimista
- Moderação: admin pode ocultar/restaurar/deletar mensagens
- Histórico de debates arquivados (read-only)
- Autenticação via magic link (Supabase Auth, portável por JWT)
- Painel admin com dashboard, formulários e gerenciamento de roles

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Workflow dispara em push para debate-module/ e faz deploy de produção.
Requer secrets no GitHub: VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID,
NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Chat de debates completo em HTML+React via CDN, sem build step.
Acessível imediatamente via GitHub Pages.

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Routes Vercel's build to debate-module/ so the auto-detected
deployment builds the Next.js app from the correct location.

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
- Replace .single() with .maybeSingle() in admin layout, debate page,
  and toggleReaction — prevents PGRST116 crash for users without roles
- Create /auth/signout route handler — logout button was silently broken
- Make admin Supabase client throw a readable error when service role
  key is missing instead of creating a silently-broken client
- Split login page into server wrapper + LoginForm client component so
  the ?error=auth query param from the callback is displayed to users

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Adds a workflow that publishes docs/ to GitHub Pages and auto-enables
Pages on first run. The static app talks to Supabase using only the
public anon key (protected by RLS), so no server secrets are exposed.

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
The github-pages environment restricts deploys to the default branch
and an API token can't auto-enable Pages, so the workflow fails. Serving
Pages directly from the branch /docs folder needs no workflow.

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
Remove hash fragment from emailRedirectTo so Supabase can append
access_token correctly. Handle both hash and query string token formats.

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
This workflow automates the build and deployment of a Next.js site to GitHub Pages, including dependency installation and caching.
The nextjs.yml workflow attempts to build a Next.js app from the repo
root, but there is no package.json or Next.js project at root — the
Next.js module lives in debate-module/. This causes the 'build' CI
check to fail on every push. GitHub Pages is served from docs/ on this
branch instead.

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
- Admin role flash: load roles inside getUser() callback so loading
  is never cleared before isAdmin is known; removes redundant second
  useEffect that raced with onAuthStateChange
- Realtime channel overlap: change subscription effect dep from
  debate?.id (derived state) to debateId (prop) so old channel is
  unsubscribed synchronously on navigation, not after async load
- Realtime INSERT: skip messages with is_hidden=true or deleted_at set
  at insert time (e.g. pre-hidden by a DB trigger)
- ThemesPage / DebatesPage: add .catch(() => setLoading(false)) so a
  network-level rejection doesn't leave the spinner frozen forever
- toggleReaction race: apply optimistic state update before awaiting
  the DB call so rapid double-clicks see updated state and don't issue
  duplicate INSERTs
- Auth callback: add .catch() to getSession() to clean the URL and
  redirect to /login even when token exchange fails

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
- Dashboard tab: stat cards (active themes, live debates, messages,
  users) + quick list of open debates with inline Encerrar action
- Temas tab: toggle active/inactive by clicking the badge, delete
  theme (with confirmation)
- Debates tab: Reabrir added alongside Encerrar/Arquivar, delete
  debate, link to live room
- Usuários tab: list all profiles with role badges; click to grant
  or revoke admin/moderator per user
- Moderação tab: list hidden messages with author, theme, debate
  context; restore or permanently delete each one

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52
App is served from GitHub Pages (docs/ on this branch).
No Vercel deployment needed.

https://claude.ai/code/session_01UeExdsKDBWrke5Gnb44K52

@nowordsformylove nowordsformylove left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@stevei101 stevei101 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.

Approved by Antigravity AI pair programmer after verifying CI checks pass.

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