Skip to content

ADFA-3536: Fix flashbar dismissal dropped before enter animation starts#1317

Merged
Daniel-ADFA merged 3 commits into
stagefrom
ADFA-3536
May 19, 2026
Merged

ADFA-3536: Fix flashbar dismissal dropped before enter animation starts#1317
Daniel-ADFA merged 3 commits into
stagefrom
ADFA-3536

Conversation

@Daniel-ADFA
Copy link
Copy Markdown
Contributor

No description provided.

@Daniel-ADFA Daniel-ADFA requested a review from a team May 18, 2026 21:52
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a3f2a51a-5eb1-460b-a6b6-73a2d6c15b50

📥 Commits

Reviewing files that changed from the base of the PR and between 51b24bf and e9e8952.

📒 Files selected for processing (1)
  • subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarContainerView.kt

📝 Walkthrough

Release Notes - ADFA-3536: Fix flashbar dismissal dropped before enter animation starts

Changes

  • New file: FlashbarContainerView.kt - Complete Kotlin implementation of a container view for managing flashbar (notification/alert bar) UI components
    • Adds state tracking for show/dismiss lifecycle with new isShowInitiated flag to distinguish between "show initiated but not yet fully displayed" vs "already showing"
    • Implements early dismissal handling to prevent dismissal requests from being dropped when they occur before the enter animation completes
    • New cancelPendingShow() method cleanly cancels pending show operations by removing callbacks, unregistering listeners, detaching the view, and notifying the dismiss listener with a MANUAL dismissal event

Key Functionality

  • Manages flashbar visibility, animations, and dismissal with support for:
    • Customizable enter/exit animations
    • Tap-outside dismissal
    • Swipe-to-dismiss gestures
    • Device configuration change handling
    • Haptic feedback during show/dismiss
    • Optional overlay with configurable blocking behavior

Risks & Best Practice Considerations

  • State Management Complexity: The dismissal logic now involves multiple state flags (isBarShowing, isBarShown, isShowInitiated, earlyDismissalRequested, isBarDismissing). This multi-flag state machine increases cognitive load and could be error-prone if state transitions aren't carefully maintained.
  • Listener Callback Safety: Dismiss listeners are called in multiple places (cancelPendingShow(), dismissInternal() exit animation callback). Ensure listener implementations are idempotent and handle potential multiple invocations gracefully.
  • Resource Cleanup: Configuration callbacks and dismissal runnables are removed in multiple locations. While cleanup appears thorough, verify that no race conditions exist between view detachment and callback unregistration.
  • Animation Callback Dependencies: The show sequence depends on afterMeasured callback executing before animations start. Test edge cases where layout measurement is delayed or skipped.

Walkthrough

FlashbarContainerView introduces an isShowInitiated state flag to distinguish in-progress shows from completed shows. The flag gates early dismissal cancellation in the post-measure callback, allowing the show sequence to be aborted before animations start. A new cancelPendingShow() helper centralizes cleanup and dismiss notification when cancellation occurs during pending show.

Changes

Show/dismiss state management refinement

Layer / File(s) Summary
State flag and show lifecycle
subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarContainerView.kt
New isShowInitiated flag is declared to track "show initiated but not yet complete" state. The flag is set at the start of show(), checked in the post-measure callback to detect and cancel early dismissals via cancelPendingShow(), and reset to false when the enter animation completes.
Dismiss flow and cancellation helper
subprojects/flashbar/src/main/java/com/itsaky/androidide/flashbar/FlashbarContainerView.kt
dismissInternal is updated to use isShowInitiated to distinguish between dismissing a fully shown bar and canceling an in-progress show. New cancelPendingShow() helper centralizes cleanup: clears both the initiation and early-dismissal flags, removes pending dismissal callbacks, unregisters configuration listeners, detaches the view, and triggers a MANUAL dismiss notification.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A flashbar's dance, now finely tuned—
Before it shows, you may retreat,
With cancel-pending set in tune,
Early dismissals are complete.
State flags bloom, the flow runs clean! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to evaluate relevance to the changeset. Add a pull request description explaining the bug, the fix, and any relevant context for reviewers.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: fixing flashbar dismissal behavior when triggered before the enter animation starts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-3536

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Daniel-ADFA Daniel-ADFA merged commit a3e67cb into stage May 19, 2026
2 checks passed
@Daniel-ADFA Daniel-ADFA deleted the ADFA-3536 branch May 19, 2026 14:07
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