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

[feature/better-sidebar] Improved sidebar with account-wide search #1320

Merged
merged 11 commits into from
Apr 11, 2024

Conversation

felix-schwarz
Copy link
Contributor

@felix-schwarz felix-schwarz commented Jan 29, 2024

Description

This PR:

  • removes Quick Access from the sidebar, redistributing its prior contents as follows:
    • Recents: promoted to a top-level sidebar item
    • Favorites: promoted to a top-level sidebar item
    • Available Offline: promoted to a top-level sidebar item
    • other Quick Access items: moved as suggestions to new top-level sidebar Search item, with a dedicated Add to sidebar button that allows re-adding the previous Quick Access items as saved search
    • Saved searches now appear as top-level items in the sidebar
  • adds custom user sidebar items
    • can be added via Add to sidebar
    • support drag and drop (also cross-account)
    • managed via context menu and swipe actions
  • in the share extension automatically connects to the first account if only one account is in the account (superseding [feature/share-extension-account-items] Expanded Single Account / Additional Items #1296)
  • incorporates the latest SDK with important fixes

Related Issue

Screenshots (if appropriate):

Improved sidebar Add to Sidebar items Share Sheet auto-connect
Simulator Screenshot - iPad Air (5th generation) - 2024-02-28 at 22 00 47 Simulator Screenshot - iPad Air (5th generation) - 2024-02-29 at 11 27 56 Simulator Screenshot - iPhone 15 - 2024-02-28 at 22 26 26

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

- AccountControllerSearchViewController: new view controller for global search that's accessible from a new top-level sidebar item
- AppDelegate, CreateDocumentAction, OpenInWebAction: register settings for OpenInWeb and CreateDocument so they turn up in the auto-generated MDM docs
- OCSavedSearch: add support for copying
- AccountController.Configuration: remove showQuickAccess and add new variables for new top-level items
- SavedSearchCell: add support for new side button that allows setting an action (used for "Add to sidebar")
- OCSavedSearch+Interactions: add support for new "Quick Access" search suggestions in AccountControllerSearchViewController
- SearchViewController: allow customizing whether cancel buttons are shown or navigation buttons should be hidden
- ClientItemViewController: refactor search suggestions list to allow expansion/modification by subclasses
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@felix-schwarz felix-schwarz added this to the 12.2-Next milestone Jan 29, 2024
@hosy
Copy link
Collaborator

hosy commented Feb 6, 2024

Great new feature!

Some ideas how to improve it:

  • Remove item from Quick Access section, if already added to sidebar
  • add a Delete item context menu to a search side bar item

Not sure if the Search sidebar section should be expanded, if it has sub items. Maybe it could be sense to save the expanded state of all sidebar items.

What do you think @felix-schwarz ?

@hosy
Copy link
Collaborator

hosy commented Feb 6, 2024

Another idea:

If a new search is active in the file list, it could make sense to add the Save search action to the toolbar, because it is easier to discover for the user.

Simulator Screenshot - iPhone 15 Pro Max - 2024-02-06 at 15 16 08

- OCSavedSearch: add uuid and name to .dataItemVersion
- OCVault+SavedSearches: add method updateSavedSearch for updating existing saved searches (f.ex. with a different name)
- AccountController:
	- rename searchesFolder to globalSearch to signal the new position in the sidebar
	- present saved searches directly in the top level of the sidebar
	- add useFolderForSearches var to allow switching between a flat or folder-based presentation of saved searches in the sidebar	- cleanup code
- AccountControllerSearchViewController: remove added quick access searches from quick access list, remove entire Quick Access section if all quick access searches were added
- SavedSearchCell: use gear-badged folder instead of gear icon for saved searches in the sidebar
- CollectionViewController: preserve selection after non-animated snapshot updates
- OCSavedSearch+Interactions: add "Rename" action to saved search context menu
- ClientItemViewController: fix warning
- ShareExtensionViewController: auto-open first account if only one account has been created
- OCSidebarItem: new class encapsulating custom user sidebar items, conforming to OCDataItem and OCDataItemVersioning
- OCVault+SidebarItems: add user side bar item management
- AccountController:
	- add saved searches and user sidebar items to configuration
	- add user sidebar items integration
- BrowserNavigationBookmark+AccountController: add support for sidebar items, refine representationSideBarItemRefs to return more (fallback) references
- Action: fix comment an identifier typos
- CollectionViewController:
	- add new method for retrieving the most specific client context for an index path
	- use new method to provide correct client context for allowDropOperation and performDropOperation
- OCLocation+Interactions: add new method for customized access to .openItem()
- OCSidebarItem+Cell: adds a cell provider for custom user sidebar items
- OCSidebarItem+Interactions: selection, swipe, context menu, drop and navigation restore support for OCSidebarItems
- BrowserNavigationBookmark: add sidebarItem property, including archiving/unarchiving
…a per-section item for section fallback drop interaction handling
@jesmrec
Copy link
Contributor

jesmrec commented Apr 5, 2024

QA checks:

  • Quick access removed
  • Options in sidebar: search, recents, av. offline
    • Search
      • PDF
        • Add to sidebar
        • Remove from sidebar
      • Documents
        • Add to sidebar
        • Remove from sidebar
      • Images
        • Add to sidebar
        • Remove from sidebar
      • Videos
        • Add to sidebar
        • Remove from sidebar
      • Audios
        • Add to sidebar
        • Remove from sidebar
    • Recents
    • Av. offline
  • Favorites in sidebar only in oC10
  • Folders in list with option Add to sidebar
    • Add to sidebar some folders
    • Remove to sidebar some folders
  • Files in list without option Add to sidebar

@jesmrec
Copy link
Contributor

jesmrec commented Apr 5, 2024

(1) [FIXED]

The Add to sidebar option allows to add the same item as many times as the user clicks on the option, having something like:

Screenshot 2024-04-05 at 12 39 02

this is functionally correct and causes no side-effects. However, does it make more sense to allow adding every item only once? so, the option Add to sidebar mutates to Remove from sidebar when it's already there.

What do you think?

iPhone XR iOS 17.4.1
04e4d0bc1

	- only show action if item hasn't already been added to the sidebar
	- add custom icon with plus badge
- RemoveFromSidebarAction:
	- new action
	- only show action if item has already been added to the sidebar
	- add custom icon with minus badge
@felix-schwarz
Copy link
Contributor Author

@jesmrec Very good point. I have added a new "Remove from sidebar" action and made sure the app now shows the "Add to sidebar" and "Remove from sidebar" action as appropriate.

@jesmrec
Copy link
Contributor

jesmrec commented Apr 9, 2024

@jesmrec Very good point. I have added a new "Remove from sidebar" action and made sure the app now shows the "Add to sidebar" and "Remove from sidebar" action as appropriate.

done and fixed

@jesmrec
Copy link
Contributor

jesmrec commented Apr 9, 2024

Approved... ready to go.

@jesmrec jesmrec added the Approved by QA Approved by QA label Apr 9, 2024
@felix-schwarz felix-schwarz merged commit f387e8b into milestone/12.2 Apr 11, 2024
3 of 4 checks passed
@delete-merged-branch delete-merged-branch bot deleted the feature/better-sidebar branch April 11, 2024 10:07
hosy pushed a commit that referenced this pull request May 8, 2024
…1320)

* - update SDK to include OCItem.removed tracking fixes
- AccountControllerSearchViewController: new view controller for global search that's accessible from a new top-level sidebar item
- AppDelegate, CreateDocumentAction, OpenInWebAction: register settings for OpenInWeb and CreateDocument so they turn up in the auto-generated MDM docs
- OCSavedSearch: add support for copying
- AccountController.Configuration: remove showQuickAccess and add new variables for new top-level items
- SavedSearchCell: add support for new side button that allows setting an action (used for "Add to sidebar")
- OCSavedSearch+Interactions: add support for new "Quick Access" search suggestions in AccountControllerSearchViewController
- SearchViewController: allow customizing whether cancel buttons are shown or navigation buttons should be hidden
- ClientItemViewController: refactor search suggestions list to allow expansion/modification by subclasses

* - update SDK to include version tracking change for KVO data source
- OCSavedSearch: add uuid and name to .dataItemVersion
- OCVault+SavedSearches: add method updateSavedSearch for updating existing saved searches (f.ex. with a different name)
- AccountController:
	- rename searchesFolder to globalSearch to signal the new position in the sidebar
	- present saved searches directly in the top level of the sidebar
	- add useFolderForSearches var to allow switching between a flat or folder-based presentation of saved searches in the sidebar	- cleanup code
- AccountControllerSearchViewController: remove added quick access searches from quick access list, remove entire Quick Access section if all quick access searches were added
- SavedSearchCell: use gear-badged folder instead of gear icon for saved searches in the sidebar
- CollectionViewController: preserve selection after non-animated snapshot updates
- OCSavedSearch+Interactions: add "Rename" action to saved search context menu
- ClientItemViewController: fix warning

* - update SDK to fix table creation issue

* - update SDK
- ShareExtensionViewController: auto-open first account if only one account has been created
- OCSidebarItem: new class encapsulating custom user sidebar items, conforming to OCDataItem and OCDataItemVersioning
- OCVault+SidebarItems: add user side bar item management
- AccountController:
	- add saved searches and user sidebar items to configuration
	- add user sidebar items integration
- BrowserNavigationBookmark+AccountController: add support for sidebar items, refine representationSideBarItemRefs to return more (fallback) references
- Action: fix comment an identifier typos
- CollectionViewController:
	- add new method for retrieving the most specific client context for an index path
	- use new method to provide correct client context for allowDropOperation and performDropOperation
- OCLocation+Interactions: add new method for customized access to .openItem()
- OCSidebarItem+Cell: adds a cell provider for custom user sidebar items
- OCSidebarItem+Interactions: selection, swipe, context menu, drop and navigation restore support for OCSidebarItems
- BrowserNavigationBookmark: add sidebarItem property, including archiving/unarchiving

* - CollectionViewController/CollectionViewSection: add ability to add a per-section item for section fallback drop interaction handling

* - AddToSidebarAction:
	- only show action if item hasn't already been added to the sidebar
	- add custom icon with plus badge
- RemoveFromSidebarAction:
	- new action
	- only show action if item has already been added to the sidebar
	- add custom icon with minus badge

---------

Co-authored-by: felix-schwarz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved by QA Approved by QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants