Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix add bookmark / folder modal in fullscreen #930

Merged
merged 6 commits into from
Jan 26, 2023

Conversation

graeme
Copy link
Collaborator

@graeme graeme commented Jan 13, 2023

Task/Issue URL: https://app.asana.com/0/1177771139624306/1202138144256919/f
Tech Design URL:
CC:

Description:

Note: This is no longer a problem on Ventura. But this fixes the issue on earlier OS versions

When adding a bookmark via the three dots menu on the top right, while having the browser in full screen, the popup window for adding that bookmark goes fullscreen as well. After finishing, the full screen window stays, but black.

This happens for every modally presented ViewController, not just from the three dot menu.

In most cases, this was fixable by just presenting as a sheet, but for the Add Bookmark / Folder modal from the Bookmarks popover, it a.) needed to be presented from the main window (not the popover's) and b.) needs a slightly hacky solution to prevent the popover from being closed (as AppKit doesn't really like it when you present modals from popovers nor present a modal when there's a popover being displayed).

Steps to test this PR:

  1. Open the DuckDuckGo browser in full screen
  2. Go to a page that can be bookmarked
  3. Click the three dots on the top right
  4. Click bookmarks
  5. Click the add bookmark ribbon in that menu
  6. The issue should now have occured

Testing checklist:

  • Test with Release configuration
  • Test proper deallocation of tabs
  • Make sure committed submodule changes are desired
  • Make sure configuration is changed only in xcconfig files, not in the Xcode project file directly

Internal references:

Software Engineering Expectations
Technical Design Template
When ready for review, remember to post the PR in MM

@samsymons samsymons self-assigned this Jan 13, 2023
Copy link
Collaborator

@samsymons samsymons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so much better in full screen – nice work @graeme!

One bug before this can be merged: the Add Folder view controller doesn't get its addFolderViewControllerWillClose function called, so the popover state never gets reset to transient and thus never closes on its own. Once that's sorted, this is good to go!

You can reproduce this by:

  1. Open the bookmarks popover (not even in full screen)
  2. Click the Add Folder button
  3. Click "Cancel"
  4. Try to click outside the popover to close it, and notice it won't close

@samsymons samsymons assigned graeme and unassigned samsymons Jan 16, 2023
@graeme graeme requested a review from samsymons January 24, 2023 11:28
@graeme graeme assigned samsymons and unassigned graeme Jan 24, 2023
Copy link
Collaborator

@samsymons samsymons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@samsymons samsymons assigned graeme and unassigned samsymons Jan 26, 2023
@graeme graeme merged commit bcf9ca5 into develop Jan 26, 2023
@graeme graeme deleted the graeme/fix-add-bookmark-modal-in-fullscreen branch January 26, 2023 10:04
samsymons added a commit that referenced this pull request Jan 26, 2023
# By Dominik Kapusta (4) and others
# Via GitHub
* develop:
  Blockable JS Alerts inside tabs (#904)
  Fix add bookmark / folder modal in fullscreen (#930)
  Add Mac App Store target (#927)
  Pull request review checklist added to the pull request template (#935)
  Version Bump to 0.31.7
  Update embedded files
  Update BSK with autofill 6.1.2 (#942)
  Migrate to targeted Swift Concurrency checking (#937)
  Add bundler configuration to limit Gemfile.lock noise (#939)
  update openssl depedency (#918)
  Remove tab content when showing TabContent.none (such as for new tabs opened from navigation links) (#938)
  Update GRDB to 2.0.0 (upstream 6.6.0, SQLCipher 4.5.3) (#933)
  Sparkle 2 (#934)
  Bump Submodules/privacy-reference-tests from `de75d51` to `4fdbbb6` (#932)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
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