-
Notifications
You must be signed in to change notification settings - Fork 697
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
Fixes TabView. #3828
Fixes TabView. #3828
Conversation
@tig you have to understand that the |
Have you looked at the re-write I started here It approaches the design very differently. I'd be happy to riff with you on how to finish that. |
Ooops. Never mind that link. I can't find the PR i meant. Hold a sec. |
Here's the reason why we need
|
I have to run now. I'd like to show you the re-write I started to show that there's a completely different way of making TabView work that's much simpler, peformant, and clean. I agree that the containerView is needed for the OLD design. But it is not needed if the design is different. I'll try to clean up my screw up later today. |
If you want to keep trying to fix the existing class, that's fine. However, I'd much rather our joint energy go into a new design. It is not a priority for me to work on this right now, and I'd be more than happy for you to take what I started in #3832 and finish it. If you choose not to, and just hack the current design to work slightly better, then at some point in the future when I have the time/motivation I'll finish the new design. FWIW, the visual and focus issues you are trying to fix are just the tip of the iceberg for problems with the existing code. To illustrate this, note the performance of TabViewExample: |
Yes, yours really faster because I'm using the |
The existing code is mixing layout and draw in a very deep way. It's not as simple as you say. It is a fundamentally broken design (for v2... for v1, it was the best we could do). |
Yes, I agree the existent code in the v2_develop is mixing that but I think you didn't look at my PR to check that it isn't already using layout and draw directly from the |
…Disp-v2_tabview-fix
You're right, I didn't. I just looked at the code. Nice work: |
Apologies for not actually running this before. I had assumed you had seen my PR for a rewrite and thus didn't look at this closely. Then I figured out that I screwed that rewite PR up and it was missing. I'm good with getting this merged asap as it addresses my biggest issues. But I still want to explore a rewrite at some point (not urgent/important!) |
@@ -33,5 +33,7 @@ P P | |||
output | |||
); | |||
TestHelpers.AssertDriverAttributesAre ("0", output, null, view.GetNormalColor ()); | |||
|
|||
((FakeDriver)Application.Driver!).End (); |
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.
What is this for?
This should not be needed???
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.
Yes, because sometimes it causes failure in the With_Subview_Using_PosFunc
unit test. See https://github.com/gui-cs/Terminal.Gui/actions/runs/11903293490/job/33169963032. The reason is a racing condition where the SetupFakeDriver
was resizing the terminal to (5,5) and when the above unit test is running the terminal size isn't what it's expected and corrupt the expected value.
Failed Terminal.Gui.LayoutTests.DimAutoTests.With_Subview_Using_PosFunc [3 ms]
Error Message:
Assert.Equal() Failure: Values differ
Expected: 25
Actual: 20
Stack Trace:
at Terminal.Gui.LayoutTests.DimAutoTests.With_Subview_Using_PosFunc() in /home/runner/work/Terminal.Gui/Terminal.Gui/UnitTests/View/Layout/Dim.AutoTests.PosTypes.cs:line 647
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
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.
[SetupFakeDriver]
has a bug then?
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, I'll take a look on it.
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 think I fixed with fabe34f.
I already set the |
If you press the cursor down on the second |
Before 6cb8478 commit: After: There isn't very big differences but would be great if you add a |
Fixes
Proposed Changes/Todos
Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)