Skip to content

fix(layout): adicionar verificações seguras de hidratação no LegacyHome - #67

Merged
alltomatos merged 1 commit into
alltomatos:devfrom
BFLabsAI:fix/legacy-layout-hydration-guard
Aug 26, 2026
Merged

fix(layout): adicionar verificações seguras de hidratação no LegacyHome#67
alltomatos merged 1 commit into
alltomatos:devfrom
BFLabsAI:fix/legacy-layout-hydration-guard

Conversation

@BFLabsAI

@BFLabsAIBFLabsAI commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Issue for this PR

Closes#69

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Ao desmarcar a flag de "Novo Layout" nas configurações (newLayoutDesigns: false), o aplicativo travava na tela inicial de loading.

Isso ocorria porque o componente LegacyHome tentava acessar diretamente propriedades como sync().data.path.home e sync().data.project.slice() dentro de createMemo antes do ServerSync estar completamente hidratado no mount inicial do Solid.js, disparando um TypeError não tratado que quebrava o root reativo.

Este PR adiciona verificações seguras de null-safety (sync().data?.path?.home ?? "" e sync().data?.project ?? []) nas propriedades memoizadas e blocos de template (<Match> e <For>) em packages/app/src/pages/home/legacy-home.tsx.

How did you verify your code works?

Testado localmente validando a inicialização do componente LegacyHome com stores não hidratados, garantindo que nenhum erro de execução seja disparado durante a montagem e hidratação dos dados.

Screenshots / recordings

N/A - Correção de segurança contra falha de renderização no carregamento inicial.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Evita TypeError não tratado durante a renderização do Solid.js quando a flag
newLayoutDesigns está desativada, impedindo o congelamento/crash do aplicativo
na tela de abertura caso sync().data ainda não esteja completamente hidratado.
@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@alltomatos
alltomatos merged commit 1a4c20d into alltomatos:devAug 26, 2026
5 of 6 checks passed
Sign up for freeto 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.

bug(layout): crash na inicialização ao desmarcar a opção de Novo Layout (newLayoutDesigns=false)

2 participants

@BFLabsAI@alltomatos