Skip to content

Fix layout shift caused by dynamically loaded Bulletins component #4110

@cemreinanc

Description

@cemreinanc

Problem

The Bulletins component in front_end/src/app/(main)/components/bulletins.tsx is loaded dynamically without SSR (ssr: false). This causes a layout shift even if there are no bulletins to show because:

  1. During SSR/initial render, the component renders nothing
  2. When hydration happens on the client, the component renders and adds mt-12 margin
  3. This shifts the content below it

The mt-12 margin is currently in the Bulletins component, but it's actually serving as spacing between the header and page content - a layout concern that shouldn't be tied to bulletins.

Consider these approaches:

  1. Move spacing to layout or header itself: Add the spacing directly in layout.tsx on the content container or adjust GlobalHeader to decouple it from the dynamically loaded Bulletins component
  2. Server-side fetch: Make the bulletins data fetched on the server so the component can be SSR'd with the correct content/dimensions from the start

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions