Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Open next note automatically after a review never picks from "new" #904

Closed
finn-matti opened this issue Mar 18, 2024 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@finn-matti
Copy link

Describe the bug
When using the option "Open next note automatically after a review" and reviewing notes the "new" stack is skipped.

To Reproduce
Steps to reproduce the behavior:

  1. Activate Open next note automatically after a review
  2. Have same notes in new and some with a date
  3. Start reviewing notes
  4. See that notes in new are never picked

Expected behavior
New notes are the first to be picked.

Versions (please complete the following information):

  • OS: MacOs 14.2.1 (Sonoma)
  • Obsidian version: Version 1.5.8 (Installer 1.4.13)
  • Plugin version: 1.11.2
  • If on desktop, Installer version: 5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) obsidian/1.4.13 Chrome/114.0.5735.289 Electron/25.8.1 Safari/537.36
@finn-matti finn-matti added the bug Something isn't working label Mar 18, 2024
@ronzulu
Copy link
Collaborator

ronzulu commented Mar 19, 2024

Thanks, I think I remember a similar report... [BUG] open a note for review can not open notes correctly.

@finn-matti
Copy link
Author

@ronzulu Thanks! I tried to find a bug report fitting mine. However it seems that this one is quite old and complains about not correctly set metadata/properties which in turn leads to weird behavior. I think mine is purely concerned with obsidian-spaced-repetition never picking from the new stack.

@ronzulu
Copy link
Collaborator

ronzulu commented Mar 19, 2024

Yes, not always easy to find existing similar issues.

Came across another one... [BUG] In New jumping to next will go Today instead of taking the next one in New #716

Listing here so that when your issue is rectified, all related ones can be checked as well.

Cheers
Ronny

@finn-matti
Copy link
Author

That's more like it. I might even look into this problem myself if I find the time. Let's see. Any pointers to where the decision point for picking the next note is?

@ronzulu
Copy link
Collaborator

ronzulu commented Mar 19, 2024

That would be great 😄

  • The code seems to be in src/gui/sidebar.ts
  • I'm currently working on [FEAT] Refactor code to support different methods of storing the scheduling info #878 , which is requiring quite a significant restructure. In the process I'm decoupling a moderate amount of logic from gui code, but not touching the guts of sidebar.ts
  • Would be great if you would be able to separate out the logic from the gui in sidebar.ts and write test cases (but sounds like you are busy, so this might be beyond scope)

Cheers
Ronny

@finn-matti
Copy link
Author

finn-matti commented Mar 24, 2024

Hm. Actually the only problem it turned was that here:

        if (deck.dueNotesCount > 0) {
            const index = this.data.settings.openRandomNote
                ? Math.floor(Math.random() * deck.dueNotesCount)
                : 0;
            await this.app.workspace.getLeaf().openFile(deck.scheduledNotes[index].note);
            return;
        }

        if (deck.newNotes.length > 0) {
            const index = this.data.settings.openRandomNote
                ? Math.floor(Math.random() * deck.newNotes.length)
                : 0;
            this.app.workspace.getLeaf().openFile(deck.newNotes[index]);
            return;
        }

Due notes are considdered before new notes. Since this can't be changed you may end up in a situation where you never make it to the new notes because you have so many due notes. I just switched those two if statements in the built js in my plugin installation an it worked.

Sadly I don't have a lot of time to fix it in a more involved way. I think though it should be an option to choose which of the notes should be checked first.

@ronzulu
Copy link
Collaborator

ronzulu commented Aug 9, 2024

Issue #947 has been fixed and has been released in the latest mainstream version 1.12.5, which I believe could have solved this issue.

I'm closing this now, but feel free to reopen if that hasn't resolved your problem.

@ronzulu ronzulu closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants