Repository navigation
✨ Code Folding #43
Description
Activity
I have been messing around with CoreGraphics a little bit, and it looks like the ribbon is a gray (in light mode), transparent line with a width of 7 (not 6 or 8, which I find strange) and a round cap. They also have a very fine white stroke around the edge. My experiments are not that great and I can't quite get them to play nice with SwiftUI views, but I thought I would leave that basic information here in case it helps.
Reacted by Austin CondiffI have been messing around with CoreGraphics a little bit, and it looks like the ribbon is a gray (in light mode), transparent line with a width of 7 (not 6 or 8, which I find strange) and a round cap. They also have a very fine white stroke around the edge. My experiments are not that great and I can't quite get them to play nice with SwiftUI views, but I thought I would leave that basic information here in case it helps.
Apple likes using odd numbers in everything
I never understood this. I typically like designing in multiples of 2 (2, 4, 8, 12, 16, 20, 24, 32, 40, 48, 56, 64, 72, 80, 96, 104, etc.) because they can always divide into two without falling on a subpixel. This is especially helpful when dealing with responsive layouts and 1x and 2x densities. I think Apple chooses to design in odd numbers so that it can always have a center pixel.
Reacted by Nanashi Li, Gabriel Gutierrez and F1248This may require #127 to be complete in order to begin working on this.
My 5 cents: while this ribbon looks great in XCode... well, it just looks great and brings close to zero value.
What does make life easier and is actually helpful is code blocks indents.Hopefully, this feature won't implement XCodes' direction blindly. 🤞UPD 5 mins later: I was referring to #65

3 remaining items
- added a commit that references this issue
on May 9, 2025 Updated the todo items with the changes in #331. Very close to being done here
- added 2 commits that reference this issue
on Jun 25, 2025 I've been waiting for this feature for a long time, as I often need to open, format, and collapse JSON files. Looking forward to the author's great work.
- added a commit that references this issue
on May 23, 2026
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields🏃♂️ In Progress
Description
Code folding allows developers to collapse and expand sections of code (such as functions, classes, conditionals, and comments) to reduce visual clutter and focus on the parts they’re working on. This feature is particularly useful when navigating large files or deeply nested structures.
Proposed Behavior
Implementation Notes
Benefits
Additional Context
The folding ribbon provides a familiar and discoverable UI for interacting with folded sections and complements keyboard or menu-based folding commands.
Screenshots
Screen.Recording.2022-04-24.at.8.32.40.AM.mov
Additional Screenshots
Hover:

Clicked (folded code):

dark and light mode:

In Progress TODOs