Frederik Handberg's avatar
Frederik Handberg
npub1nj0c...2gqz
23 🇩🇰 Studying for a degree in Software Engineering 💻 I enjoy building mobile/desktop apps and embedded projects and working on massive heavy-lift drones. Also learning to sew garments as a hobby to tailor clothes for myself 🪡 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...
Finished ‘The Chaos Machine’ by Max Fisher. Next #book to read: ‘Enshittification’ by Cory Doctorow. image
Been fighting with #AppKit and #SwiftUI to solve a height calculation problem. Seems like sometimes AppKit does not realize that the height of the SwiftUI code block view has changed. This leads to a problem when the code block grows in height (e.g. when adding more lines) and then it eventually starts overlapping other elements in the Markdown editor. image I am using `NSTextAttachment` to embed an interactive SwiftUI view as a `NSHostingView` inside `NSTextView`. It's really powerful but I also find it so difficult to work with. Especially when needing to share states/updates between the `HostingView` and the `NSTextView` (which is the outer Markdown editor that the code block is embedded into). Codex seems to have finally found a semi-working solution to the height calculation problem. At least it works when I open the MD file, close it and reopen, then I can add more lines in code block and the editor will correctly update its height to accommodate the growing code block. However, if I just open the MD file immediately after having started the app, then begin adding more lines, it will not tell AppKit's `NSTextView` about the height changes leading to overlapping issues. #dev #macOS View quoted note →
The Codex CLI is so much more readable than the Antigravity CLI. Been using Gemini for a few months now as the only LLM, because I got it for free (student discount). It's not bad but GPT-5.5 does feel like an improvement and the CLI is much nicer to look at.
Headings can now be collapsed in the #Markdown editor I am working on. When collapsing a heading, the app will remember this, so that when closing the Markdown file and reopening it again, the same heading will still be collapsed. #dev
Will soon begin #sewing a t-shirt using my newest pattern. This will be the sixth iteration of the pattern. I learned that t-shirts are usually made where the back pattern is about 1cm taller than the front. Apparently, it makes the t-shirt fit better. On some of my t-shirts, I’ve had a problem where it feels like they are pulling backwards, and this change should fix this issue. This change of 1cm caused the armholes to have a new length meaning I had to redo the sleeves as well. image
Been working on this task for a few hours. I got the feature mostly working. Now clicking heading buttons in the 'Outline' sidebar view will scroll to the appropriate heading. Works as expected. There is a bug however... In the video, you can see how sometimes the images and videos are flashing for a brief moment. Like they disappear and then show again. This bug only happens to some images and videos. Not sure what is going on, but something is clearly causing them to re-render. #dev View quoted note →
The task for today will be to implement support for the outline/table of contents in Markdown files. Already have this working for the JSON note documents, but the implementation for Markdown will be more complex as I need to parse the headings to figure out where they area. View quoted note →
Added a new dialog popup that shows when user imports an image or video that already exists in the Space vault. image This dialog asks the user if they want to use the existing image/video file or duplicate. #dev #macOS #Swift #SwiftUI #AppKit
For a long time I've wanted to try out the Qt framework. It would also be a great way to learn C++, which could turn out to be a useful language for me when I start getting more into building drones. Just found out Liquid Glass works in Qt: This is good as it means I can more easily make a native-looking macOS app. I have never been a fan of cross-platform frameworks, they just never impress me. But Qt is special in the sense that performance should be excellent. Apparently, it can also work for mobile apps, but I would not use it for that. I'm more interested in using it for desktop apps, so that I can ensure perfect Linux compatibility. I did try using #Tauri to build a webapp a few weeks ago and it was fine, but the native webview on #Linux is apparently trash, so Tauri is a no-go for me as it uses native webviews on each OS. Qt seems like the best choice - also many apps on Linux use it.
Outside enjoying nature with the dog 🐕‍🦺🚶‍♂️ Maya got herself a new pink collar :)
Now the image popup is also working! There was a bug where the cursor would be overridden to `NSCursor.iBeam` because there is an `NSTextView` behind the popup. Now this bug has been fixed, so that the arrow cursor is showing when popup is open. #dev #Swift #SwiftUI #AppKit #Markdown
Bug is now fixed 🚀 The cursor is now changing to the correct `NSCursor` style when hovering image and video attachments in the #Markdown editor. In the video, you will notice how when I click an image attachment which opens it in a popup, the cursor style actually changes back to the `iBeam` yet again... This is the next #bug to fix 😄 I want it to just show the normal arrow cursor when image popup is open. View quoted note →
Working on fixing a classic #AppKit and #SwiftUI bug where the `NSTextView` will aggressively override the `NSCursor` to `iBeam` (which is default for textviews) even when you specify that a different cursor style should be used. In this case, I am trying to get the `NSCursor.pointingHand` cursor to show when hovering an image attachment. For video attachments, the normal arrow cursor should show. #dev