github fccview/jotty 1.20.0
Stable 1.20.0

7 hours ago



Join our communities


Changelog

This release upgrades Jotty from Next.js 14 to the latest Next.js 16.
I had to do this on all my projects due to some concerning security issues that happened in React, Vercel fixed them from Next 15 and above but didn't apply a fix to Next 14, it was about time (I was dreading this lol)

This however means we now use an entirely different system for the PWA, so... WE FINALLY HAVE OFFLINE CACHING, in read mode only , for now, but this means if you visit a page on your PWA, it'll stay cached for 30 days. So if you go offline you'll be able to still visit any note/checklist you previously visited. I'm thinking of optimal ways to pre-fetch all notes/checklists so it caches the whole page without having to first visit one, but good progress so far. You WILL need to re-install your PWA and clear your browser cache.

All unit tests pass, all linting/typing pass and I have manually testes as much as I could think of, spent days testing and fixing any minor bug that was caused by the upgrade. This SHOULD be very stable, however if you find any issues please raise it as soon as possible and I'll jump right on it. I apologise in advance, this was A LOT for one person 😆

bugfixes

  • Fix sidebar state when navigating back from notes/checklists and fix flickering on first page load when mode is not set to 'last-visited' #384
  • Make new lines more consistent #382
  • Fixed circular loop where if User A was sharing a note with User B and User B was sharing a note with User A the whole app would crash (YIKES) #389
  • Fix visual bug on long checklist items with no spaces #387
  • Fix table of contents scroll behaviour #398
  • When creating a quick note from within a category said category should be prioritised over default in user settings #397
  • Fix inconsistent behaviour around deleting shared notes/checklists #399

features

minor features

  • Add ruler to markdown editor to set one or multiple visual breaking points to keep your line size in check #311
  • Make sure markdown editor settings persist in your session across multiple notes (e.g. ruler disappear from any notes if you disable it)
  • Public URLs will now use uuid rather than category/name, this keeps the sharing link safer to use. Old public links will continue work just fine, but newly shared notes will follow this new pattern
  • Change order of new list items, they'll now show up on top of the todo list, it makes way more sense. Let me know if this is an issue for you and I'll consider making it a setting :) #392
  • Add swipe gestures to notes on mobile, you can now swipe between notes as long as the editor is not active, this means you can navigate to previous/next note by swiping. Notes order is defined by sidebar order. You can find a video here #388
  • Using the same gesture from the above, I have also updated the sidebar open/close gesture on mobile and it should feel more fluid and native app/like.

major features

  • Read only offline cache for the PWA. This means when visiting any page within Jotty it'll get cached and you'll be able to re-visit it without your internet active, cache lasts 30 days. When you are offline you'll see a nice red dot on the logo to tell you there's no internet connection. #281 #390
  • LIVE UPDATES on pretty much everything aside from the editor. If something changes on one screen, you'll see the change happening live on the other (give it a second, give or take). This will make working on shared checklists a breeze and if you are looking at a note and somebody changes it, you'll see that change in real time. Editor MAY or MAY NOT be coming, I can't promise, it's A TON of work, that's google level shit and I'm one dude, so we'll see lol #355
    • There's a nice little dot on the logo to show that the websocket is active and you will see live updates, while I think it's quite handy it can also be hidden from settings -> user prererences -> hide connection indicator from logo.
    • If you have any issues with the dot staying orange and the console telling you that websocket can't connect i'd logout/log back in, it may be that it's not recognising a stale session.

optimisations

I have spent quite a bit of time refactoring things, it now shouldn't matter if you have 10 or 1000 files in your system, the speed difference should be laughable.

  • Keep only 12 notes/checklist in store rather than your full catalog for the most recent notes, clicking on categories now fetches notes from the server side in chunks only if they are within that category (recursive search is not yet implemented, sorry)
  • Search by uuid using grep instead of cross matching all notes metadata, this is almost instantaneous, should make a HUGE improvement in performance, especially if you have a lot of notes/checklists
  • Sidebar only uses metadata rather than full note content, using sed to only fetch the yaml from the markdown files frontmatter
Been testing locally with 500 markdown files image

security

  • @isaacs/brace-expansion has Uncontrolled Resource Consumption - High
  • Next.js HTTP request deserialization can lead to DoS when using insecure React Server Components - High
  • Next.js self-hosted applications vulnerable to DoS via Image Optimizer remotePatterns configuration - Moderate

small note on offline caching

I know we all want offline write operation, I truly want to make it happen but due to the nature of Jotty and the lack of database making it happen is a whole different beast, I wish I had done this from the get go but I would NEVER thought my little app would grow to this extent.

Here's a breakdown of what Jotty would need to make this happen:

  • An IndexDB queue to store pending mutations (note edits, checklist toggles, etc.)
  • Intercepting every server action to write in the local indexDB first
  • A background Sync action to replay queued operation when back online (e.g. you go back online the indexDB queue starts happening and it syncs with the server)
  • Conflict resolution (this WILL be a huge pain) if the same item was edited on another device while offline
  • An innumerable amount to UI changes to make sure users are aware of all that's going on in the background or it'll be a mess

Feel free to fork and help out with it, and let's see if we can all make it happen together

Don't miss a new jotty release

NewReleases is sending notifications on new releases.