Skip to content

fix(promo-banner): restore scroll-hide animation + keep banner visible under open menu#505

Merged
vvlladd28 merged 2 commits into
thingsboard:developfrom
rusikv:fix/banner-hide
Jun 24, 2026
Merged

fix(promo-banner): restore scroll-hide animation + keep banner visible under open menu#505
vvlladd28 merged 2 commits into
thingsboard:developfrom
rusikv:fix/banner-hide

Conversation

@rusikv

@rusikv rusikv commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Two banner fixes on docs/marketing pages.

1. Restore docs scroll-hide animation lost in a merge

The docs promo banner stopped hiding on scroll. The pure-CSS scroll-driven hide — --promo-cur collapsing via @keyframes promo-collapse / promo-vanish under @supports (animation-timeline: scroll()) — was silently dropped from _starlight-overrides.scss during the PR #465 merge (7e75f818e). Both parents of that merge contained the block; the conflict resolution deleted it and even added a comment claiming "the animation lives in PromoBanner.astro" to rationalize the gap (it doesn't).

The same merge also trimmed the --promo-anim:none banner-less-page fallback from PromoBanner.astro, leaving the degenerate 0 0px animation-range / stale band the surrounding comment warns about.

Fix — pure restore, byte-identical to the last good commit (58897deb4); no new logic:

  • _starlight-overrides.scss — restore the promo-collapse/promo-vanish keyframes + @supports (animation-timeline: scroll()) block; drop the now-false comment.
  • PromoBanner.astro — restore --promo-anim:none in the no-banner inline-style fallback.

Why this must land on develop first

main still has this animation (it never went through the bad merge). Because the develop↔main merge-base has the animation, merging develop → main without this fix would silently delete the working animation from main (verified via git merge-tree: count 2 → 0, clean no-conflict merge — no warning). Landing this on develop first keeps develop and main consistent.

2. Keep the banner visible under the open burger menu

On smaller screens, opening the burger menu at the top of the page hid the banner but left an empty ~40px band above the menu (and a jump).

The shared-header refactor (#465) moved #promo-banner inside Starlight's header.header wrapper on marketing too (it used to be a sibling), so the header.header.opened-burger #promo-banner { display: none } rule — added in #449 for the old docs-only layout — now fired on marketing as well. The banner was hidden, but the drawer stayed at its --promo-cur offset → empty band.

Fix — drop the display: none rule. The drawer already anchors at top: --promo-cur, below the banner, so the banner stays visible above the open menu (no jump, no band). When scrolled on docs the banner has already collapsed off-screen via --promo-cur, so the drawer reaches top:0 with nothing over it. The #449 "covers the close button" concern is obsolete — the drawer and its X now sit below the banner.

Unsupported browsers (Firefox/Safari) gracefully keep the banner pinned, as before.

rusikv added 2 commits June 24, 2026 11:19
The pure-CSS scroll-driven hide (--promo-cur collapse via
@Keyframes promo-collapse / promo-vanish under
@supports (animation-timeline: scroll())) was silently dropped from
_starlight-overrides.scss during the PR thingsboard#465 merge (7e75f81), so the
docs banner no longer collapsed on scroll. The merge also trimmed the
--promo-anim:none banner-less-page fallback from PromoBanner.astro,
leaving the degenerate 0 0px range / stale band the comment warns about.

Restore both verbatim from the last good commit (58897de) and drop the
now-false comment claiming the animation lives in PromoBanner.astro.

main still has this animation (it never went through the bad merge), so
landing this on develop first keeps develop->main from silently deleting
it on main.
The shared-header refactor (thingsboard#465) moved #promo-banner inside Starlight's
header.header wrapper on marketing too (it used to be a sibling), so the
`header.header.opened-burger #promo-banner { display: none }` rule — added
in thingsboard#449 for the old docs-only layout — now fired on marketing as well.
Opening the burger at the top of the page hid the banner but left the
drawer at its --promo-cur offset, leaving an empty ~40px band above the
menu (and a jump).

Drop the display:none rule. The drawer already anchors at top:--promo-cur,
below the banner, so the banner just stays visible above the open menu (no
jump, no band). When scrolled on docs the banner has already collapsed
off-screen via --promo-cur, so the drawer reaches top:0 with nothing over
it. The thingsboard#449 "covers the close button" concern is obsolete: the drawer and
its X now sit below the banner, not under it.
@rusikv rusikv changed the title fix(promo-banner): restore docs scroll-hide animation lost in merge fix(promo-banner): restore scroll-hide animation + keep banner visible under open menu Jun 24, 2026
@rusikv rusikv requested a review from vvlladd28 June 24, 2026 09:05

@vvlladd28 vvlladd28 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Reviewed 3 changed files in fix(promo-banner): restore scroll-hide animation + keep banner visible under open menu. No issues found.

This is a clean, faithful restore. The reinstated @keyframes promo-collapse/promo-vanish + @supports (animation-timeline: scroll()) block in _starlight-overrides.scss is byte-identical to the last-good commit (58897deb4). The --promo-anim:none fallback correctly neutralizes the degenerate animation-range: 0 0px on banner-less pages, and the --promo-cur/--promo-h/--promo-anim custom-property contract is used consistently across all three files. Removing the header.header.opened-burger #promo-banner { display: none } rule leaves no dangling references — the drawer anchors at top: --promo-cur (z-index 10000) below the banner (z-index 8889), so the banner stays visible above the open menu with no overlap or empty band.


This review was auto-generated. Findings may contain errors — please verify before applying changes.

@vvlladd28 vvlladd28 merged commit 5339e90 into thingsboard:develop Jun 24, 2026
5 checks passed
Sign up for free to 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.

2 participants