Skip to content

Blueprint custom sorting in the index

jaap-karssenberg edited this page Mar 2, 2015 · 4 revisions

Discussion

See mailing list thread for request for comments and discussion: https://lists.launchpad.net/zim-wiki/msg03267.html

Comments

  • Yes, we want custom sorting
    • Use case 1: data is sorted in nature, e.g. chapters in a book, slides in a PPT
    • Use case 2: Efficiency and "spatial memory", put most often used pages in a prominent place and find them back where you put them
  • Better search integration could be an alternative for use case 2 - but not a mutually-exclusive alternative
  • Switching between sorted / alphabetically makes sense, in addition think about sorting by creation time and modification time + suggestion to allow plugins to alter the sorting
  • Main index would switch view by context menu
  • New pages on top or bottom: most favor bottom, no strong driver from use case
  • Would make sense to have a view where some pages are "pinned" on the top of the index, remainder sorted alphabetically

Interface Design

Sorting options

  • Alphabetically
  • By creation time - ascending / descending
  • By modified time (== recent modified pages) - ascending / descending
  • By access time (== recent pages) - ascending / descending
  • Custom (algorithm defined by plugin)
  • Manual (customer drag&drop) - new page at top / bottom

Index

  • Index side-pane shows pages sorted per (sub)section
  • Default sorting (for new sections) can be configured in notebook properties
  • Sorting per section can be configured
    • a/ via properties dialog, including option to apply recursive - add tab with settings per section
    • b/ context menu of the index pane - one level only
  • The index widget allows re-ordering
    • a/ by drag & drop
    • b/ by keybindings (outliner style)
  • When a section is not ordered "manual" and the user attempts to change the order, a dialog will popup and ask for confirmation to switch to manual ordering
  • When a section is ordered "manual" and the user selects any other sorting, a dialog will popup to warn that manual sorting will be lost

Pinned pages

A separate function will be defined to "pin" pages on top of the index, not unlike bookmarks in the gnome file browser. By default "home" will be pinned, other special pages can be pinned by the customer.

  • To pin a page select the option in the context menu of the index
  • In the notebook properties show the list of pinned pages and allow to modify
  • Also allow to pin / un-pin / order pinned pages by drag&drop
  • Pinned pages will appear on top, regardless of the sorting of the index
  • A divider may be draw to visually separate pinned pages from the index

make this a separate blueprint when basic sorting is done

Browser view

A separate (plugin) widget will be defined to show a list of pages including columns for page attributes like modified time, create time, etc. This widget will by default be shown above the page view, not unlike the default view of most email clients. When this view is shown, the side pane index may need to behave different for proper interaction. In this multi-column view, the user can sort on any attribute without changing the inherent sorting of the section by clicking on the column heading.

make this a separate blueprint when basic sorting is done

Implementation

  • The page index will have an additional column to store the order of pages
  • An "IndexSorting" object is needed that supports
    • a/ sorting a full page listing when a section is first indexed
    • b/ determine the position for new pages in the index, using indexed data
  • The notebook properties store the sorting per section
  • The Notebook object will provide the Indexer object with InderSorting objects for each section
  • For manual sorting, the IndexSorting object maintains a list that needs to be stored in the notebook meta data per section
  • For manual sorting, the IndexSorting object supports a method to change order of a section
  • Plugins should be able to register custom IndexSorting objects with the notebook config
Clone this wiki locally