Frederik Handberg's avatar
Frederik Handberg
npub1nj0c...2gqz
23 🇩🇰 Studying for a degree in Software Engineering while building fun projects and working freelance as a News Photographer 📷 I share my software projects, photos and videos from my work as a news photographer, and progress updates as I learn to sew garments. Basically, I just write about my hobbies. frederikhandberg.com
The visual canvas is improving a little bit each day. Text and image objects are mostly finished now. Tomorrow I will work on getting videos to work. I need to decide if I want videos to autoplay. It might become problematic in terms of performance if there are like 10 videos in the visible area. Obviously, videos that are not in the visible area should not play… Another option is to only play a video if the user is hovering over. Tbh I think it should just be a setting that users can toggle. #dev image
I’ve made lots of progress to the visual canvas functionality of my notes app. Text and image objects work well. They are not finished yet, but the basic functionality works, like moving objects around, changing font size, formatting styles like bold and italic, and so on. Tomorrow, I should make it possible to select objects by making drag selections. Then I should be able to move all selected objects around together. Clicking backspace should delete all selected objects. I think these features should be fairly easy to implement. I’m more concerned about how to move the viewport to follow cursor when I move objects around. Like, if I am moving objects and the cursor is near the edge of the window, I want the canvas viewport to move in the cursor’s direction, so that I don’t hit a hard boundary. I spent quite a bit of time figuring out how to make the zoom in and out gesture working. Luckily there is a modifier called `.gesture(magnification)`, but this will not zoom in at the cursor position which is what I wanted. From my testing, it by default zooms in at the upper left corner. I also struggled to make two-finger swiping work to pan around the canvas. Interestingly, there is no ready to use API provided by Apple, so I had to figure out my own way. View quoted note →
After switching back to VSCodium (fork of VSCode) from Zed editor I can definitely see my battery life being drained much faster. God damn Electron 😂
The CEOs of the AI companies are hype-machines. They need to constantly generate hype for AI to keep the investment money coming.
Currently, the note documents just have the `.json` extension, but this is a problem as the visual canvases also have `.json` extension. Both are JSON files. I'm considering just using a double extension like `.note.json` and `.canvas.json`. Then in the app, I will hide the `.json` extension. View quoted note →
I think my Markdown support is getting pretty good (at least the ‘Source’ mode works), so time to move on to the next big feature which is the infinite visual canvases. In my opinion, that will be the coolest feature of the app!
I don’t really like winter, but can’t deny snow is beautiful ❄️ image
Been using Zed editor for many months now, but have experienced it not being able to show code suggestions, not being able to cmd+click on a method to go to where it's defined, and sometimes it takes ages before errors are removed after I have already fixed them. It requires me to quit the app and reopen before the issues I described are fixed. Then suddenly, all the same issues appear again... Now I'm back on VSCodium. I don't remember it having any of these issues. It's just annoying having to get work done while dealing with problems that just should not happen - at least only very rarely...
A 19 year old woman was stabbed in Juelsminde. Her injuries are not life-threatening. #press
This is a different version of the Markdown editor I am building. In this version, I am setting the Markdown syntax to font-size 0.01pt and color to invisible. This is different from my other version where I remove the syntax entirely from the string. Then when I need to show the syntax, I insert it back again. This is quite a fragile way to do it. I'm sure I can make it work, but changing the font-size to make syntax invisible rather than removing is much safer... #dev
Turns out, it's not actually a re-rendering issue, but rather a problem with how I am storing the string. In the current version, I store the string in the ViewModel without any of the Markdown syntax. Then my code tries to re-parse the string. Obviously, the parsing does not work, because there is no Markdown in the string that can be parsed... The interesting thing is, that initially when I load the MD file, all the syntax is parsed correctly, but as soon as I type a character, the whole string gets replaced with a version that has all the syntax removed - this is what I call the collapsed version. I must store the expanded version (the one with all the Markdown syntax), because otherwise the styling is completely lost. But I also need a string without the syntax, as this is the one that should be displayed by default in the 'Live Preview' mode. **So, this is my plan...** I need to store two different strings: - Collapsed version (what user sees in the editor): `"Display & Remove Syntax"` - Expanded version (with syntax): `"# Display & Remove Syntax"` When I want to render the syntax (e.g. if user clicks in formatted text), I should use the expanded version. But I only want to show the syntax for that particular range, not for the entire string... View quoted note →