lumoe / obsidian-rollover-daily-todos

An obsidian plugin that rolls over todo items from the previous daily note
MIT License
264 stars 65 forks source link

Improvement/rollover blocks #73

Closed tim-hilt closed 1 year ago

tim-hilt commented 1 year ago

Solves #41

This adds

In the future we should

lumoe commented 1 year ago

That looks very promising, thank you for your work!! :smiley:

the default behaviour of the plugin is well-designed, it should be disabled so that there is no confusion about additional content being rolled-over. We should also add a small section to the README that describes this feature.

Switch to TypeScript This enables a whole bunch of IDE-features and safety-measures that make the plugin more predictable and more maintainable in the long run. Same here: I'll add a new PR shortly.

I agree to that as well. When we do that, we should incorporate the newest changes from the official Sample Plugin from Obsidian: https://github.com/obsidianmd/obsidian-sample-plugin They use TypeScript out-of-the-box and switched to esbuild from rollup.

JS testing via vitest this was very useful to ensure that the TodoParser is doing what I expect it to do Usable via pnpm test according to the npm-scripts in package.json

Thank you!! This has been missing now for a long time. :star_struck: As a note for myself and reminder, that we should also implement tests for filtering out the files and getting the right daily file. We recently added the possibility to have more complex datetime moment formats which supports directories. We recently had quite some troubles with that feature.

Give me a few days to test out this feature and provide you with some feedback.

lumoe commented 1 year ago

Btw. can you also push the options you used for your formatter? Your settings look good, so we can also use it as our main formatter options upstream to avoid formatter diffs in our commits.

tim-hilt commented 1 year ago

Oh, I'm sorry, I just saw that I messed up the formatting of all touched files!

As for the formatter: I use VSCode together with the prettier plugin. I have configured vscode to auto-format on save. That's why I didn't notice that I changed so much!

Prettier doesn't allow for global formatting-settings, so what you see is actually just prettiers default settings. I think the obsidian-sample-plugin is using a .prettierrc though. It would be better to add that to the codebase.

I'll add a new PR to add formatting to the codebase. At some point we could also incorporate husky to perform formatting (and possibly linting / type-checking / building) before each commit.

tim-hilt commented 1 year ago

Ah btw. with this implementation I preserve the indentation of previous todo-elements:

- [ ] Foo
    - [ ] Bar

Will be rolled over as

- [ ] Foo
    - [ ] Bar

As opposed to the previous behavior:

- [ ] Foo
- [ ] Bar

Adjusting this would be a minor adaptation though.