Conversation
🧪 Unit Test Results📊 Summary
Last updated: Wed, 01 Apr 2026 11:53:02 GMT |
There was a problem hiding this comment.
Review Summary
This PR swaps the IME (keyboard) inset handling in EdgeToEdgeScaffold from a contentWindowInsets-based approach to a Modifier.imePadding() approach. The intent is clear and the change is small, but it carries a meaningful behavioral difference worth documenting.
Issues
-
Unused import (
EdgeToEdgeScaffold.kt, line 19) —import androidx.compose.foundation.layout.WindowInsetsis no longer referenced after removing the.union(WindowInsets.ime)call. The IDE/lint will flag this as an unused import. -
Behavioral change:
imePadding()on theScaffoldmodifier affects the entire Scaffold, not just the content area (EdgeToEdgeScaffold.kt, line 54)The two approaches behave differently:
Old ( contentWindowInsets.union(WindowInsets.ime))New ( modifier.imePadding())Content bottom padding when keyboard open Grows by IME height Unchanged (Scaffold already shrunk) bottomBarposition when keyboard openFixed — can be hidden behind keyboard Floats above keyboard Top bar when keyboard open Unaffected Unaffected (correct) IME insets consumed? No (only declared in contentWindowInsets) Yes — inner imePadding()calls become no-opsIf the motivation is to keep a non-empty
bottomBarvisible above the keyboard, the new approach achieves that correctly. But callers that expectpaddingValues.calculateBottomPadding()(passed in thecontentlambda) to include IME height will need to be aware it no longer does — the Scaffold container itself has already shrunk.Also, since
imePadding()consumes the IME insets, any composable insidecontentthat also appliesimePadding()will silently receive zero insets. This is correct (prevents double-padding) but can be surprising. A code comment noting this intent would help future maintainers.
Positive Notes
- The change is minimal and easy to reason about.
- Removing the
union(WindowInsets.ime)fromcontentWindowInsetsis consistent with the new modifier-based approach — no double-handling of IME insets within the Scaffold's content slot. - Clean import cleanup (removing
imeandunion).
📊 Code Coverage Report✅ Student
✅ Teacher
✅ Pandautils
📈 Overall Average
|
No description provided.