Recents bug fixes #84
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recents should load by access time since I changed
try { setRecentsData(await db.notes.readAll()) }to thistry { setRecentsData(await db.notes.getRecents(cardCount)) }.break-all overflow-ellipsisThese tailwind classes have worked in my testing to prevent overflow. The overflow ellipsis adds a ... to the end if it overflows.By adding this to the query for the getRecents function
SUBSTR(content, 1, 65)it limits the amount of characters returned and has improved the speed when testing with 8 notes where the content is the Cuda test text you sent me.If you see below I tested using window.href but it caused the recents menu to close when clicking on a note from it.
window.mp4
I tried recreating the issue with the old code:
onClick={() => router.push(/note?id=${note.id}) }but the code was working fine I liked how it worked better.shorterRouter.mp4
If the issue is still appearing I will fix it quickly. I will try and test recents during next meeting.