Skip to content

Android: Fix chats menu not dismissing when NTP is shown#8963

Open
karlenDimla wants to merge 1 commit into
developfrom
fix/karl/contextual/new-menu-close
Open

Android: Fix chats menu not dismissing when NTP is shown#8963
karlenDimla wants to merge 1 commit into
developfrom
fix/karl/contextual/new-menu-close

Conversation

@karlenDimla

@karlenDimla karlenDimla commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1215828353176637?focus=true
Tech Design URL (if applicable):

Description

What: Dismiss the chats popup menu in onStop(), clearing the reference via its dismiss listener.

Why: The popup is a standalone window not tied to the sheet's lifecycle. When the NTP is shown, the popup is left open. The simplest solution is to hide the icon when the tab loses focus.

Steps to test this PR

  • Ensure that you set the inactivity timer to Always (for easy testing)
  • Ensure you have some recent chats (to guarantee the menu from showing)
  • Open an article on one tab
  • Select contextual sheet
  • Click on the chats icon
  • Verify chats popup menu is shown
  • Background the app / also try closing the screen
  • Come back to the app
  • Verify the NTP page is shown AND the chats menu is NOT shown.
  • Go back to the tab
  • Verify contextual sheet is open and chats menu still works

Note

Low Risk
Small UI lifecycle change in one fragment; no auth, data, or business-logic impact.

Overview
Fixes the contextual Duck AI chats menu staying on screen when the user navigates away (e.g. opening the NTP) while the popup is open.

DuckChatContextualFragment now keeps a reference to the active PopupMenu, clears it on dismiss, and calls dismiss() in onStop() so the overlay is torn down when the fragment is no longer visible.

Reviewed by Cursor Bugbot for commit 697e087. Bugbot is set up for automated code reviews on this repo. Configure here.

Track the chats popup shown from the chats icon and dismiss it in
onStop() so the popup window is closed before the contextual sheet
goes away and the NTP takes over.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

karlenDimla commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

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