Skip to content

Conversation

Aniket-pd
Copy link
Contributor

@Aniket-pd Aniket-pd commented Oct 10, 2025

📜 Tickets

Jira ticket
Github issue


💡 Description

Documented how the bulk close-all path updates the in-memory tab list immediately, defers web-view teardown, and recalculates selection only once to keep the UI responsive while still issuing delegate notifications.

Summary

  • Snapshot all tabs in the selected mode and remove them in one pass.
  • Defer heavy teardown work (downloads, web views, delegate calls) to the next run loop so the UI stays responsive.
  • Recalculate selection only once,pick the most recent surviving tab or create a new one if needed.
  • Preserve prior selection when possible to avoid sluggishness from repeated recalculations.
  • Snapshot delegates before async teardown to ensure all receive removal and close-all notifications.
  • Eliminate redundant synchronous callbacks for cleaner and faster behavior.

Screenshot 2025-10-10 at 6 41 39 PM Screenshot 2025-10-10 at 6 39 54 PM

📝 Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If adding telemetry, I read the data stewardship requirements and will request a data review
  • If adding or modifying strings, I read the guidelines and will request a string review from l10n
  • If needed, I updated documentation and added comments to complex code

Refactored the tab removal process to handle selection and fallback more robustly when closing all tabs in a mode. Ensures correct tab selection after removal, cancels downloads, closes tabs, and notifies delegates appropriately.
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.

1 participant