-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Hide interface #2044
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
base: main
Are you sure you want to change the base?
Hide interface #2044
Conversation
- Hide interface and shortcut will store the interface state and hide it - Show interface will restore the interface state
- When hiding interface it will better be able to handle hidden elements being enabled, and then showing the interface again. - Moved some logic from ViewCommands to CodeEditWindowController, as it seems like a more appropriate place. - Added a bool shouldAnimate to function toggleFirstPanel. This is by default on, and thus using the default animation. When explicitly called with off, the function will not animate.
- Removed need for interfaceHidden bool - Removed need for resetting stored interface state - Added function isInterfaceStillHidden, checking whether "at least" the previous elements are visible again, taking other elements into account - Hidden animation for lastpanel
- If no panels are active, and interface hasn't been hidden, all panels will show when toggle interface is clicked - Renamed objc functions with prefix 'objc' - Re-added resetStoredInterfaceCollapseState - turns out it was necessary
- Added command "open.drawer.no.animation" to command manager. This will toggle the utility area, without an animation. - Added option possibility of no animation to SplitViewItem.Update - Added struct SplitViewItemCanAnimateViewTraitKey and function splitViewCanAnimate to SplitViewModifiers. These optionally allow disabling animations for SplitViews. - Updated "Hide Interface", WorkspaceView and UtilityAreaViewModel to accommodate these changes
- The logic for hide interface has been moved to a new file, CodeEditWindowsController+Panels. - The function for toggling first panel and last panel has also been moved to said file. - The logic for hide interface is now much more simplified, dynamic and easier to maintain.
- In isInterfaceStillHidden(), resetStoredInterfaceCollapseState() will now be called asynchronously to avoid a SwiftUI update warning
Beautiful! Nice work! I look forward to reviewing your implementation. It’s definitely a feature I’ve been wanting to do for a while now and haven’t got around to. I’m glad you were able to knock it out. It does look like we have a failed test, take a look when you get a chance. @CodeEditApp/maintainers I wonder if we can default hide interface to true in single file mode and open it as a n empty workspace so users can open a folder, add tabs, etc similar to other editors. Any thoughts around this? |
- Removed a comma that was causing the "Testing CodeEdit" task to fail
I took a look at the failed test, and resolved the issue. I also added some UI tests. They are a bit lengthy, but they cover the logic the different conditions the hide interface button might encounter. I'd appreciate feedback on these, specifically their format, or if there is a better approach you'd recommend. Please note that there is no single "hide interface" bool. This functionality depends on saving the state of the panels, hiding them all, and then using the stored states to restore. The logic required for defaulting to hiding the interface in single file mode is therefore not covered by this PR as is - that would likely require hiding the panels individually. |
Description
A "Hide interface" button within view settings has been added. To facilitate this, multiple changes have been made:
The behavior of the hide interface button differs, depending on the current state of the interface, as per the description of the issue. The button will switch between hiding and showing the interface.
When showing:
When hiding:
When individual interface elements are toggled, the button will also update. If all elements are manually enabled, the button will change back to "Hide interface".
Related Issues
Checklist
Screenshots
Screen.Recording.2025-05-13.at.23.17.12.mov