thombruce / toodles

āœ… A super simple todo app
https://toodles.thombruce.com/
GNU General Public License v3.0
0 stars 0 forks source link

[Feature]: Support multiple todo documents #126

Closed thombruce closed 4 weeks ago

thombruce commented 1 month ago

Feature request

As of now, Toodles will look for or create a todo.txt file in the same directory as the application.

While in portable mode (and we aren't presently targeting any other mode), we should find other documents in the directory (and maybe the subdirectories of current) which match the name todo.txt or the extensions .todo, .shop and .list.

These should be selectable somehow in the application (I think a menu accessible from the navbar, but we could introduce a separate page for the list initially).

When opening the application... how do we choose which document to show?

I think maybe a lastOpened value in the config document (currently tnt.config.json but ideally this would have Toodles' name) makes sense. We would check this value and, if the file exists, open it. If it does not exist (e.g. it has been deleted or the user has manually edited the config file)... šŸ¤”

I think if it does not exist, rather than try to create it we should default to showing the list of available documents.

If there are no available documents, THEN we should default to todo.txt.

If there are no documents and/or lastOpened is not set, we should default to todo.txt too.

Code of Conduct

thombruce commented 4 weeks ago

I have some work locally that is able to list and allows me to navigate between documents. It does not yet allow me to create new ones, delete existing ones or change their names. This will all come...

But I think the list and navigation is a good case for TNT Electron. Toodles isn't the only application I'm planning that will benefit from document navigation features.

Toodles should be able to say to TNT Electron...

Hey, gimme a list of documents (and their folder paths, recursive) from our root directory that have the file extensions .txt, .todo, .list and .shop!

And TNT Electron should handle finding and listing those documents in a component for us.

Toodles should be able to do some additional filtering. For instance to discard .txt documents that do not match todo.txt or done.txt. Actually, TNT Electron should accept a pattern that would allow us to offload that responsibility to TNT too but... whatever's returned should still be manipulatable/filterable by Toodles.

TNT Electron might invoke a store to achieve this. The store may live in TNT Electron's composables/ folder for general use throughout the application.

Presentation-wise... Sidebar makes the most sense (though we don't have a sidebar yet - just a Dropdown component, so temporarily we might slap the results there).

Do remember: Not all applications will necessarily want this feature, so we can't just bake it directly into TNT Electron as a default feature. Toodles still needs to call on the functionality and decided how to handle the results of documents being navigated to... probably. In either case, any [...slug] like routes exposed by TNT Electron should be optional - if I add the handling for them there, the user should be able to ignore the use of them...

It's really all a question of "what happens when one of these file buttons is clicked?"

To handle that, whatever file list component I end up making should accept either a prop or... a repeatable slot... either of which should be able to specify the resulting behaviour. Like, hey, treat that as a link and send it to my custom route, please!