Themes, more bugs squashed!
All the themes are based on the Catppuccin color palettes because they are wonderful, and allowed me to focus on other things instead of making a color palette. And it looks phenomenal!
The theme switcher is painfully simple. React’s Context API is so underrated. It saves your theme in localstorage and loads it every time you open the page!
File name restrictions
This one was a little tricky to get correct. I had to go through a bunch of the old logic in the sidebar to ensure that no file names collided, and if they did, make sure that state doesn’t get pushed.
Additionally, I had to make creating files look at the rest of the files in the folder and append a 1, 2, 3, etc. to “New File” so the names didn’t collide as soon as you created them.
I was going to put these same restrictions on the server and realized that would take forever with little benefit, as if you break the client to send requests like that, then you’re going to break it. It doesn’t even break that badly, the files work perfectly fine, it’s really just links. After all, these are self-hosted instances, so if you forge some stupid requests I could not care less.
Link handling
Speaking of links, cross page links are functional again! I procrastinated this one too much but I just needed to make a new helper function, nodeFromPath. It takes an array of strings, being the path to a node, and give you the node (or undefined) that path leads to. I just love working with trees so much, recursive functions are my favorite 
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.