-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Custom(izable) Navigator Sidebar Implementation #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also I think the blue or gray highlight has a blend mode applied. Give me a second and I will find that out for you. |
Here is the list selection background specification (to my best understanding). Light Mode Focused Selection Color
Dark Mode Focused Selection Color
Light Mode Unfocused Selection Color
Dark Mode Unfocused Selection Color
Other considerations
ReferencesTo gather the above information, I referred to Apple's own Sketch design resource. Despite my findings, I am seeing some inconsistency when I apply this in Sketch vs Figma. I have been searching to find if Apple provides a variable to get this exact background but haven't found anything yet. I have posted in the Apple developer forums here to see if anyone else has any insight on this. |
@austincondiff updated the colors & corner radius. also adjusted the spacing to match Xcodes sidebar. |
@lukepistrol can we keep the sidebar named "NavigatorSidebar"? I would like to reference our sidebars by function (navigator, inspector - this is what Xcode calls them) rather than location (leading, trailing). If you have a particular reason why we shouldn't do that I am open to it though! |
Because I think the leading sidebar contains multiple functions(navigator, search...) You can see more here |
I will rename like so:
So that it matches Xcodes description |
…> `ProjectNavigator`, `SidebarSearch` -> `FindNavigator`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outstanding work! One last thing I just noticed, when the window is inactive, the icons go to 50% opacity, at least I believe it is 50%, so do the sidebar dock icons - compare to Xcode.
I think it's more like 45% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic! LGTM
@austincondiff just need your approval then I'll merge |
Oops. Forgot to update them. Spacing still needs to be fixed. |
Description
The main problem of SwiftUI's implemented sidebar is, that it is not very customizable and only brings native selection state when using
NavigationLink
. This has the downside of opening a whole new detail view every time a file is selected from the sidebar.The new Sidebar uses
List
sselection
property to get the current selected file and set the document in the Code EditorThings that need to be fixed:
contextMenu
is shown. (help wanted)Localization ofcontextMenu
corner radius
of selected sidebar item needs to be slightly largerReleated Issue
#123
Checklist (for drafts):
Screenshots:
Screen.Recording.2022-03-24.at.17.24.54.mov