Frederik Handberg's avatar
Frederik Handberg
npub1nj0c...2gqz
23 🇩🇰 I'm studying for a degree in Software Engineering while building fun projects and experimenting with drone technology. I'm also learning to sew garments as a hobby 🪡 Sometimes I work as a freelance photographer for different news outlets 📷 I mostly share progress updates as I'm working on my software and drone projects, and as I learn to sew. Basically, I just write about my hobbies...
Yesterday was my first time cooking outdoors this year. As usual for me, the menu is burgers 🍔😂 image
I'm constantly running into performance bottlenecks with SwiftUI... Trying to build a minimap in my notes app similar to what Sketch has in their app, but it's clear that I either need to make the minimap more simple or drop down to low level APIs. I think Sketch does text rendering via `CoreText` and uses `Metal` (aka `Core Graphics`) to paint pixels directly on the screen. They might only use one `NSView` for the canvas itself. This is very different from how I do this, as I'm rendering each object as a separate SwiftUI view. **The minimap in Sketch app:** image
Done ✅ Tomorrows task is going to be implementing a fix for an issue I discovered just now: If I open two tabs with a canvas file in each tab, I am unable to perform magnification in either of the canvases. In other words, I cannot zoom in and out. The app is not frozen or anything like that. I can switch tabs, open new files, etc. but inside the canvas files, I just can’t perform the pinch gesture - nothing happens. #dev View quoted note →
I fixed my "oopsie", so now I can continue implementing features. View quoted note → Will implement a feature to convert a "- " to list item in the JSON notes. Will also fix a bug where converting a list item to text block will unfocus the block. The expected behavior is that the cursor should stay in the block, so the user can continue editing after having clicked enter/return key on an empty list item block - this converts the list item to a normal text block.
Added a minimap to the infinite canvas! 🚀 image **The inspiration:** When I first started using the Sketch app to design user interfaces, one of the features I liked most, was their minimap. I find it really helpful to navigate around. I wanted my notes app to have a similar minimap feature. **Functionality:** The picture shows the first version of the minimap in my app. You can click anywhere in the minimap and it will then move the viewport to that position on the canvas. The box can also be dragged around to move the viewport. The box in the minimap shows what the user is currently seeing. This means, as the user is panning around the canvas, the box will also move. If the user zooms in or out, the box will increase or decrease in size. **Future development:** I am quite happy with the functionality of it. I don't see what more should be added, so I will work on improving the UI. #dev #Swift #SwiftUI #AppKit #macOS
Now that I got video objects to work nicely in the visual canvas of my notes app, I will work on drag and drop functionality tomorrow. For example, I will make it possible to drag and drop image and video files from the ‘Files’ sidebar and into the visual canvas. Furthermore, it should also be possible to drag and drop an image or video file from outside the app (e.g. Finder) and into the visual canvas. And lastly, it should be possible to copy-paste an image and video file into the visual canvas. That’s the mission for tomorrow… #dev
I finished sewing the neckband to the t-shirt that I have been working on. I had to undo the seam because I didn’t stretch the elastic neckband fabric enough… But now on second try, it looks quite good. It’s the second sewing project I have ever done. There is definitely room for improvement. The fit of the t-shirt is perfect. Perhaps the shoulder seam should have been just a bit longer, but I’m very happy with it. In terms of what could have been better, it mostly has to do with the actual sewing. I especially need to work on my patience to take it slow. I’m used to software engineering where I can just quickly delete and start over if I made a mistake. It’s not that simple when it comes to sewing. Undoing a seam takes time and it causes damage to the fabric like small holes from the needle. #sewing image
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.
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!