Damus
Frederik Handberg profile picture
Frederik Handberg
@frederikhandberg

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

Relays (4)
  • wss://relay.damus.io – read & write
  • wss://relay.nostr.band – read & write
  • wss://relay.snort.social – read & write
  • wss://nostr.oxtr.dev – read & write

Recent Notes

Frederik Handberg profile picture
I notice that when I use Gems in Gemini _(which is just a project like in Claude)_ and I upload some files, if I then reload the page, it will often duplicate the same files.

Gemini 3.1 Pro is good, but the UX is so much nicer in Claude and Sonnet 4.5 is just as good at coding.
Frederik Handberg · 4d
I'm getting a leak somewhere in my formatting notifications (I use `NotificationCenter`). This is causing problems if I have two note documents open in the same window. For example, if I change the ...
Frederik Handberg profile picture
Think I have found the issue.

It's most likely the way I use `removeObserver`. I need to pass the observer token to `removeObserver` to make sure the correct observers are actually removed. This means I need an array to keep track of the many tokens from all the different formatting notifications.
1
Frederik Handberg · 4d
The token strategy did not make much of a difference, but replacing `.onAppear` and `.onDisappear` with `.onReceive` worked. I also decided to use `MergeMany` instead of having one `.onReceive` for each notification (there are many). https://developer.apple.com/documentation/combine/publishers/merg...
Frederik Handberg profile picture
I'm getting a leak somewhere in my formatting notifications (I use `NotificationCenter`).

This is causing problems if I have two note documents open in the same window.

For example, if I change the block type from text to a heading in one of the notes, then save and go to the other note, it will have completely overridden the data.
2
Frederik Handberg · 4d
Think I have found the issue. It's most likely the way I use `removeObserver`. I need to pass the observer token to `removeObserver` to make sure the correct observers are actually removed. This means I need an array to keep track of the many tokens from all the different formatting notifications.
Frederik Handberg · 4d
Apparently using `.glassEffect()` on the window background will break the functionality of the `.onDrop()` modifier. I wanted the Liquid Glass effect on the window background of my app, so I added th...
Frederik Handberg profile picture
I appreciate that Apple provides all the properties you can call on `NSGlassEffectView` like `tintColor`. In my case I applied a black color with 50% opacity - looks really good.

Would like to have the same options for `NSVisualEffectView`…
1
Frederik Handberg · 4d
I have long wondered if there are some private APIs to control the opacity and blur radius of the `NSVisualEffectView` 🤔 I have seen apps _(like Warp terminal)_ that allow the user to control these values.
Frederik Handberg profile picture
Apparently using `.glassEffect()` on the window background will break the functionality of the `.onDrop()` modifier.

I wanted the Liquid Glass effect on the window background of my app, so I added the `.glassEffect()` modifier which worked, but then I could not drag-and-drop files in the infinite canvas anymore…

Turns out that you need to use the AppKit class called `NSGlassEffectView` instead. Now the `.onDrop()` modifier works again.

https://developer.apple.com/documentation/appkit/nsglasseffectview
2
Frederik Handberg · 4d
I appreciate that Apple provides all the properties you can call on `NSGlassEffectView` like `tintColor`. In my case I applied a black color with 50% opacity - looks really good. Would like to have the same options for `NSVisualEffectView`…
Logen · 4d
Good stuff man!
Logen · 4d
That’s a legit camera
Logen · 5d
I could work on this feature Right now it’s designated for the other way around