Skip to content

[Docs] Add dynamic topbar banner - #4264

Merged
m-bert merged 3 commits into
software-mansion:mainfrom
p-malecki:@p-malecki/add-topbar-banner
Jun 17, 2026
Merged

[Docs] Add dynamic topbar banner#4264
m-bert merged 3 commits into
software-mansion:mainfrom
p-malecki:@p-malecki/add-topbar-banner

Conversation

@p-malecki

Copy link
Copy Markdown
Contributor

Description

Adds a topbar banner to the landing page. Content is served server-side via external service, so banners can be swapped, rotated, or pulled without any repo change or redeploy.
It won’t be displayed on the docs or search pages. The banners are currently hidden across the site.

Copilot AI review requested due to automatic review settings June 16, 2026 09:40

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a rotating top-bar banner to the Gesture Handler docs site and reserves its height early to avoid layout shift.

Changes:

  • Wraps the Docusaurus Navbar with a conditional TopBarBanner that hides on configured routes.
  • Introduces a new TopBarBanner component with per-zone caching and rotation behavior.
  • Injects an inline <head> reservation script via docusaurus.config.js to pre-apply cached banner height/background.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/docs-gesture-handler/src/theme/Navbar/index.js Shows/hides the new top banner above the existing Navbar based on route.
packages/docs-gesture-handler/src/components/TopBarBanner/shared.ts Adds shared, SSR-safe helpers and the inline reservation <head> script generator.
packages/docs-gesture-handler/src/components/TopBarBanner/index.ts Re-exports banner config, shared helpers, and the client component.
packages/docs-gesture-handler/src/components/TopBarBanner/config.ts Defines banner zones, rotation interval, and hidden paths.
packages/docs-gesture-handler/src/components/TopBarBanner/TopBarBannerClient.tsx Implements the rotating/multi-zone banner, caching, and DOM measurement logic.
packages/docs-gesture-handler/docusaurus.config.js Injects the reservation script into headTags using the first zone’s IDs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/docs-gesture-handler/docusaurus.config.js Outdated
Comment thread packages/docs-gesture-handler/src/components/TopBarBanner/shared.ts Outdated
Comment thread packages/docs-gesture-handler/src/components/TopBarBanner/TopBarBannerClient.tsx Outdated
Comment thread packages/docs-gesture-handler/src/components/TopBarBanner/TopBarBannerClient.tsx Outdated
@p-malecki
p-malecki force-pushed the @p-malecki/add-topbar-banner branch from a6efad0 to 87a4c91 Compare June 16, 2026 14:16
@p-malecki
p-malecki force-pushed the @p-malecki/add-topbar-banner branch from 87a4c91 to d8e217f Compare June 17, 2026 11:14
Comment thread packages/docs-gesture-handler/docusaurus.config.js Outdated
Comment thread packages/docs-gesture-handler/src/components/topBarBannerConfig.ts
@m-bert
m-bert merged commit cd952bf into software-mansion:main Jun 17, 2026
3 checks passed
@m-bert m-bert added the Documentation Documentation change/enhancement label Jun 17, 2026
@m-bert m-bert changed the title docs: add dynamic topbar banner [Docs] Add dynamic topbar banner Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Documentation change/enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants