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
Remove Tab Removal Animation #225
Conversation
|
The default tabs in macOS are animated. We need to find a way to make the tabs more performant rather than removing the animation. Screen.Recording.2022-03-23.at.4.40.28.PM.mov |
|
Ah you're right. I did some experimenting and found that replacing the I also did some digging and found that there may be a memory leak somewhere with highlightr. I think that may be part of where the performance issues are coming from. The tabs themselves are performant (if I remove the editor from the window the tabs move just find), but the editor is taking compute and memory. For now this provides an explicit animation + fade to the tabs and replaces them with a LazyHStack which should scale to tons of tabs easily. Is this okay to add? |
|
Switching tabs should not close one file and open another. Right now it is essentially replacing file contents in the editor every time we switch tabs which could be expensive. We should really be caching our open files so when we switch between tabs we are not having to re-compute syntax highlighting among other things. I think this will ultimately increase performance when switching tabs. We need to make sure the tab behavior is identical to macOS default tabs with precision whatever that means. That includes animation duration and easing. I notice when you close a tab on the end it fades out which I don’t believe macOS tabs do. I’ve seen the entire content view fade in certain scenarios which is not done in macOS either. |
|
@thecoolwinter this PR is falling behind in commits. What do we want to do here? The animation needs to stay but we do need to get a little closer to macOS style tabs in terms of animation. We also need to be able to reorder them (#256). |
|
Closing in favor of #461 |


Description
Removes the default animation when removing tabs from the tab list. By default SwiftUI adds a 0.35 second animation to items, but this makes for an unresponsive and slow tab bar. I've removed the animation by adding an
.animation(nil, value: UUID())to each tab item in theTabBar.swiftfile.Releated Issue
Checklist (for drafts):
Screenshots (if appropriate):
Before (with animation):
https://user-images.githubusercontent.com/35942988/159793534-18dc09ab-7411-4c0b-8997-f01e4ea95726.mov
After (no animation):
https://user-images.githubusercontent.com/35942988/159793576-f1299a64-3bef-4a05-af46-8a270b1b6d35.mov