But Iβm happy with how this feature turned out! π
But Iβm happy with how this feature turned out! π
I will probably lower the opacity of the sidebar overlays just a bit, so they match the appearance of the app with the translucent blurry background. Because right now, I donβt think the dark solid background color of the sidebar overlays match the appβs appearance.
I just finished working on a sidebar overlay for the notes app I'm building π»
When hiding a sidebar, the user can now move their cursor to the edge of the window, to show an overlay of the sidebar. I think it looks nice the way it slides out. #dev #macOS
Finished the tooltip for the notes app π #SwiftUI #AppKit
Worked on a color picker today for my notes app.
It's fully functional, except for the alpha/opacity slider. After that's implemented, I'll work on making the UI look nice.
#dev #macOS #Swift #SwiftUI #AppKit
This is currently implemented for image blocks, normal text blocks, and headings - so I still got a few more blocks to work on...
Next task will be getting it to work in list blocks.
I just implemented a very essential feature in the notes app I'm building π
It's now possible to rearrange blocks by moving them up and down. Added two options to the context menu that appears when right-clicking a block: "Move Up" and "Move Down".
#dev #macOS #AppKit #Swift #SwiftUI
Next task: Currently the user must drop directly over a folder to relocate. Instead, dragging over a folderβs contents should highlight the parent folderβs background and allow the user to drop the dragged file or folder to relocate it.
Files and folders can now be relocated by drag and drop.
Would be cool to have an animation that shows the files being moved from one folder to another. Something I could work on in the future...
#dev #macOS #Swift #SwiftUI #AppKit
Also, I have worked on making a small preview overlay that appears when hovering notes. It's not quite done yet. Still need to work on the UI of it, but I think it's pretty nice.
Bookmarks are saved locally on the user's device in a file called `bookmarks.json` located in the hidden folder `.space/`.
I have now finished implementing support for adding and removing note documents as bookmarks.
The user can simply right-click a note and then select the option called 'Bookmark'. #dev #macOS #AppKit #SwiftUI
Code block in notes app
I just finished implementing code blocks in my notes app π #dev #macOS #Swift #AppKit
I finished drafting my t-shirt pattern in CLO3D and got it printed.
Now I need to trace it onto real pattern paper.
In the video, the red borders show the boundaries of each text view. Notice how I'm able to move between them seamlessly, as if it were one continuous editor.
My solution lets the user move the caret smoothly between text views just by using the arrow keys. On top of that, the implementation also supports making text selections across text views.
The user can even copy text from a selection that spans multiple text views.
The problem is that by default #macOS doesn't natively support caret navigation or text selection across multiple text views. This would be a big problem for the user experience in my app, so I had to build a solution!
For the past month or two, I've been working on some pretty complex logic to support caret navigation and text selections across multiple sequential `NSTextView`s in #AppKit.
I need this functionality for my block-based notes app, where each block lives inside its own text view. #dev
Luckily, I figured out a solution based on `INDSequentialTextSelectionManager`.
GitHub repository:
github.com/indragiek/IN...
An example of this is text selection:
The problem with having separate and independent text views is that selecting text across multiple `NSTextView`s is not natively supported.
Though, Iβm not saying that having separate text views is solving all problems, because it does indeed create its own set of problems that must be fixed to ensure a good user experience.
I have tried to combine all block types in a single `NSTextView`, but it gets problematic converting the JSON structure to `NSMutableAttributedString` because the ranges gets screwed up very easily.
Iβm building a block-based notes app.
My idea was to have a separate text view for each block type.
For example, a heading block would have its own text view.
Likewise, a normal paragraph block would also have its own text view.
This article has been really helpful for me to learn how `NSTextView` works:
danielsaidi.com/blog/2022/06...
If you're new to #AppKit and need to build something that requires using text views, I'd recommend giving it a read.
I love that #programming is all about problem solving. Thatβs what makes it so fun. At the same time, it can also be a disadvantage. Sometimes, Iβll run into a bug and spend days trying to solve it. This can be super frustrating π« But then it finally works, and the adrenaline kick feels amazing π
However, now I just found a #GitHub repository that might be a solution:
github.com/indragiek/IN...
It's old and uses Objective-C, but Sonnet 4.5 should be able to help port it to Swift.
This led me to implement a different solution where I used a single `NSTextView` for all blocks rather than separate.
My previous approach for the editing experience in my notes app was using multiple independent `NSTextView`'s.
This caused a problem where I was unable to perform text selection across multiple blocks, since the blocks were in separate `NSTextView`'s.
This is obviously part of learning, but it still sucks when you think what you just made is really good, and then it turns out it has massive flaws because you just didnβt know any better π
For example, with the notes app Iβm building, Iβm making so many assumptions about how things should be done. And Iβve had to redo implementations again and again because I realized my approach was bad.