mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Fixes Wide Glyphs
* Fix some unit tests failure
* Fix more unit tests
* Fixes #4468 - `MouseGrab` regressions (#4469)
* Fixed mouse grab issue
* Fixed mouse grab regrssions.
* Update Terminal.Gui/ViewBase/View.Mouse.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/ViewBase/View.Mouse.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/ViewBase/View.Mouse.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/ViewBase/View.Mouse.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/ViewBase/View.Mouse.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/ViewBase/View.Mouse.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* code cleanup
* Update Terminal.Gui/ViewBase/View.Mouse.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Addressing pr feedback
* updated mouse.md
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fixes #4050. Rename Command.Select and Selecting to Activate/Activating (#4470)
* Initial plan
* Rename Command.Select to Command.Activate and Selecting to Activating
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add Activating event propagation to SuperView
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Update all comments and docs referencing Select to Activate
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix event log messages in examples to use Activating/Activate
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Revert automatic Activating event propagation that broke tests
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Update docfx documentation to use Activate/Activating terminology
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* renames
* Revert "Add Activating event propagation to SuperView"
This reverts commit 6d82bee9ad.
* added command diagrams
* mermaid
* updated level 3
* again
* Select->Activate in MouseTests.cs
* Update Terminal.Gui/Views/Selectors/FlagSelector.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor: Rename Selecting to Activating in View APIs
Renamed the `Selecting` event and `OnSelecting` method to
`Activating` and `OnActivating` to better reflect their purpose.
Updated all related comments, test method names, variables,
and assertions in `View` and `ViewCommandTests` to align with
the new terminology.
Improved code clarity by using `_` for unused parameters in
lambda expressions. Renamed properties like `HandleSelecting`
to `HandleActivating` and adjusted naming conventions for
consistency (e.g., `OnactivatingCount` to `OnActivatingCount`).
These changes enhance readability, maintainability, and
terminology consistency across the codebase.
* Update Terminal.Gui/Views/Selectors/OptionSelector.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Typos
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add support for wide glyphs into the ShadowStyle.Transparent
* The "IsDirty" content of the wide glyphs should be completely false after being displayed on the screen.
* FillRect must always call AddStr method to properly handle wide characters to invalidate overlapped wide glyphs, etc.
* We must set clip to the driver screen in the case where the view isn't Adornment and SuperView is null, allowing dialogs, popovers, etc to be drawn
* These assertions are important to ensure that the drawing state is consistent
* Subviews must be drawn after the superview content being drawn
* The attribute of next column of a wide glyph should be the same if it's in the clipped area
* Applied #4486
* Updated root view clipping logic to use App's screen or a large default rectangle, ensuring proper drawing area. Added comments clarifying subview drawing order and explaining issues with certain Debug.Assert checks in complex hierarchies, suggesting unit tests instead.
* Remove ClearFrame and always draw Margin if Thickness set
Removed the unused ClearFrame method from the View class. Updated DrawAdornments to always draw the Margin when its Thickness is not empty, regardless of ShadowStyle. This simplifies the drawing logic and removes unnecessary checks.
* Fix margin thickness adjustment
* Fix shadow draw on overlapped views
* Only draw shadows at the end of each runnable
* Only call ClearNeedsDraw in the static Draw method
* Replace unit test as requested
* Also use reverse in margins although not making difference
* Fix the ShadowStyle, ShadowWidth and ShadowHeight logic
* Making sure nothing broke.
* ShadowWidth and ShadowHeight always default to 1 at invalid values
* Removes unused parameter
* Using Rune.ReplacementChar to not confusing with space char inserted by the clearing region
* Using Rune.ReplacementChar
* Using Rune.ReplacementChar
* Fix merge error
* Fixing unit tests
* Reverting changes
* Fixing unit tests
* Fix unit test
* Fix shadow on overlapped views
* Cleanup code
---------
Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
UnitTests.Parallelizable
This project contains unit tests that can run in parallel without interference. Tests here must not depend on global state or static Application infrastructure.
Important Notes
- Many tests in
UnitTestsblindly use the the legacy model they don't actually need to - These tests CAN be rewritten to remove unnecessary dependencies and migrated here
- Many tests APPEAR to be integration tests but are just poorly written and cover multiple surface areas - these can be split into focused unit tests
- When in doubt, analyze if the test truly needs global state or can be refactored
Example Migrations
Simple Property Test (no changes needed)
// Before (in UnitTests)
[Fact]
public void Constructor_Sets_Defaults ()
{
var view = new Button ();
Assert.Empty (view.Text);
}
// After (in UnitTests.Parallelizable) - just move it!
[Fact]
public void Constructor_Sets_Defaults ()
{
var view = new Button ();
Assert.Empty (view.Text);
}
Remove Unnecessary [SetupFakeApplication]
// Before (in UnitTests)
[Fact]
[SetupFakeApplication]
public void Event_Fires_When_Property_Changes ()
{
var view = new Button ();
var fired = false;
view.TextChanged += (s, e) => fired = true;
view.Text = "Hello";
Assert.True (fired);
}
// After (in UnitTests.Parallelizable) - remove attribute!
[Fact]
public void Event_Fires_When_Property_Changes ()
{
var view = new Button ();
var fired = false;
view.TextChanged += (s, e) => fired = true;
view.Text = "Hello";
Assert.True (fired);
}
Replace Application.Begin with View Initialization
// Before (in UnitTests)
[Fact]
[AutoInitShutdown]
public void Focus_Test ()
{
var view = new Button ();
var top = new Runnable ();
top.Add (view);
Application.Begin (top);
view.SetFocus ();
Assert.True (view.HasFocus);
top.Dispose ();
}
// After (in UnitTests.Parallelizable) - use BeginInit/EndInit!
[Fact]
public void Focus_Test ()
{
var superView = new View ();
var view = new Button ();
superView.Add (view);
superView.BeginInit ();
superView.EndInit ();
view.SetFocus ();
Assert.True (view.HasFocus);
}
Running Tests
Tests in this project run in parallel automatically. To run them:
dotnet test Tests/UnitTestsParallelizable/UnitTests.Parallelizable.csproj