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

Zoom menu items; Menu Items validation #105

Merged
merged 2 commits into from
May 11, 2021
Merged

Conversation

mallexxx
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/1177771139624306/1194460468534279
https://app.asana.com/0/1199178362774117/1200073569419036
Tech Design URL:
CC: @tomasstrba @brindy @samsymons

Description:
This PR adds Zoom In/Out/Actual size menu items to the Main menu and ... Menu;
Also this PR fixes Back/Forward and others menu items validation

Steps to test this PR:

  1. Validate the Zoom menu items are disabled for the New Page
  2. Validate Zoom In/Out/Actual state menu items and hotkeys are working, keep zooming in margins (50-300%) as well as pinch-to-zoom trackpad gesture
  3. Validate Back/Forward/Reopen last closed page menu items are correctly enabled and match buttons state (or disabled when window is closed)

Internal references:

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

@@ -58,7 +58,6 @@ final class MainViewController: NSViewController {

listenToKeyDownEvents()
subscribeToSelectedTabViewModel()
subscribeToCanInsertLastRemovedTab()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All validation moved to MainMenuActions.swift

@@ -121,7 +121,7 @@ extension MainViewController {
selectedTabViewModel.tab.reload()
}

@IBAction func stopLoading(_ sender: Any) {
@IBAction func stopLoadingPage(_ sender: Any) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for some reason "stopLoading:" didn't work for Menu Item validation

}

private func subscribeToCanGoBackForward() {
canGoBackCancellable?.cancel()
canGoBackCancellable = tabCollectionViewModel.selectedTabViewModel?.$canGoBack.receive(on: DispatchQueue.main).sink { [weak self] _ in
tabCollectionViewModel.selectedTabViewModel?.$canGoBack.receive(on: DispatchQueue.main).sink { [weak self] _ in
self?.updateBackMenuItem()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only left validation for states that can change while Main Menu is open; Other validation moved to MainMenuActions

Copy link
Contributor

@tomasstrba tomasstrba left a comment

Choose a reason for hiding this comment

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

LGTM! 👍 Good job!

@mallexxx mallexxx merged commit 58d3ec4 into develop May 11, 2021
@mallexxx mallexxx deleted the feature/alex/page-zoom branch May 11, 2021 04:30
samsymons added a commit that referenced this pull request May 13, 2021
* develop:
  Version 0.6.16
  Force the content blocking rules publisher onto the main thread. (#112)
  Update to BrowserServicesKit 1.1.1 (#111)
  Zoom menu items; Menu Items validation (#105)
  check file headers programatically (#110)
  Fixed up filenames in file headers (#109)
samsymons added a commit that referenced this pull request May 13, 2021
* Consolidate Core Data testing utilities.

* Add the updated data model, along with migration and tests.

* Add BookmarkManagedObject validation & tests.

* Update the bookmark store and manager.

* Add the Node and TreeController code.

* Properly copy over the Bookmark data model changes.

* Rename Folder to BookmarkFolder for clarity.

* Update BookmarkManagedObject validation function names.

* Fix the Bookmark data model path.

* Rename Node to BookmarkNode.

* Fixed up filenames in file headers (#109)

* check file headers programatically (#110)

* Zoom menu items; Menu Items validation (#105)

* Zoom menu items; Menu Items validation in MainMenuActions

* Update navigational menu items on WebView state change

* Update to BrowserServicesKit 1.1.1 (#111)

* Use a specific version of BrowserServicesKit.

* Use BrowserServicesKit 1.1.1.

* Force the content blocking rules publisher onto the main thread. (#112)

* Version 0.6.16

* Address SwiftLint warnings.

* Add the bookmark checks back.

* Fix some incorrect file headers comments.

* Fix remaining SwiftLint warnings.

Co-authored-by: Rendijs Smukulis <rendijs.smukulis@gmail.com>
Co-authored-by: Christopher Brind <brindy@duckduckgo.com>
Co-authored-by: Alexey Martemyanov <mallexxx@gmail.com>
Co-authored-by: Tomas Strba <tom@duckduckgo.com>
samsymons added a commit that referenced this pull request May 26, 2021
# By Tomas Strba (4) and others
# Via GitHub
* develop:
  Update the Chrome user agent (#122)
  TabViewModel released immediately from TabCollectionViewModel after its tab is closed (#118)
  User agent updated (#117)
  History Storage - Please do not merge (#108)
  use the temporary unprotected sites list and update the frequency to 30 minutes (#114)
  update email autofill (#113)
  Version 0.6.16
  Force the content blocking rules publisher onto the main thread. (#112)
  Update to BrowserServicesKit 1.1.1 (#111)
  Zoom menu items; Menu Items validation (#105)
  check file headers programatically (#110)
  Fixed up filenames in file headers (#109)

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/Bookmarks/Services/Bookmark.xcdatamodeld/Bookmark.xcdatamodel/contents
#	Unit Tests/Bookmarks/Services/LocalBookmarkStoreTests.swift
#	Unit Tests/FileSystem/CoreDataEncryptionTests.swift
samsymons added a commit that referenced this pull request Jun 21, 2021
* Bookmarks management part 1 (#107)

* Consolidate Core Data testing utilities.

* Add the updated data model, along with migration and tests.

* Add BookmarkManagedObject validation & tests.

* Update the bookmark store and manager.

* Add the Node and TreeController code.

* Properly copy over the Bookmark data model changes.

* Rename Folder to BookmarkFolder for clarity.

* Update BookmarkManagedObject validation function names.

* Fix the Bookmark data model path.

* Rename Node to BookmarkNode.

* Fixed up filenames in file headers (#109)

* check file headers programatically (#110)

* Zoom menu items; Menu Items validation (#105)

* Zoom menu items; Menu Items validation in MainMenuActions

* Update navigational menu items on WebView state change

* Update to BrowserServicesKit 1.1.1 (#111)

* Use a specific version of BrowserServicesKit.

* Use BrowserServicesKit 1.1.1.

* Force the content blocking rules publisher onto the main thread. (#112)

* Version 0.6.16

* Address SwiftLint warnings.

* Add the bookmark checks back.

* Fix some incorrect file headers comments.

* Fix remaining SwiftLint warnings.

Co-authored-by: Rendijs Smukulis <rendijs.smukulis@gmail.com>
Co-authored-by: Christopher Brind <brindy@duckduckgo.com>
Co-authored-by: Alexey Martemyanov <mallexxx@gmail.com>
Co-authored-by: Tomas Strba <tom@duckduckgo.com>

* Bookmarks management part 2 (#115)

* Add NSOutlineView extensions.

* Add PasteboardFolder and PasteboardBookmark.

* Update the NSOutlineView extension.

* Add the bookmark sidebar tree controller.

* Add the BookmarksOutlineView subclass.

* Rename a test file.

* Add the bookmarks outline view data source and views.

* Clean up a few comments.

* Fix another misnamed header.

* Fix failed tests.

* Fix PR comments.

* Repair merge conflicts in the test suite.

* Fix a warning related to header comment naming.

* Bring over bookmark UI code.

* Remove extra print statements.

* Fix dark mode colors when editing bookmarks.

* Fix some logic around cell states.

* Sort displayable tab cases alphabetically.

* Verify that the tab switcher button has the right item selected.

* Remove a redundant tracking area.

* Commit bookmark edits.

* Rename a file header comment.

* Move bookmarks colors into the color extension.

* Push tab chooser logic into the view controllers.

* Store the UUID when setting the editing state.

* Fix test suite merge conflicts.

* Bring over menu changes to show folders in menus.

* Remove an assertion that doesn’t need to be there.

This is a legitimate case being checked, it doesn’t need to be asserted.

* Replace the bookmarks menu item with a single item.

* Remove a submodule that was accidentally checked in.

* Consolidate some tab logic.

* Fix a SwiftLint warning.

* Remove an unnecessary computed var.

* Remove another unnecessary computed var.

* Move bookmark representing colors to the NSColor extension.

* Fix a SwiftLint violation.

* Fix dragging folders to the Favorites pseudofolder.

* Remove a force unwrap.

* Move all data to the bookmark list.

* Update the mock bookmark store.

* Set the editing metadata when clicking away or selecting a new folder.

* Show clicked tabs in the current tab by default.

* Fix a bug causing child bookmarks to not appear in the list.

* Enforce a valid URL when adding or editing.

* Render a different color when using drag & drop.

* Fix a number of data source bugs.

* Update drag and drop validation in the detail view controller.

* Restore selection to the list view controller.

* Change the order in which bookmark updates are done.

* Fix an unused return value warning.

* Turn validation back on for the bookmark items.

* Show the bookmark list in a window.

* Prevent the protocol from being removed during editing.

* Render all favorites in the bookmarks menu.

* Factor in child windows when testing for the main VC.

* Hide empty folders.

* Update the title when switching tab type.

* Set the table cell editing color on the cell itself.

* Handle the navigateToBookmark selector.

* Go back to a popover for the bookmark list.

* Fix resizing issues.

* Add a safeguard to prevent invalid drops on the table view.

* Add a hack to work around a label layout issue.

* fix swift lint error

* Show empty folders in the bookmarks menu.

* Use the correct background color for the bookmarks screen.

* Tweak the bookmarks layout.

* Fix the bookmark sidebar color.

* Fix the layout of the list view.

* Fix the alignment of the detail accessory view.

* Animate the editing color on the ColorView.

* Use the correct method for resigning the first responder.

TIL you shouldn’t call `resignFirstResponder` directly in AppKit. I miss UIKit. 😭

* Rename a couple classes.

* Add a button to the Bookmarks menu to show the manage bookmarks UI.

* Remember the expanded state of pseudofolders.

* Fix test suite compilation failures from an earlier refactor.

* Remove an unused variable.

* Show the bookmark list popover from the options menu.

* Hide the bookmark edit option in the list view.

* Use the correct app appearance when setting the detail view color.

* Track when bookmarks are clicked from the new UI.

* Update a bookmark pixel.

* Fire a pixel when showing the bookmarks list.

Co-authored-by: Rendijs Smukulis <rendijs.smukulis@gmail.com>
Co-authored-by: Christopher Brind <brindy@duckduckgo.com>
Co-authored-by: Alexey Martemyanov <mallexxx@gmail.com>
Co-authored-by: Tomas Strba <tom@duckduckgo.com>
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