Ajustes de design da revisão de “Minha conta” — Plano de implementação
TLDR: ajusta tipografia e tokens do
AccountCard, o card doLayoutcentrado (altura, margens, título) e remove os dividers finais de Minha disponibilidade.
Spec:
.project/docs/specs/20261009120000_my_account_design_review.mdBranch:fix/my-account-design-review
Arquitetura: só CSS-in-JS (emotion + sx do MUI). O layout centrado sobrescreve, no próprio LayoutCenteredColumn, as regras herdadas de LayoutColumn e o título/margem do Container filho, sem tocar Container nem as outras telas. Os dividers saem via bordered={false} no Row e via seletor :last-of-type na variante full do WeeklyHours.
Stack: Next.js, React, MUI 5, emotion, Jest + Testing Library (jsdom).
Restrições globais
- Cores sempre por token do tema (
secondary.main,common.black,uiAccent.main), nunca hex literal. - Nada muda fora do layout centrado e da variante
fulldoWeeklyHours. - Testes no padrão do projeto:
// arrange,// act,// assert,expectde@jest/globals. - Baseline:
npx tsc --noEmitjá falha namaincom 21 erros emsrc/services/media/index.test.tsesrc/services/feature/test/feature.test.ts; o critério é não adicionar erros novos.
Task 1: AccountCard — tipografia e tokens
Files:
- Modify: src/containers/MyAccount/components/AccountCard/AccountCard.tsx
- Modify: src/containers/MyAccount/components/AccountCard/styled.ts
- Test: src/containers/MyAccount/test/MyAccount.test.tsx
Interfaces:
- Consumes: tema do projeto (@/theme) com palette.uiAccent.
- Produces: nada consumido por outras tasks.
- [ ] Step 1: Write the failing test
Trocar o tema do teste pelo tema do projeto (o createTheme() padrão não tem uiAccent) e adicionar:
```tsx import theme from “@/theme”; // remover: import { ThemeProvider, createTheme } … e const theme = createTheme(); import { ThemeProvider } from “@mui/material/styles”;
it(“should render card title and description with figma typography”, () => { // arrange mockSubscription(EUserSubscriptionSlug.REGULAR_CLIENT);
// act renderMyAccount();
// assert const title = screen.getByRole(“heading”, { name: “Meu Perfil” }); const description = screen.getByText(/Edite suas informações profissionais/);
expect(title).toHaveStyle({ fontSize: “1rem”, lineHeight: “normal”, letterSpacing: “-0.32px”, }); expect(description).toHaveStyle({ lineHeight: “18px”, letterSpacing: “-0.24px”, color: “#646464”, }); }); ```
- [ ] Step 2: Run to verify it fails
bash
npx jest src/containers/MyAccount/test/MyAccount.test.tsx
Expected: FAIL — lineHeight atual é 1.75 / 1.66 e letterSpacing positivo.
- [ ] Step 3: Write minimal implementation
AccountCard.tsx:
```tsx <AccountCardLink component={Link} href={href}> <Icon sx={{ fontSize: 32, color: “common.black” }} />
</AccountCardLink> ```
styled.ts — borda por token e sem o padding reduzido no mobile:
```ts export const AccountCardLink = styled(Box)<{ href: string }>` display: flex; align-items: center; gap: 1.25rem; padding: 1.5rem; border: 1px solid ${({ theme }) => theme.palette.uiAccent.main}; border-radius: 1rem; color: inherit; text-decoration: none; transition: background-color 0.2s ease;
&:hover {
background-color: ${({ theme }) => theme.palette.grey[100]};
}
;
``
- [ ] Step 4: Run to verify it passes
bash
npx jest src/containers/MyAccount
Expected: PASS (testes de cards por perfil continuam verdes).
- [ ] Step 5: Commit
bash
git add src/containers/MyAccount
git commit -m "fix: my account card typography and tokens"
Task 2: Layout centrado — altura, margens e título
Files:
- Modify: src/components/Layout/styled.ts
- Test: src/components/Layout/test/Layout.test.tsx (novo)
Interfaces:
- Consumes: Layout com withMenu={false} centered; Container (@/components/ui/Container) como filho.
- Produces: nada consumido por outras tasks.
- [ ] Step 1: Write the failing test
```tsx import React from “react”; import { render, screen } from “@testing-library/react”; import { expect } from “@jest/globals”; import { ThemeProvider } from “@mui/material/styles”; import theme from “@/theme”; import Layout from “../Layout”; import Container from “@/components/ui/Container”;
jest.mock(“../../Footer”, () => () => null);
const renderCenteredLayout = () =>
render(
<ThemeProvider theme={theme}>
<Layout withMenu={false} centered>
describe(“Layout centered”, () => { it(“should fit the card to its content”, () => { // arrange / act renderCenteredLayout();
// assert
const container = screen.getByText("conteúdo").parentElement!;
const card = container.parentElement!;
expect(card).toHaveStyle({ minHeight: "auto" });
expect(container).toHaveStyle({ marginBottom: "0px" }); });
it(“should render the title with figma h1 typography”, () => { // arrange / act renderCenteredLayout();
// assert
expect(screen.getByRole("heading", { level: 1 })).toHaveStyle({
fontSize: "1.375rem",
fontWeight: "700",
letterSpacing: "-0.44px",
lineHeight: "normal",
}); }); }); ```
Se o
Footerestiver em outro caminho de import noLayout.tsx(../Footer), ajustar ojest.mockpara o mesmo módulo. Sescreen.getByText("conteúdo").parentElementnão for oContainerBox(por causa doTransitionComponent), subir até o elemento cujo pai é o card (LayoutCenteredColumn > div).
- [ ] Step 2: Run to verify it fails
bash
npx jest src/components/Layout
Expected: FAIL — min-height é calc(100dvh - 141px), margin-bottom é 32px e o título tem font-weight: 600.
- [ ] Step 3: Write minimal implementation
Substituir LayoutCenteredColumn em src/components/Layout/styled.ts:
```ts export const LayoutCenteredColumn = styled(LayoutColumn)` max-width: 66rem; margin: 2rem auto 0;
nav { padding-left: 0; }
div { min-height: auto;
> div {
margin-bottom: 0;
}
h1 {
font-size: 1.375rem;
font-weight: 700;
letter-spacing: -0.44px;
line-height: normal;
}
@media only screen and (max-width: 1120px) {
margin-top: 0;
} }
@media only screen and (max-width: ${({ theme }) => theme.breakpoints.values.md}px) { margin-top: 1rem;
> nav {
padding-left: 1rem;
}
> div {
margin-bottom: 0;
min-height: auto;
h1 {
margin-bottom: 1.5rem;
}
} } `; ```
- [ ] Step 4: Run to verify it passes
bash
npx jest src/components/Layout src/containers/MyAccount
Expected: PASS
- [ ] Step 5: Commit
bash
git add src/components/Layout
git commit -m "fix: centered layout card fits content"
Task 3: Minha disponibilidade — dividers finais
Files:
- Modify: src/containers/WeeklyHours/WeeklyHours.tsx
- Modify: src/containers/AddException/AddException.tsx
- Test: src/containers/WeeklyHours/test/WeeklyHours.test.tsx (novo)
- Test: src/containers/AddException/test/AddException.test.tsx (novo)
Interfaces:
- Consumes: WeeklyHours (availabilities, variant), AvailabilitiesProvider de @/hooks/useAvailabilities.
- Produces: nada.
- [ ] Step 1: Write the failing tests
WeeklyHours.test.tsx:
```tsx import React from “react”; import { render, screen } from “@testing-library/react”; import { expect } from “@jest/globals”; import { ThemeProvider } from “@mui/material/styles”; import theme from “@/theme”; import WeeklyHours from “../WeeklyHours”;
const renderWeeklyHours = (variant: “full” | “compact”) => render( <ThemeProvider theme={theme}> <WeeklyHours availabilities={[]} variant={variant} /> </ThemeProvider>, );
const dayRow = (label: string) => screen.getByText(label).parentElement!.parentElement!;
describe(“WeeklyHours”, () => { it(“should not render a divider below the last week day on full variant”, () => { // arrange / act renderWeeklyHours(“full”);
// assert
expect(dayRow("Sáb")).toHaveStyle({ borderBottomStyle: "none" });
expect(dayRow("Sex")).toHaveStyle({ borderBottomStyle: "solid" }); });
it(“should keep the last week day divider on compact variant”, () => { // arrange / act renderWeeklyHours(“compact”);
// assert
expect(dayRow("Sáb")).toHaveStyle({ borderBottomStyle: "solid" }); }); }); ```
AddException.test.tsx:
```tsx import React from “react”; import { render, screen } from “@testing-library/react”; import { expect } from “@jest/globals”; import { ThemeProvider } from “@mui/material/styles”; import theme from “@/theme”; import { AvailabilitiesProvider } from “@/hooks/useAvailabilities”; import AddException from “../AddException”;
describe(“AddException”, () => {
it(“should not render a divider below the add exception block”, () => {
// arrange / act
render(
<ThemeProvider theme={theme}>
<AvailabilitiesProvider initialAvailabilities={[]}>
// assert
const block = screen.getByRole("heading", { name: "Adicionar Exceções" })
.parentElement!;
expect(block).not.toHaveStyle({ borderBottomStyle: "solid" }); }); }); ```
Se o
ExceptionForm/ExceptionListexigirQueryClientProvider, envolver o render em<QueryClientProvider client={new QueryClient()}>de@tanstack/react-query. Se o jsdom não expandirborder-bottomemborder-bottom-style, comparar comtoHaveStyle("border-bottom: none")/ ausência da regra.
- [ ] Step 2: Run to verify they fail
bash
npx jest src/containers/WeeklyHours src/containers/AddException
Expected: FAIL — Sáb e o bloco de exceções têm border-bottom: 1px solid.
- [ ] Step 3: Write minimal implementation
WeeklyHours.tsx — trocar o wrapper:
tsx
<Box
mb={mb}
sx={
variant === "full"
? { "> div:last-of-type": { borderBottom: "none" } }
: undefined
}
>
AddException.tsx:
tsx
<Row bordered={false}>
- [ ] Step 4: Run to verify they pass
bash
npx jest src/containers/WeeklyHours src/containers/AddException src/containers/OnBoarding
Expected: PASS
- [ ] Step 5: Commit
bash
git add src/containers/WeeklyHours src/containers/AddException
git commit -m "fix: remove trailing dividers on availability page"
Task 4: Verificação final
- [ ] Step 1:
npm run lint— 0 erros. - [ ] Step 2:
npx tsc --noEmit— apenas os 21 erros já existentes namain. - [ ] Step 3:
npx jest— tudo verde. - [ ] Step 4: atualizar
status: in_progress→donena spec quando a PR for aberta. - [ ] Step 5:
commons:review-designcom screenshots (precisa de usuário PRO de seed) comparando/app/minha-conta,/app/minha-conta/dados-pessoaise/app/minha-disponibilidadecom os frames do Figma.