Skip to content

fix: avoid duplicate day badge from animated header#2747

Merged
kesha-antonov merged 1 commit into
masterfrom
fix/dayanimated-duplicate-date
Jun 18, 2026
Merged

fix: avoid duplicate day badge from animated header#2747
kesha-antonov merged 1 commit into
masterfrom
fix/dayanimated-duplicate-date

Conversation

@kesha-antonov

Copy link
Copy Markdown
Collaborator

Follow-up to #2709

After #2709 aligned the animated day header's date with the visible group, an edge case surfaced: while scrolling, the floating header could show the same date as the inline day separator while that separator was still on screen, producing a stacked duplicate date badge (two "10 June" / two "17 June").

Fix

Gate the floating header's opacity on relativeScrolledPositionToBottomOfDay: show it only once the current day's inline separator has scrolled off the top (< 0). While the inline separator is visible (>= 0) it already shows the date, so the floating copy stays hidden - a clean handoff, mirroring the inline separator's own opacity flip.

Validation (Android simulator, multi-day chat)

  • Scrolling within a group: floating header shows the correct date (e.g. "10 June"), single badge ✅
  • At a day boundary ("17 June" separator at top): date shown once, no floating/inline stack ✅
  • At rest: header fades out, no duplicate ✅

tsc, eslint, build pass; CI (Node 22 & 24) gates this PR.

After aligning the animated header's date with the visible group, the
floating header could briefly show the same date as the inline day
separator while that separator was still on screen, producing a stacked
duplicate date badge during scroll.

Gate the floating header's opacity on relativeScrolledPositionToBottomOfDay:
only show it once the current day's inline separator has scrolled off the
top (< 0). While the inline separator is still visible (>= 0) it already
shows the date, so the floating copy stays hidden - a clean handoff with no
duplicate.
@kesha-antonov kesha-antonov merged commit ba485ba into master Jun 18, 2026
2 checks passed
@kesha-antonov kesha-antonov deleted the fix/dayanimated-duplicate-date branch June 18, 2026 12:46
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.

1 participant