Open tobiasKaminsky opened 4 years ago
I think it is problematic that the GUI is quite disconnected from the underlying datastructure. The List in the GUI is sectioned, but the text file is just a flat list. This introduces problems when reordering items. Moving them across sections would move them to other categories (if that worked). And the index/position gets messed up.
I think one way to solve this is to read all items and store them in an array list (we could also use one List for each category). Then GUI operates solely on those List(s). Upon close it writes the data, sorted by categories and in the desired order (e.g A-Z or manually sorted). Any operation on the items needs then to be done by object and not by indices.
What do you think about adding a new field to each list item with a tiny font (and additionally color coding). And then adding new sorting functionality to sort by category? And then maybe extend the app settings to let the user define (multiple) orderings of categories?
I think this just clutters the UI. Of course I will enhance the UI of category headlines.
This is a screenshot from Out of Milk, which shows a clean and structured view of categories (imho)
UPDATE: So indeed sorting is broken. I had a quick test and I guess we would need to use one List for each category. At least this way it is working to sort correctly.
What do you think? As this is quite a big change, I would like to ask before working further on it.
update: Sorting is now working again :tada:
This adds support for categories:
Currently missing is UI for changing/adding/resorting categories. This can be done via editing plain text file, for now.
Signed-off-by: tobiasKaminsky tobias@kaminsky.me