Skip to content

fix(allapps): bottom sheet drawer ghost on the home screen after close - #46

Draft
denson9874 wants to merge 1 commit into
codex/pixel-parityfrom
claude/project-thread-2g1094
Draft

denson9874 wants to merge 1 commit into
codex/pixel-parityfrom
claude/project-thread-2g1094

Conversation

@denson9874

Copy link
Copy Markdown
Owner

Description

Fixes the translucent drawer sheet that stays painted from about a third of the way down the home screen after opening and closing All Apps (seen on the Pixel 7 Pro on ExpressiveOS with launcher 5.0.8, "Bottom sheet drawer" on, Android 17 base, not QPR2, so frosted glass is not involved).

Two things combine:

  1. Turning on Bottom sheet drawer only recreated the activity. The device profiles were never rebuilt, so they kept the full-screen values (allAppsShiftRange 300 dp, allAppsPadding.top 0, bottomSheetDepth 0) while Flags.allAppsSheetForHandheld() answered true. The closed drawer therefore parks 300 dp down instead of off screen. The same stale-profile case happens when the process is started before unlock for TouchInteractionService, since the flag supplier is only installed on unlock.
  2. AllAppsTransitionController.setAlphas runs while the state is still ALL_APPS, so it keeps the drawer as the scrim's drawing controller through the close animation, and nothing clears it afterwards. drawOnScrimWithScaleAndBottomOffset then keeps painting the sheet at the closed offset until some later state change happens to call setAlphas again. With a full-screen shift range the sheet is off screen so this was invisible before.

Changes:

  • PreferenceManager2: the sheet preference calls reloadHelper.restart() (grid rebuild + recreate) instead of recreate().
  • LawnchairApp.onUserUnlocked: when the sheet is on, rebuild the profiles once the flag supplier is installed.
  • AllAppsTransitionController: after a transition out of ALL_APPS completes, drop the scrim's drawing controller.

Evidence from the phone: dumpsys activity top showed bottom_sheet_background VISIBLE (sheet mode) next to allAppsShiftRange: 1050.0px (300.0dp) and allAppsPadding.top: 0 (full-screen profile), state Normal, apps_view GONE, scrim still drawing. 1050 px is exactly where the ghost starts on the 3120 px screen.

Reasoning

The drawer sheet is drawn on the scrim, not on the apps view, so the apps view going GONE does not hide it. Keeping the scrim's drawing controller after the close is harmless only while the closed translation pushes the sheet off screen; the stale device profile broke that assumption. Both halves are fixed so neither can bring the ghost back on its own.

Testing

Not run on a phone yet (no local Gradle here; CI compiles). Steps for the 7 Pro:

  1. Launcher settings > App drawer > Bottom sheet drawer: toggle it off and on. The drawer should relayout (content under the handle) without the activity-only recreate.
  2. Open All Apps, close it, repeat three times, then press Home. No sheet should remain on the home screen. adb shell dumpsys activity top | grep -E "allAppsShiftRange|allAppsPadding.top" should show the sheet profile values (shift range near screen height, top padding non-zero) while the toggle is on.
  3. Reboot with the toggle on; repeat step 2 (covers the pre-unlock profile build).
  4. Toggle off: the drawer is full screen again and the dump shows 300 dp shift range.

Type of change

✅ Bug fix (A non-breaking change that fixes an issue)
❌ New feature (A non-breaking change that adds functionality)
❌ Breaking change (A fix or feature that would cause existing functionality to not work as expected)
❌ Refactor (A code change that neither fixes a bug nor adds a feature)
❌ Performance (A code change that improves performance)
❌ Style (Code style changes)
❌ Docs (Changes to documentation)
❌ Chore (Changes to the build process or other tooling)


Generated by Claude Code

…op the closed sheet painting on the scrim

Turning "Bottom sheet drawer" on only recreated the activity. The device profiles
kept the full-screen values (allAppsShiftRange 300 dp, allAppsPadding.top 0,
bottomSheetDepth 0) while Flags.allAppsSheetForHandheld() answered true, so the
closed drawer parked 300 dp down instead of off screen. Because setAlphas runs
while the state is still ALL_APPS, the scrim kept the drawer as its drawing
controller after an animated close, and drawOnScrim painted the translucent
sheet from a third of the way down the home screen until the next state change.

- PreferenceManager2: the sheet preference now rebuilds the grid (restart) instead
  of only recreating the activity.
- LawnchairApp: when the process started before unlock (TouchInteractionService)
  and the sheet is on, rebuild the profiles once the flag supplier is installed.
- AllAppsTransitionController: once a transition out of ALL_APPS completes, drop
  the scrim's drawing controller so nothing from the drawer is painted on home.

Reported on the Pixel 7 Pro (ExpressiveOS, launcher 5.0.8): drawer sheet ghost on
the home screen after open/close.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Csz3tZW7iXZyCGuRafe8WU

Copy link
Copy Markdown
Owner Author

CI: check-style is red here, but not because of this PR. spotlessKotlinCheck fails on the same 64 files (5 listed + "59 other files") as on the base branch's last PR (#45, run 41269970272, job 124740548400): ExpressiveCore.kt, FeedBridge.kt, AllAppsSearchInput.kt, SearchItemBackground.kt, AllAppsCategoryTabs.kt, ... none of which this PR touches, and the count did not grow. That spotless debt predates this branch (same on #43 and #44) and needs its own spotlessApply pass; not widening this PR for it.


Generated by Claude Code

This branch has not been deployed

No deployments
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