Closed Bug 1845796 Opened 1 year ago Closed 1 year ago

Make entry and exit of screenshots explicit

Categories

(Firefox :: Screenshots, task, P2)

task

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: sfoster, Assigned: sfoster)

References

Details

Attachments

(1 file)

We have a couple of entry points and the initialization of Screenshots is reasonably clear. But exiting screenshots is not really the responsibility of any one method. We close the panel and sometimes that means we exit, but othertimes it means we're going to show the preview dialog. Same for the overlay.
For the keyboard accessibilty work, when we exit Screenshots I need to be able to attempt to restore focus to whatever was focused before we opened up the Screenshots UI. Tihs would be made much simpler by having an explicit exit method and more intentional sequence of tear down in place of the side-effects of various close/cancel methods.

Assignee: nobody → sfoster
Status: NEW → ASSIGNED
  • Add a UIPhases / getUIPhase to figure out where we are in the flow, and get the UI into the right state
  • Refactor to get rid of a bunch of implicit side-effects:
    • Separate out getting the panel from creating it
    • closePanel only closes the buttons panel
    • Add a closeOverlay so we do that and only that when needed
  • When the preview dialog closes, we expect to exit unless exitOnPreviewClose was set false
  • Keep some state for each browser using a weakmap so we can better handle re-entry (and later, re-focusing)
Attachment #9347300 - Attachment description: WIP: Bug 1845796 - Rework the flow in ScreenshotsUtils to make exit an explicit outcome rather than a side-effect → Bug 1845796 - Rework the flow in ScreenshotsUtils to make exit an explicit outcome rather than a side-effect. r?niklas!
Pushed by sfoster@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a598817e740 Rework the flow in ScreenshotsUtils to make exit an explicit outcome rather than a side-effect. r=niklas
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Regressions: 1860611
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: