card-web icon indicating copy to clipboard operation
card-web copied to clipboard

UI to allow modifying the filters and sorts for the current collection

Open jkomoros opened this issue 3 years ago • 4 comments

There should be UI to modify the currently active collection description.

It would be... non-trivial.

Basically it should allow creating and editing all of the sorts and filters documented in the wiki.

A number of the filters are straightforward:

  • Sections
  • Tags
  • TODOs

You'd also want union filters

But then for all of the other configurable functions there are arbitrarily complex UIs necessary for each.

jkomoros avatar Jun 23 '21 15:06 jkomoros

Maybe have a 'Edit Collection' button in the card drawer overflow that opens up a dialog that allows you to modify the collection and navigate to the new collection.

This issue is likely a dupe of an older one.

The state would likely store a collection description, but then doesn't the canonicalization lose information about the order of pieces? That could lead to UI in the dialog jumping around.

jkomoros avatar Jun 23 '21 15:06 jkomoros

exclude and combine will need special treatment

jkomoros avatar Jun 23 '21 16:06 jkomoros

  • [x] Add description field to SET_INFOs
  • [x] Make CollectionDescription have a mode where it retains the original position of filters
  • [x] Use the original-filter-position machinery in the URL machinery
  • [x] Figure out how to change the collection description when the collection description changes (change the URL? an action creator to take a new collection description and unpack it back into setName, etc in state?)
  • [x] Make the select drop down for set modifiable and update the set when it changes
  • [x] Make sort be an editable drop down
  • [x] Add a reversed sort checkbox
  • [x] Allow removing each filter
  • [x] Add descriptions for each configurable filter, and include them in CARD_FILTER_DESCRIPTIONS (in progress on MBP)
  • [x] Create a selectFilterDescriptions which returns CARD_FILTER_DESCRIPTIONS + the tags/sections filters
  • [x] Add a drop-down for each filter using selectFilterDescriptions results
  • [x] Allow modifying the filter type
  • [x] Allow adding a filter
  • [x] Add an all-cards filter that is the inverse of none and have that be the default
  • [x] Allow modifying the filter-rest
  • [x] Removing a none filter doesn't actually remove it from dialog even though removed from URL
  • [x] Switching from a basic filter to configurable filter doesn't work (nothing happens) (the URL parsing barfs because it doesn't have the necessary pieces afterwards)
  • [x] Having a query filter and then adding an all-cards doesn't show anything
  • [x] Make the order of filters in collection description be stable (e.g. appending things should be added to end)
  • [x] Support unions of concrete filter types directly
  • [x] Add a drop-down for each filter type and if it's configurable have a free text box afterwards.
  • [x] Handle unknown primary filter
  • [x] Print out each filter as free-text
  • [x] Allow adding a filter free-text
  • [ ] Add the ability to manually modify the collection description part of the URL (essentially Ctrl-shift-l dialog), in a text box that just renders the pageExtra to be modified
  • [ ] Make ctrl-shift-l pop the configure dialog and select the free-text version
  • [ ] Add a done button to the configure dialog (if you exit out of the dialog another way then the collection is not updated)
  • [ ] The done button on the dialog should be hit if you hit
  • [ ] Remove 'exclude' and 'combine' from drop down (since it's handled specially and allows sub-filters)
  • [x] union filters should say "OR"
  • [x] Union filters should be possible to add
  • [ ] Handle unknown filter names manually (show a 'Manual' and have a free text box afterwards)
  • [ ] Create a selectFilterNamesByCategory which returns all filter names in a category (e.g. todo, card-type, user, configurable, section, etc)
  • [x] Union filters should be possible to remove
  • [x] Improve performance of removing /editing a filter
  • [ ] combine and + are effectively the same, just optimized URLs and machinery. Should the user have to manage that directly, or just say "and" and it switches to the most optimized version?
  • [ ] Have certain filters only show up when you're an admin
  • [ ] Add an 'invert' (add 'exclude') prefilter
  • [x] Move piecesForConfigurableFilter et al into filters.js
  • [x] Pop the logic for a given individual filter into a custom element responsible for reporting its value and when it changes
  • [x] Simplify the signaling logic wihtin configure-collection.filter since we have index at the top level property
  • [x] Create a sub-sub custom element for date picker, card picker, and any item that needs to report multiple things joined into one value
  • [x] Render multiple text fields for configurable filters, one for each URL_PART (treat all the same to start)
  • [ ] The URL_PART configuration should be an array of objects with the type, description, and default value (get rid of the defaultFactory)
  • [x] Support date arguments in combinable filters (handle between, after, before)
  • [x] Support int arguments in combinable filters
  • [x] Support string arguments in combinable filters
  • [x] Support single card with include_self in combinable filters
  • [x] Support reference-type arguments in combinable filters
  • [x] Support multiple cards
  • [x] Make key-card control allow selecting card via find dialog
  • [x] URL_PART_KEY_CARD should render all as one line
  • [ ] Disallow illegal characters in free text field (e.g. anything but [a-zA-Z0-9+_-]
  • [ ] Actually pop a dialog to pick cards for KEY_CARD and MULTIPLE_CARDS
  • [ ] The references/referenceType machinery should allow lists of reference types (and exclusions)
  • [x] Remove defaultsFactory machinery and just rely on URLParts machinery?
  • [ ] Add a 'combine' (add 'combine') to each filter
  • [x] Add a CollectionDescriptionWithSet, CollectionDescriptionWithFilterRemoved(index), CollectionDescriptionWithFilterAppended(filterName), CollectionDescriptionWithFilterModified(index, newValue), CollectionDescriptionWithSort(sortName, sortReversed)
  • [x] Create a 'configureCollectionDialogOpen' bit
  • [ ] Handle URL_PART_LINK_FILTER
  • [ ] Triple check the CONFIGURABLE_FILTER_INFO for the reference types, some of them I think were configured wrong (e.g. expecting an int when it should be only key card and reference type)
  • [ ] Be more resilient to inpute type='date'. It might be returned in different strings for different people in different locales. And it doesn't actually render the date properly
  • [x] Make an affordance to open the configure collection dialog
  • [ ] The affordance to edit the collection should go right next to the number of cards, not in the info overflow (this should also make it work for non-admins)
  • [ ] Update wiki documentation
  • [ ] Pick a better icon for the collection configuring affordance
  • [ ] Tighten up spacing and positioning in the dialog

jkomoros avatar Jul 02 '21 13:07 jkomoros

To get the performance to be OK there should be a activeCollection and snapshotCollection, where

			activeSetName: action.setName,
			activeFilterNames: [...action.filters],
			activeSortName: action.sortName,
			activeSortReversed: action.sortReversed,
			activeViewMode: action.viewMode,
			activeViewModeExtra: action.viewModeExtra,

Is all filtered out into a new type, and there's a 'snapshot' method. Then CollectionDescription could just selectActiveCollectionConfiguration and pass each property into CollectionDescription (which could have a concstructor that also takes an object of that shape (the current selectActiveSetName etc don't get used for anything other than selectActiveCollectionDescription anyyway

jkomoros avatar Aug 28 '22 17:08 jkomoros