Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
austincondiff merged 13 commits intoCodeEditApp:mainfromSimonKudsk:hide-interface
May 29, 2025
Merged

Conversation

@SimonKudsk
Copy link
Contributor

@SimonKudskSimonKudsk commentedMay 13, 2025
edited
Loading

Description

A "Hide interface" button within view settings has been added. To facilitate this, multiple changes have been made:

  • Added file "CodeEditWindowController+Panels.swift" with logic for hiding panels
  • Moved logic for toggling first and last panel from CodeEditWindowController.swift to CodeEditWindowController+Panels.swift.
  • Added possibility for SplitViewItems, first panel and last panel to be collapsed without animation
  • Added a specific command for the utility drawer to be opened without animation
  • Added Swift and Objective C specific functions for last panel and first panel toggling
  • Added "previous" variables of panel states within CodeEditWindowController.swift

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:

  • If no panels are open, and no previous values are stored, all panels will open when toggling.
  • If no panels are open, and previous values are stored, the previous panels will open.
  • If some panels are open, and previous values are stored, it will open the remaining panels.

When hiding:

  • Current state of the interface is stored, and all elements are hidden.

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

  • I read and understood thecontributing guide as well as thecode of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2025-05-13.at.23.17.12.mov

lin72h reacted with thumbs up emojithecoolwinter reacted with heart emoji
- 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
@austincondiff
Copy link
Collaborator

austincondiff commentedMay 14, 2025
edited
Loading

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
@SimonKudsk
Copy link
ContributorAuthor

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.

thecoolwinter reacted with thumbs up emoji

Copy link
Collaborator

@thecoolwinterthecoolwinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This looks amazing, just one thought. Thank you for the amazing tests for these changes👍.

Copy link
Collaborator

@thecoolwinterthecoolwinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Awesome work, thank you 👍

Copy link
Collaborator

@austincondiffaustincondiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks great! Nice work

@austincondiffaustincondiff merged commitc0eac3b intoCodeEditApp:mainMay 29, 2025
2 checks passed
@austincondiff
Copy link
Collaborator

@allcontributors add@SimonKudsk for code

@allcontributors
Copy link
Contributor

@austincondiff

I've put upa pull request to add@SimonKudsk! 🎉

@thecoolwinterthecoolwinter added the enhancementNew feature or request labelJul 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@austincondiffaustincondiffaustincondiff approved these changes

@thecoolwinterthecoolwinterthecoolwinter approved these changes

@0xWDG0xWDGAwaiting requested review from 0xWDG

@matthijseikelenboommatthijseikelenboomAwaiting requested review from matthijseikelenboom

@FastestMolassesFastestMolassesAwaiting requested review from FastestMolasses

@tom-ludwigtom-ludwigAwaiting requested review from tom-ludwig

Assignees

No one assigned

Labels

enhancementNew feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@SimonKudsk@austincondiff@thecoolwinter

[8]ページ先頭

©2009-2025 Movatter.jp