Skip to content

feat(theme): seleção de cor de destaque com persistência - #228

Merged
actus7 merged 1 commit into
mainfrom
feat/custom-themes
Aug 17, 2026
Merged

feat(theme): seleção de cor de destaque com persistência#228
actus7 merged 1 commit into
mainfrom
feat/custom-themes

Conversation

@actus7

@actus7 actus7 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Resumo

Resolve #177 — temas customizáveis além de dark/light (MVP: accent colors).

Backend

  • Novo campo accentColor String? em UserSettings + migration 20260817120000_user_settings_accent_color.
  • GET/PATCH /user/settings aceitam/retornam accentColor; PATCH rejeita ids fora da allowlist com 400.
  • lib/accent-colors.ts compartilha a allowlist (default + 6 presets: azul, violeta, esmeralda, laranja, rosa, turquesa) entre server e client + testes unitários.

Frontend

  • Presets em OKLCH via data-accent no <html>, cobrindo claro e escuro (--primary, --ring, --accent, --sidebar-primary…). Sem atributo, o tema atual (navy/âmbar) permanece exatamente igual — "Padrão" é uma opção explícita.
  • AccentProvider sincroniza com /user/settings e grava em localStorage; script inline no <head> aplica o accent antes da hidratação (anti-flash).
  • Nova aba Aparência no dialog de configurações com swatches circulares, check no ativo e aplicação imediata (PATCH fire-and-forget com toast de erro).

Verificações

  • pnpm lint
  • pnpm typecheck
  • pnpm test (340 testes, incluindo os novos de accent-colors)

Closes #177

- Novo campo accentColor em UserSettings (migration incluida) com
  validacao server-side contra allowlist em lib/accent-colors.
- 6 presets de accent (blue/violet/emerald/sorange/rose/teal) via
  data-accent no <html>, em oklch, cobrindo claro e escuro; sem atributo
  o tema atual permanece identico.
- AccentProvider sincroniza com /user/settings e grava em localStorage;
  script inline no layout aplica antes da hidratacao (anti-flash).
- Nova aba Aparencia no dialog de configuracoes com swatches.
Copilot AI lite review requested due to automatic review settings August 17, 2026 13:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
modelhub Ready Ready Preview Aug 17, 2026 1:16pm

@github-actions github-actions Bot added frontend Frontend changes backend Backend changes database Database changes tests Test changes labels Aug 17, 2026
@actus7
actus7 merged commit edcb145 into main Aug 17, 2026
12 checks passed
@actus7
actus7 deleted the feat/custom-themes branch August 17, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend changes database Database changes frontend Frontend changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: temas customizáveis além de dark/light

2 participants