-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Navigation style setting and file history navigation improvements #1603
Navigation style setting and file history navigation improvements #1603
Conversation
Is this issue related to the safe area height? |
I had to modify the safe area height depending on what is in display. CodeEditTextView does not update when the safe area is changed. Also I discovered that the line numbers are hidden in the safe area and need to be visible. @Wouter01 The footnote I mentioned you in was relating to the EditorManager (previously called the TabGroupManager). We need to iterate over all editors to see if any of the editors have temporary tabs. If any do, we need to show the tab bar in all editors when the navigation style is set to open in place. |
The code mentioned with the TODO seems fine to me! It's been some time since I worked on it so I can't tell for sure, but I don't see anything wrong with it immediately |
…across other editors
…ges to open in place, we change the tab to be termporary so that tab bar will hide
This is now ready for review. |
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.
LGTM,
One note, maybe it is better to change
.padding(.horizontal, shouldShowTabBar ? file == nil ? 10 : 4 : 0)
to
.padding(.horizontal, shouldShowTabBar ? (file == nil ? 10 : 4) : 0)
to make it more clear what the ternary operator is doing.
But that's more my personal style preference.
@FastestMolasses and @0xWDG I just pushed both of your suggestions. |
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.
🎉
I have a PR open to fix the related issue on CodeEditSourceEditor here. |
### Description - Refactors a few style functions to correctly update the gutter view's position when the content insets change. - Adds the gutter view position to the content insets test case. ### Related Issues * Required to finish [CodeEdit#1603](CodeEditApp/CodeEdit#1603) ### Checklist - [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md) - [x] The issues this PR addresses are related to each other - [x] My changes generate no new warnings - [x] My code builds and runs on my machine - [x] My changes are all related to the related issue above - [x] I documented my code ### Screenshots N/A
@thecoolwinter merged now. Do you want to create a new release of CESE and I can add the new version in this branch? |
…for a teb that was previously closed, we now open it as a temporary tab
@austincondiff thanks for the approval on CESE, I made a release for that package if you update to 0.7.2 it should work correctly. |
Please note the following additions:
|
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.
Some UX stuff and looks like @matthijseikelenboom comment wasn't resolved.
CodeEdit/Features/Editor/TabBar/Views/EditorTabBarTrailingAccessories.swift
Show resolved
Hide resolved
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.
I see it's already merged, but still
@@ -61,10 +72,21 @@ class EditorManager: ObservableObject { | |||
|
|||
/// Flattens the splitviews. | |||
func flatten() { |
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.
Calling this function "flatten" is a bit weird. editorManager.flatten()
kind of reads like this function flattens the manager
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.
Probably should be flattenEditors. I did not write this. We can go in and change this later.
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.
Come to think of it, we might even consider other words like join, combine, or merge. (VS Code uses join)
…deEditApp#1603) * Added navigation style setting * Added navigation style setting * If one editors tab bar should be shown, all tab bars should be shown across other editors * Removed complete TODO comment * When there is only one tab in an editor and the navigation style changes to open in place, we change the tab to be termporary so that tab bar will hide * Invalidating flattenedEditors cache when editors change. * New editors open first tab as a temporary tab. * History improvements - if going back or forward in history to a file for a teb that was previously closed, we now open it as a temporary tab * Update CodeEditSourceEditor dependency version * Invalidating flattenedEditors cache when closing an editor * Removing last change * Fixed PR issue.
Description
The new Navigation Style setting allows users to open a single file instead of multiple files in an editor. When this is set, the tab bar is hidden when there is only a single temporary tab.
When splitting an editor, the new editors only tab (copied from the previous editor) will now be a temporary tab (previously not temporary). This is so that when using a "open in place" navigation style, the tabs will remain hidden when splitting an editor.
If going back or forward in history to a file for a tab that was previously closed, we now open it as a temporary tab. Again this will prevent the tab bar from unnecessarily showing up in certain edge-cases.
We are also now invalidating history when opening file with project navigator so user cannot go forward.
Related Issues
Checklist
Screenshots
Screen.Recording.2024-03-05.at.9.23.14.AM.mp4
Footnotes
CodeEditTextView will need work to fix a bug revealed by this work, see below video (@thecoolwinter)
https://github.com/CodeEditApp/CodeEdit/assets/806104/f1a57323-98a7-4bdb-baaa-aa39ddf4e166 ↩
I might need to iterate over all editor splits to determine this. See TODO in code. (@Wouter01 any ideas?) ↩