Add currency to users, locale/currency to admin profile, fix hardcoded dark-mode in infra views#14
Draft
Add currency to users, locale/currency to admin profile, fix hardcoded dark-mode in infra views#14
Conversation
…dark mode in infra views Co-authored-by: gerichkoeke <125511907+gerichkoeke@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update User model to include locale and currency
Add currency to users, locale/currency to admin profile, fix hardcoded dark-mode in infra views
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three related gaps:
currencymissing fromUser.$fillableand the DB, admin panel Profile page lacking locale/currency fields, and infra views forcing dark theme via hardcoded inline styles that break the light theme.User model & DB
currencytoUser::$fillablegetActiveCurrencyAttribute()now falls back to$this->currencyinstead of always returning'BRL'for admin userscurrency VARCHAR(10) DEFAULT 'BRL'touserstableAdmin Profile page
Added "Moeda e Idioma" section to bring the admin profile to parity with distributor/partner panels:
Dark-mode fixes in infra views
Root cause: views used
.infra-dark { background-color:#1f2937 !important }+style="color-scheme:dark;background-color:#1f2937"inline overrides, forcing dark backgrounds regardless of the Filament theme.customer-infra.blade.php: removed both<style>.infra-dark</style>blocks and<div class="infra-dark">wrapper; removed all$icStyleinline style attributes; updatedproposta_currency/sim_currencyselects and backup machine inputscustomer-infra.blade.php: updated$ic/$scPHP variablesbg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-whitepatternOriginal prompt
Contexto
O projeto é um ERP Laravel/Filament com três painéis (admin, distributor, partner). Os arquivos de tradução já foram criados (
lang/pt_BR/app.php,lang/en/app.php,lang/es/app.php), o middlewareSetLocalejá existe e está registrado embootstrap/app.phpe nos três PanelProviders. Agora precisamos garantir que:Usermodel tenhalocaleecurrencyno$fillable, e que oLocaleControllerpersista corretamente.distributorepartnerjá têm esses campos noEditProfile, mas o admin não tem.bg-whitesemdark:bg-gray-*, classes fixas de tema escuro (bg-gray-800,bg-gray-900hardcoded sem fallback para tema claro), e o arquivocustomer-infra-pricing-modal.blade.phpusabg-whitesem suporte dark. Isso causa o fundo branco visível na screenshot.Screenshot do problema
A página de Infraestrutura mostra fundo branco porque as views estão usando cores hardcoded em vez de usar as variáveis de tema do Filament.
Tarefas a implementar
1. Garantir persistência global do locale/currency
app/Models/User.php— adicionarlocaleecurrencyao$fillable:Verificar se
currencyexiste na tabelausers. Se não existir, criar migration:app/Http/Controllers/LocaleController.php— já persistelocaleno user. Confirmar que está correto (já parece ok).2. Adicionar campos de Moeda e Idioma ao perfil do Admin
app/Filament/Admin/Pages/Profile.php— adicionar seção "Moeda e Idioma" aoprofileForm:No
mount(), incluirlocaleecurrencynoprofileData:No
saveProfile(), persistir e aplicar o locale:3. Corrigir views com fundo branco / cores hardcoded para usar tema Filament
O problema principal é que várias views usam classes Tailwind de tema escuro fixo (
bg-gray-800,bg-gray-900) ou branco fixo (bg-white) sem suporte ao tema claro/escuro do Filament (que usadark:prefix).Arquivos a corrigir:
resources/views/filament/partner/resources/customer-resource/pages/customer-infra.blade.php<style>duplicados com.infra-darkhardcoded em dark$ic,$sc,$lc,$bp,$bd,$bg) por classes que funcionem tanto no tema claro quanto escuro, ex:$ic:'w-full rounded-lg px-3 py-2 text-sm bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:outline-none focus:border-primary-500 focus:ring-1 focus:ring-primary-500'$sc: mesmo padrão$icStyleinline combackground-color:#1f2937<div class="infra-dark">e o</div>correspondenteproposta_currency), trocarstyle="color-scheme:dark;background-color:#1f2937;"por classes Tailwind: `class="w-full rounded-lg bg-white dark:bg-gray-800 border border-gray...This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.