feat(ADFA-2839): Persist errors until dismissed#986
feat(ADFA-2839): Persist errors until dismissed#986dara-abijo-adfa wants to merge 1 commit intostagefrom
Conversation
📝 WalkthroughRelease Notes - Persist Errors Until DismissedFeature:
Changes:
WalkthroughThis pull request refactors the flashbar error-handling API by consolidating the separate Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
common/src/main/java/com/itsaky/androidide/utils/FlashbarActivityUtils.kt (1)
135-137:⚠️ Potential issue | 🔴 Critical
flashError(@stringres)must useDURATION_INDEFINITEto match theString?overload.Line 127's
flashError(String?)passesduration = DURATION_INDEFINITE, but line 135-137'sflashError(@stringresInt)omits the duration parameter, defaulting toDURATION_SHORT(line 61). This causes error messages from string resources to auto-dismiss after 2 seconds without a dismiss button, while string-based errors persist indefinitely with a dismiss button. The inconsistency violates the expected behavior that all error flashbars should remain on-screen until explicitly dismissed.Fix
fun Activity.flashError( `@StringRes` msg: Int, -) = showFlashBar(msg, IconType.ERROR) +) = showFlashBar(msg, IconType.ERROR, duration = DURATION_INDEFINITE)
This allows users read long error messages without the message getting dismissed prematurely.