open-spaced-repetition / fsrs4anki-helper

An Anki add-on that supports Postpone & Advance & Load Balance & Easy Days & Disperse Siblings & Flatten
https://ankiweb.net/shared/info/759844606
MIT License
213 stars 17 forks source link

Feat/clear manual rescheduling logs #488

Closed L-M-Sherlock closed 1 week ago

L-M-Sherlock commented 1 week ago

Preview:

image

Patch:

fsrs4anki-helper.ankiaddon.zip

user1823 commented 1 week ago

Like https://github.com/open-spaced-repetition/fsrs4anki-helper/pull/455, this should force a one-way sync.

L-M-Sherlock commented 1 week ago

@user1823 nice catch. The last 90ed304 comment should solve it.

fsrs4anki-helper.ankiaddon.zip

L-M-Sherlock commented 1 week ago

@user1823 could you help me improve the wording?

user1823 commented 1 week ago

Can you first explain what is the actual purpose of this feature? Is it aimed at removing just the "Reschedule cards on change" entries with the other entries being removed only because we can't keep them?

L-M-Sherlock commented 1 week ago

Yes, it aims at removing the useless entires generated by "Reschedule cards on change". In extreme case, the percentage of this kind of useless entires will reach 25%.

@Expertium, I hope you can elaborate it: https://discord.com/channels/368267295601983490/1282005522513530952/1304016208080666634

user1823 commented 1 week ago

In Anki 24.11+, we can distinguish between Reschedule cards on change and Set due date entries (only those entries which were created after the update). However, if we still have to use the same SQL query because the older entries are ambiguous, I am wondering what was the benefit of that change.

user1823 commented 1 week ago

Probably we need to make it more configurable. I am thinking something along these lines:

@Expertium, WDYT? If you agree, can you help in designing the UI for this?

Luc-Mcgrady commented 1 week ago

What I've always thought would be a good solution for this would be to delete any manual review that comes directly before another manual review. That way the set due dates/reschedules that were never reviewed would be cleared while still leaving any reschedules/manual sets that actually matter.

Example: image

L-M-Sherlock commented 1 week ago

What I've always thought would be a good solution for this would be to delete any manual review that comes directly before another manual review.

Could you help write the SQL? Or implement it in another way?

Luc-Mcgrady commented 1 week ago
DELETE FROM revlog as cur
WHERE cur.type >= 4
AND cur.factor <> 0
AND (
    SELECT type
    FROM revlog
    WHERE id = (
        SELECT min(id)
        FROM revlog
        WHERE id > cur.id
        AND cid == cur.cid
    )
) >= 4

This should work

L-M-Sherlock commented 1 week ago

Have a try:

fsrs4anki-helper.ankiaddon.zip

L-M-Sherlock commented 1 week ago

Done:

fsrs4anki-helper.ankiaddon.zip

khonkhortisan commented 1 week ago

Delete redundant manual revlog entries → force full sync? [yes] → remove revlog entries generated by "Set due date"? [no] → normal sync [y]. The yes/no dialogs should be in the other order, so that I'm locked into full syncing immediately after the full sync dialog.

L-M-Sherlock commented 1 week ago

Sorry, I'm confused. I think force full sync is necessary. If it's unnecessary, I have to rewrite the dialog of force full sync.

user1823 commented 1 week ago

Yes, it is necessary.

But, move the full sync dialog AFTER you tell the user what this option does.

So, if not ask_one_way_sync(): return comes just before revlog_ids = mw.col.db.list(

L-M-Sherlock commented 1 week ago

cc

fsrs4anki-helper.ankiaddon.zip