-
Notifications
You must be signed in to change notification settings - Fork 12
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
Unify bookmarks context menu across different views #3138
Merged
Merged
Changes from 4 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
784dfbc
NSPopover-based Bookmarks menu system
mallexxx b6d82b0
fix button spacing constant usage
mallexxx 6f8452a
fix clipped items indicator
mallexxx 2558ca1
fixing Tests
mallexxx 4530a52
Merge remote-tracking branch 'origin/main' into alex/bookmarks-bar/menu
mallexxx 8217dc4
minor PR adjustment
mallexxx 98ec34e
Roll back BookmarkListViewController, add BookmarksBarMenuViewController
mallexxx a65352c
Unify bookmarks context menu across different views
mallexxx 03580e5
Add more tests, fix search items
mallexxx 7e0b916
fix test
mallexxx e032961
Merge branch 'alex/bookmarks-context-menu' into alex/bookmarks-bar/menu
mallexxx 152e514
cleanup
mallexxx a8c0520
Bookmarks bar/menu code adjustments (#3107)
mallexxx 686b2df
Add Open All in new tabs item; Close all bookmarks popovers on select…
mallexxx 376b969
Add Bookmarks menu drag&drop support (#3111)
mallexxx d54dd22
Bookmarks Menu keyboard controls (#3112)
mallexxx 48e2f66
Update Bookmarks Menu size (#3113)
mallexxx e162f1a
Merge remote-tracking branch 'origin/main' into alex/bookmarks-contex…
mallexxx b790e32
Merge branch 'alex/bookmarks-context-menu' into alex/bookmarks-bar/menu
mallexxx 791c3eb
fix missing disclosure indicators
mallexxx 4fd4c67
fix MainActor warnings
mallexxx cc228c1
Fix Manage button selector; add Manage Bookmarks "…" menu item, Add M…
mallexxx 02a99bc
fix tests
mallexxx bc2fec3
Merge remote-tracking branch 'origin/main' into alex/bookmarks-bar/menu
mallexxx e3a1c1c
Merge remote-tracking branch 'origin/main' into alex/bookmarks-contex…
mallexxx 27d9364
Merge branch 'alex/bookmarks-bar/menu' into alex/bookmarks-context-menu
mallexxx 85784d5
Remove Manage Bookmarks item from bookmark manager details context menu
mallexxx db4b4ab
Fix cells highlighting in different modes
mallexxx f06c808
Merge branch 'alex/bookmarks-bar/menu' into alex/bookmarks-context-menu
mallexxx 8840635
Fix PR issues
mallexxx 0089d26
fix tests
mallexxx 04f3ee6
fix test
mallexxx aa46e5f
disable assertion for empty context menu for non-bookmark object
mallexxx f304159
disable Open All menu items for folders without bookmarks
mallexxx 1730a6f
Fix bookmarks menu width calculation
mallexxx 2120bfe
rollback Submodules/privacy-reference-tests
mallexxx 36a070b
fix tests
mallexxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
442 changes: 442 additions & 0 deletions
442
DuckDuckGo/Bookmarks/Services/BookmarksContextMenu.swift
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// BookmarkListPopover.swift | ||
// | ||
// Copyright © 2024 DuckDuckGo. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import AppKit | ||
import Foundation | ||
|
||
final class BookmarkListPopover: NSPopover { | ||
|
||
override init() { | ||
super.init() | ||
|
||
self.animates = false | ||
self.behavior = .transient | ||
|
||
setupContentController() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("BookmarkListPopover: Bad initializer") | ||
} | ||
|
||
// swiftlint:disable:next force_cast | ||
var viewController: BookmarkListViewController { contentViewController as! BookmarkListViewController } | ||
|
||
private func setupContentController() { | ||
let controller = BookmarkListViewController() | ||
controller.delegate = self | ||
contentViewController = controller | ||
} | ||
|
||
} | ||
|
||
extension BookmarkListPopover: BookmarkListViewControllerDelegate { | ||
|
||
func popoverShouldClose(_ bookmarkListViewController: BookmarkListViewController) { | ||
close() | ||
} | ||
|
||
func popover(shouldPreventClosure: Bool) { | ||
behavior = shouldPreventClosure ? .applicationDefined : .transient | ||
} | ||
|
||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 This should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it shouldn‘t as it‘s without
.git
inPackage.swift