zeldamods / objmap-totk

Tears of the Kingdom Object Map
https://objmap-totk.zeldamods.org
GNU General Public License v3.0
47 stars 7 forks source link

Checklist implementation #70

Closed savage13 closed 11 months ago

savage13 commented 1 year ago

Orignal version was closed as I made a mess of the history.


Added a checklist functionality

Not sure about:


This change is Reviewable

leoetlino commented 1 year ago

Haven't looked at the code, just some high level comments:

Uses the Tasks pane: spane-dummy

If you re-added the Tasks pane, its ID shouldn't be spane-dummy.

Markers

I think it might be better to just hide the marker entirely? Makes it easier to see which map points are left. (Though if we hide completed points there should be an option to show all completed points so that users can undo their mistakes.)

Storing checklist in the Settings (localStorage)

  • Checklist item storage seems large; would it be better to populate the list when needed (using a query) instead of storing all the items. The checklist does not store if an item is marked.

Most browsers seem to have a 5MB size limit for localStorage, so we should avoid storing large amounts of data (especially when drawn markers are also in localStorage).

I would suggest looking into IndexedDB as that has a much higher size limit and checklist data is easy to store in a DB. Browser support seems decent: https://caniuse.com/indexeddb

leoetlino commented 1 year ago

Lists are stored in Settings under checklists. Each checklist has a name, query and the items in the list (hash_id, name, ui_name, map_name, pos).

Do we actually need to store ui_name? I think we can just derive that from the name.

Also, we should store map_type + map_name.

savage13 commented 1 year ago

indexeddb looks good to me. Will write an updated version.

savage13 commented 1 year ago

This adds IndexedDB using the library idb src/util/Checklist.ts is a wrapper around the checklist implementation (state and db)

savage13 commented 12 months ago

I have not rebased the PR, but it appears to be able to merge without conflict.

Sorry the PR is so big. It seems to touch almost everything in the codebase.