mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
4145b984ba58ada333a91a2e3373047eeec9b388
25 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4145b984ba |
Fixes #2485 ++ - Wizard v2 architecture modernization with Padding-based layout (#4510)
* Initial plan * Fix Wizard v2 architecture issues - ScrollBar API, event handlers, key bindings Co-authored-by: tig <585482+tig@users.noreply.github.com> * Implement issue #4155 - Put nav buttons in bottom Padding, Help in right Padding Co-authored-by: tig <585482+tig@users.noreply.github.com> * Address code review feedback - Extract helper method, improve null checks Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix disposal issue - Ensure _helpTextView is always disposed Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor & improvements. WIP * Tweaking layout * Wizard tweaks * Added View.GetSubViews that optinoally gets subviews of adornments * Refactor Wizard API: modern events, layout, and design - Replaced custom event args with standard .NET event args (CancelEventArgs, ValueChangingEventArgs, etc.) - Removed Finished event; use Accepting for wizard completion - Updated Cancelled, MovingBack, MovingNext to use CancelEventArgs - Refactored UICatalog scenarios and tests to new event model - Improved WizardStep sizing and wizard auto-resizing to content - Enhanced IDesignable for Wizard and WizardStep with richer design-time UI - Simplified help text padding logic in WizardStep - Removed obsolete code and modernized code style throughout - Improves API consistency, usability, and .NET idiomatic usage * Fixes #4515 - Navigating into and out of Adornments does not work * WIP. QUite broken. * All fixed? * Tweaks. * Exclude Margin subviews from drawing; add shadow tests Update Margin adornment to skip drawing subviews that are themselves Margin views, preventing unsupported nested Margin rendering. Add unit tests to verify that opaque-shadowed buttons in Margin are not drawn, while Border and Padding still support shadow rendering. Update test class to use output helper and assert driver output. * Final code cleanup and test improvements. * Update Margin.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update View.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update View.Hierarchy.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update View.Hierarchy.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Refactor: code style, formatting, and minor logic cleanup - Standardized spacing and formatting for method signatures and object initializations. - Converted simple methods and properties to expression-bodied members for conciseness. - Replaced named arguments with positional arguments for consistency. - Improved XML documentation formatting for readability. - Simplified logic in event handlers (e.g., Wizard Back button). - Removed redundant checks where properties are guaranteed to exist. - Fixed minor bugs related to padding, height calculation, and event handling. - Adopted consistent use of `var` for local variables. - Corrected namespace declarations. - Refactored methods returning constants to use expression-bodied syntax. - General code cleanup for clarity and maintainability; no breaking changes. * api docs --------- 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> |
||
|
|
8f4ad8a7d4 |
Fixes #4147. HotKeySpecifier 0xFFFF does not clear HotKey (#4508)
* Initial plan * Fix: Set HotKey to Key.Empty when HotKeySpecifier is 0xFFFF Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix code style: Use explicit type instead of var for View Co-authored-by: tig <585482+tig@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> |
||
|
|
f4b10511c0 |
Fixes #4495 - Adds SuperViewChanging event to View following Cancellable Work Pattern (#4503)
* Initial plan * Add SuperViewChanging event infrastructure and tests Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor SuperViewChanging to follow Cancellable Work Pattern with cancellation support Co-authored-by: tig <585482+tig@users.noreply.github.com> * Remove SuperViewChangingEventArgs class and use CancelEventArgs<View?> directly Co-authored-by: tig <585482+tig@users.noreply.github.com> * Simplified SuperViewChanged * Refactor SuperView change to use CWP and event args Refactored the handling of SuperView changes in the View hierarchy to use the Cancellable Work Pattern (CWP) and standardized event argument types. The SuperView property is now settable only via an internal SetSuperView method, which leverages CWP for property changes and cancellation. - Updated OnSuperViewChanging to accept ValueChangingEventArgs<View?>. - SuperViewChanging event now uses EventHandler<ValueChangingEventArgs<View?>>; cancellation is via e.Handled = true. - OnSuperViewChanged and SuperViewChanged now use ValueChangedEventArgs<View?>. - All SuperView assignments in Add, Remove, and RemoveAll now use SetSuperView, which returns a bool for cancellation. - CWPPropertyHelper.ChangeProperty now accepts a sender parameter, passed to event handlers. - All property changes in View now pass this as sender to ChangeProperty. - Updated event handler signatures and overrides in MenuBar, StatusBar, TextField, and TextView. - Updated unit tests to use new event args and cancellation pattern. - Minor code cleanups and improved comments. These changes modernize and standardize property change handling, improving API consistency, extensibility, and testability. * Refactor subview removal and event arg types Removed redundant index check when removing subviews in View.cs, simplifying the cleanup loop. Updated TextField.OnSuperViewChanged to use a non-nullable ValueChangedEventArgs<View> parameter, enforcing stricter type safety. --------- 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> |
||
|
|
993487d0a1 |
Fixes #4493 - GetViewsUnderLocation does not return subviews of Adornment if Parent has a Subview under Adornment (#4507)
* Initial plan * Add failing test that reproduces GetViewsUnderLocation bug Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix GetViewsUnderLocation to correctly order adornment subviews Co-authored-by: tig <585482+tig@users.noreply.github.com> * Remove debug output from test Co-authored-by: tig <585482+tig@users.noreply.github.com> * Address code review: Extract duplicate coordinate conversion Co-authored-by: tig <585482+tig@users.noreply.github.com> * Code cleanup * code cleanup --------- 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> |
||
|
|
ff18ad4532 |
Fixes build warnings recently introduced (#4506)
* Fixed warnings I recently introduced. Replaced nullable App references with null-forgiving operator (!) in MessageBox and dialog calls to suppress nullable warnings. Updated XML docs to use Dim.Fill() and clarified method references. Made Application.Popover registration null-safe. Fixed test output helper usage in ShadowTests. No functional changes. * Fixes Release build warnings |
||
|
|
1a54ff0872 |
Fixes #4502. Shadows in overlapping views are not rendered consistently (#4465)
* 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
|
||
|
|
0a9f4b8ef1 |
Fixes #4492, #4480 - Transparent shadows cause underlying wide glyph rendering issues (#4490)
* WIP - experiments in fixing shadow rendering issues based on #4465 Previously, shadow size was fixed at 1x1. This change introduces ShadowWidth and ShadowHeight properties to both Margin and View, allowing variable shadow dimensions. The Margin class now manages its own shadow sizing, enforcing valid values based on ShadowStyle (e.g., Opaque and Transparent require a minimum of 1, and Opaque only allows 1). Margin.Thickness is dynamically adjusted to account for shadow size, with original values preserved and restored as needed. ShadowView rendering is updated to correctly handle wide graphemes (such as emojis) in the shadow area, preventing rendering errors. The View class exposes ShadowWidth and ShadowHeight, synchronizing with Margin. Extensive new unit tests verify correct behavior for shadow sizing, style changes, thickness adjustments, and rendering, including edge cases and visual output. Additional minor bug fixes and refactoring are included, such as proper management of Margin's cached clip region and correcting a loop order bug in ShadowView. The codebase is also modernized with recent C# features. * more merge * added border tests * Experiment... * Incorporated latest wideglyphs * Comment tweaks * Add Adornments and ViewportSettings editors to WideGlyphs Introduce AdornmentsEditor and ViewportSettingsEditor with custom border styles and positioning, enhancing UI editing capabilities. Also update arrangeableViewAtEven to use Color.Black and Color.Green, and adjust a commented border style from Dashed to Dotted. * Fix scenario editors and tweak scenarios. Enhance ShadowStyles with a second shadow window (transparent style) and a button event handler that shows a message box. In WideGlyphs, add AdornmentsEditor and ViewportSettingsEditor for view property editing, apply custom color schemes to arrangeable views, and update superView with a transparent shadow and increased shadow width. These changes improve interactivity and visualization in the demo scenarios. * Fix scenario editors and tweak scenarios. Enhance ShadowStyles with a second shadow window (transparent style) and a button event handler that shows a message box. In WideGlyphs, add AdornmentsEditor and ViewportSettingsEditor for view property editing, apply custom color schemes to arrangeable views, and update superView with a transparent shadow and increased shadow width. These changes improve interactivity and visualization in the demo scenarios. * Make replacement char themeable via Glyphs.ReplacementChar Adds Glyphs.ReplacementChar as a configurable replacement character, replacing all uses of Rune.ReplacementChar. The default is now a space (' ') and can be set via config.json. Updates all rendering, string decoding, and buffer invalidation logic to use the new property, ensuring consistency and themeability. Updates tests and comments accordingly. Also includes minor UI tweaks in WideGlyphs.cs and .DotSettings updates. * merging * merge errors * merged * merged * Refactor shadow properties to Margin; update tests ShadowWidth and ShadowHeight are now managed solely in the Margin class, with related properties and validation logic removed from View. All code and tests now use view.Margin.ShadowWidth/ShadowHeight. Tests and documentation were updated accordingly, and wide glyph handling in test output was improved for consistency. * Simplify ShadowSize; remove it from View as it's infreqnetly used. Make it a Size to reduce API surface area. Replace ShadowWidth/ShadowHeight with a single ShadowSize property (of type Size) in the Margin class and related code. Update all usages, validation logic, and tests to use ShadowSize.Width and ShadowSize.Height. Introduce TryValidateShadowSize for unified validation. Modernize code with C# features and improve clarity and maintainability by treating shadow dimensions as a single unit. * reveted * Fix wide glyph attribute handling for second column Ensure the attribute for the second column of wide glyphs is set correctly when within the clip region, addressing issues #4258 and #4492. Add comprehensive unit tests to verify correct attribute assignment and output rendering, including scenarios with transparent shadows. Remove obsolete test code for clarity. This improves color/style consistency for wide glyphs, especially in overlapping UI situations. * added url |
||
|
|
4c772bd5f3 |
Fixes #4497 - makes replacement char conifgurable (#4498)
* Add Glyphs.ReplacementChar config property
Introduced Glyphs.ReplacementChar to allow overriding the Unicode replacement character, defaulting to a space (' '). Updated both config.json and Glyphs.cs with this property, scoped to ThemeScope and documented as an override for Rune.ReplacementChar.
* Standardize to Glyphs.ReplacementChar for wide char invalidation
Replaced all uses of Rune.ReplacementChar.ToString() with Glyphs.ReplacementChar.ToString() in OutputBufferImpl and related tests. This ensures consistent use of the replacement character when invalidating or overwriting wide characters in the output buffer.
* Add configurable wide glyph replacement chars to OutputBuffer
Allows setting custom replacement characters for wide glyphs that cannot fit in the available space via IOutputBuffer.SetReplacementChars. Updated IDriver to expose GetOutputBuffer. All code paths and tests now use the configurable characters, improving testability and flexibility. Tests now use '①' and '②' for clarity instead of the default replacement character.
* Fixed warnings.
* Update IOutputBuffer.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add tests for wide char clipping edge cases in OutputBuffer
Added three unit tests to OutputBufferWideCharTests.cs to verify and document OutputBufferImpl's behavior when wide (double-width) characters are written at the edges of a clipping region. Tests cover cases where the first or second column of a wide character is outside the clip, as well as when both columns are inside. The tests assert correct use of replacement characters, dirty flags, and column advancement, and document that certain code paths are currently unreachable due to IsValidLocation checks.
* Clarify dead code path with explanatory comments
Added comments to mark a rarely executed code path as dead code, noting it is apparently never called. Referenced the related test scenario AddStr_WideChar_FirstColumnOutsideClip_SecondColumnInside_CurrentBehavior for context. No functional changes were made.
* Remove dead code for wide char partial clip handling
Removed unreachable code that handled the case where the first column of a wide character is outside the clipping region but the second column is inside. This logic was marked as dead code and never called. Now, only the cases where the second column is outside the clip or both columns are in bounds are handled. This simplifies the code and removes unnecessary checks.
* Replaces Glyphs.ReplacementChar with Glyphs.WideGlyphReplacement to clarify its use for clipped wide glyphs. Updates IOutputBuffer to use SetWideGlyphReplacement (single Rune) instead of SetReplacementChars (two Runes). Refactors OutputBufferImpl and all test code to use the new property and method. Removes second-column replacement logic, simplifying the API and improving consistency. Updates comments and test assertions to match the new naming and behavior.
* Update themes in config.json and add new UI Catalog props
Renamed "UI Catalog Theme" to "UI Catalog" and removed the
"Glyphs.ReplacementChar" property. Added several new properties
to the "UI Catalog" theme, including default shadow, highlight
states, button alignment, and separator line style. Also added
"Glyphs.WideGlyphReplacement" to the "Hot Dog Stand" theme.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
||
|
|
84f977937b |
Adds transparent shadow test (#4487)
* Add tests for overlapped view transparent shadow config * Add test for transparent shadow showing background text Added a unit test to verify that overlapped views with transparent shadows allow background text to show through the shadow area. The test checks both right and bottom shadow regions and asserts that the underlying content is visible, ensuring correct rendering behavior. * Add test for transparent shadow in overlapped views Adds Overlapped_View_With_TransparentShadow_Driver_Output_Shows_Background_Text to verify that background text is visible through transparent shadows in overlapped views. The test checks for correct rendering, ANSI color codes, and ensures the shadow area displays the expected background character. * Refactor transparent shadow test for stricter output check Update Overlapped_View_With_TransparentShadow_Driver_Output_Shows_Background_Text to use a smaller screen, dynamic sizing, and new overlapped view text. Replace loose output assertion with strict ANSI output comparison. Make shadow cell coordinate calculation dynamic based on view frame. * Consolidate transparent shadow tests into ShadowStyleTests Moved the transparent shadow driver output test from OverlappedViewTransparentShadowTests to ShadowStyleTests for better organization. Removed the now-redundant OverlappedViewTransparentShadowTests class and updated ShadowStyleTests to support output logging. All transparent shadow rendering tests are now grouped under ShadowStyleTests. |
||
|
|
e7a4df492d |
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
|
||
|
|
b2cf674e0b |
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> |
||
|
|
f548059a27 |
Fixes #4258 - Glyphs drawn at mid-point of wide glyphs don't get drawn with clipping (#4462)
* Enhanced `View.Drawing.cs` with improved comments, a new `DoDrawComplete` method for clip region updates, and clarified terminology. Added detailed remarks for the `OnDrawComplete` method and `DrawComplete` event. Refactored `ViewDrawingClippingTests` to simplify driver setup, use target-typed `new`, and add a new test for wide glyph clipping with bordered subviews. Improved handling of edge cases like empty viewports and nested clips. Added `WideGlyphs.DrawFlow.md` and `ViewDrawingClippingTests.DrawFlow.md` to document the draw flow, clipping behavior, and coordinate systems for both the scenario and the test. Commented out redundant `Driver.Clip` initialization in `ApplicationImpl`. Added a `BUGBUG` comment in `Border` to highlight missing redraw logic for `LineStyle` changes. * Uncomment Driver.Clip initialization in Screen redraw * Fixed it! * Fixes #4258 - Correct wide glyph and border rendering Refactored `OutputBufferImpl.AddStr` to improve handling of wide glyphs: - Wide glyphs now modify only the first column they occupy, leaving the second column untouched. - Removed redundant code that set replacement characters and marked cells as not dirty. - Synchronized cursor updates (`Col` and `Row`) with the buffer lock to prevent race conditions. - Modularized logic with helper methods for better readability and maintainability. Updated `WideGlyphs.cs`: - Removed dashed `BorderStyle` and added border thickness and subview for `arrangeableViewAtEven`. - Removed unused `superView` initialization. Enhanced tests: - Added unit tests to verify correct rendering of borders and content at odd columns overlapping wide glyphs. - Updated existing tests to reflect the new behavior of wide glyph handling. - Introduced `DriverAssert.AssertDriverOutputIs` to validate raw ANSI output. Improved documentation: - Expanded problem description and root cause analysis in `WideGlyphBorderBugFix.md`. - Detailed the fix and its impact, ensuring proper layering of content at any column position. General cleanup: - Removed unused imports and redundant code. - Improved code readability and maintainability. * Code cleanup * Update Tests/UnitTestsParallelizable/ViewBase/Draw/ViewDrawingClippingTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Terminal.Gui/Drivers/OutputBufferImpl.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Tests/UnitTestsParallelizable/ViewBase/Draw/ViewDrawingClippingTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Tests/UnitTestsParallelizable/ViewBase/Draw/ViewDrawingClippingTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fixed test slowness problem * Simplified * Rmoved temp .md files * Refactor I/O handling and improve testability Refactored `InputProcessor` and `Output` access by replacing direct property usage with `GetInputProcessor()` and `GetOutput()` methods to enhance encapsulation. Introduced `GetLastOutput()` and `GetLastBuffer()` methods for better debugging and testability. Centralized `StringBuilder` usage in `OutputBase` implementations to ensure consistency. Improved exception handling with clearer messages. Updated tests to align with the refactored structure and added a new test for wide glyph handling. Enhanced ANSI sequence handling and simplified cursor visibility logic to prevent flickering. Standardized method naming for consistency. Cleaned up redundant code and improved documentation for better developer clarity. * Refactored `NetOutput`, `FakeOutput`, `UnixOutput`, and `WindowsOutput` classes to support access to `Output` and added a `IDriver.GetOutput` to acess the `IOutput`. `IOutput` now has a `GetLastOutput` method. Simplified `DriverAssert` logic and enhanced `DriverTests` with a new test for wide glyph clipping across drivers. Performed general cleanup, including removal of unused code, improved formatting, and adoption of modern C# practices. Added `using System.Diagnostics` in `OutputBufferImpl` for debugging. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
5da7e59aa2 |
Fixes #4456 - Clear MouseGrabView in App.End (#4460)
* Fixed MouseGrabView bug. Added extensive test coverage for `Keyboard`, `Mouse`, `Timeout`, and `Popover` functionalities, including edge cases and concurrent access. Introduced parameterized and data-driven tests to reduce redundancy and improve clarity. Refactored codebase for modularity and maintainability, introducing new namespaces and reorganizing classes. Enhanced `MouseImpl`, `KeyboardImpl`, and `Runnable` implementations with improved event handling, thread safety, and support for the Terminal.Gui Cancellable Work Pattern (CWP). Removed deprecated code and legacy tests, such as `LogarithmicTimeout` and `SmoothAcceleratingTimeout`. Fixed bugs related to mouse grabbing during drag operations and unbalanced `ApplicationImpl.Begin/End` calls. Improved documentation and code readability with modern C# features. * Code cleanup. * Update Tests/UnitTestsParallelizable/Application/Runnable/RunnableIntegrationTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Improve null handling and simplify test setup In `MouseImpl.cs`, added an early `return` after the `UngrabMouse()` call within the `if (view is null)` block to prevent further execution when `view` is `null`, improving null reference handling. In `RunnableIntegrationTests.cs`, removed the initialization of the `IApplication` object (`app`) from the `MultipleRunnables_IndependentResults` test method, simplifying the test setup and focusing on runnable behavior. * Code cleanup * API doc link cleanup --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> |
||
|
|
0270183686 | Fixes #4453. Regression in wide glyph rendering on all drivers (#4458) | ||
|
|
dd12df7fb7 |
Fixes #4176. Removes View.MouseClick (#4450)
* Initial plan * Add comprehensive MouseClick removal analysis Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix code review feedback on analysis document Co-authored-by: tig <585482+tig@users.noreply.github.com> * Add actual line numbers to analysis document Co-authored-by: tig <585482+tig@users.noreply.github.com> * Final polish on analysis document - clarify TextView Co-authored-by: tig <585482+tig@users.noreply.github.com> * Phase 3: Port 6 simple Views from MouseClick to Selecting/MouseBindings Co-authored-by: tig <585482+tig@users.noreply.github.com> * Phase 2: Port 10 Scenarios from MouseClick to Selecting/remove Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update analysis document - Phases 2 & 3 complete Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix failing tests - Button multi-button support and Label focus handling Co-authored-by: tig <585482+tig@users.noreply.github.com> * Phase 4: Port ScrollBar from OnMouseClick to OnSelecting; remove analysis doc Co-authored-by: tig <585482+tig@users.noreply.github.com> * Phase 5: Update/remove tests that explicitly test MouseClick API Co-authored-by: tig <585482+tig@users.noreply.github.com> * Code cleanup * Remove MouseClick event Consolidated mouse event handling by removing the `MouseClick` event and integrating its functionality into the `MouseEvent` event. Simplified `MouseEventArgs` documentation and added support for invoking commands bound to mouse events. Reorganized code by removing `Mouse Pressed Events` and `Mouse Click Events` regions, introducing a new `WhenGrabbed Handlers` region. Updated tests to replace `MouseClick` with `MouseEvent`, adjusted test logic, and improved variable naming for clarity. Removed redundant assertions and unused code related to `MouseClick`. Improved event propagation logic to ensure proper handling of unhandled events. Performed general code cleanup to enhance readability and maintainability. * Updated deep dives. --------- 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> |
||
|
|
7a8b6e4465 |
Fixes #4167. Add Accepted event to View (#4452)
* Initial plan * Add Accepted event to View and remove duplicate implementations Co-authored-by: tig <585482+tig@users.noreply.github.com> * Update RaiseAccepting to call RaiseAccepted and add comprehensive tests Co-authored-by: tig <585482+tig@users.noreply.github.com> * Fix code style violations - use explicit types and target-typed new Co-authored-by: tig <585482+tig@users.noreply.github.com> --------- 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> |
||
|
|
d303943809 |
Fixes #4004 & #4445 - Merge of Application.ForceDriver and Driver.Force16Colors and windows" broken in conhost and cmd (#4448)
* Fixes #4004. Driver "windows" broken in conhost and cmd
* Fix unit tests
* Remove IsVirtualTerminal from IApplication. Add IDriverInternal and IOutputInternal interfaces
* Fix result.IsSupported
* Remove internal interfaces and add them in the implementations classes
* Move Sixel from IApplication to IDriver interface it's a characteristic of the driver
* Only if IOutput is OutputBase then set the internal properties
* Prevents driver windows error on Unix system
* Fix scenario sixel error
* Comment some tests because is keyboard layout dependent and shifted key is needed to produce them (Pt)
* Add 🇵🇹 regional indicators test proving they ca be joined as only one grapheme
* SetConsoleActiveScreenBuffer is already called by the constructor and is only needed once
* Finally fixed non virtual terminal in windows driver
* Add more Sixel unit tests
* Add unit tests for OutputBase class
* Avoid emit escape sequence
* Fix assertion failure in UICatalog
* Let each driver to deal with the Sixel write
* When Shutdown is called by the static Application then the ApplicationImpl.ResetStateStatic should be also called
* Add more OutputBase with Sixel unit tests
* Fix some issues with IsVirtualTerminal and Force16Colors with unit tests improvement
* Add Sixel Detect method unit test
* Make Sixel IsSupported and SupportsTransparency consistent with more unit tests
* Fix namespaces and unit test
* Covering more ApplicationImpl Sixel unit test
* Remove DriverImplProxy because sometimes fails in parallel unit tests
* Fix Init_KeyBindings_Are_Not_Reset unit test failing
* Revert "Fix Init_KeyBindings_Are_Not_Reset unit test failing"
This reverts commit
|
||
|
|
e192b5622d |
Updated the OnDrawingContent method across multiple classes to accept a DrawContext? context parameter, replacing the parameterless version. This change standardizes the drawing API and enables context-aware drawing operations.
The refactor includes: - Modifying method signatures in classes like `AnimationScenario`, `Images`, `DrawingArea`, `AttributeView`, `Snake`, and others. - Removing the parameterless `OnDrawingContent` method from the `View` class. - Updating calls to the base class implementation to pass the `context` parameter. - Adjusting comments and documentation to reflect the new method signature. This change ensures consistency and prepares the codebase for more advanced drawing capabilities. |
||
|
|
3a8de25dce |
Refactored NeedsDraw and SubViewNeedsDraw logic to improve clarity and control over redraw state. Introduced SetSubViewNeedsDrawDownHierarchy for better propagation of redraw flags. Updated Margin and Adornment classes to align with the new redraw management.
Enhanced `View` class drawing logic to ensure proper ordering of margin and subview rendering, and introduced `DoDrawContent` for encapsulated content drawing. Improved comments and documentation for better maintainability. Updated tests to reflect the new redraw management methods. Made minor formatting changes and removed redundant code for consistency and readability. |
||
|
|
96151201f6 |
Fix SubViewNeedsDraw handling and improve test coverage
Refactored `View` class to ensure `SuperView.SubViewNeedsDraw` is managed correctly. Added logic to prevent clearing the flag prematurely when sibling subviews still require drawing. Introduced a new `SubViewNeedsDraw` property with a private setter and added `TODO` comments for potential future improvements, such as making it a computed property. Updated and added tests in `NeedsDrawTests` and `StaticDrawTests` to validate the corrected behavior and prevent regressions. Re-enabled a previously skipped test after fixing the related bug. |
||
|
|
193a5873d1 |
Fixes bugs where unnecessary Draw operations were happening in LayoutAndDraw. In some cases causing everything to always be drawn.
Refactored `NeedsDraw` logic into a modular implementation in `View.NeedsDraw.cs`, introducing methods to manage drawing states more effectively. Updated `Menus.cs` event handlers to include null checks for robustness. Improved margin drawing logic in `Margin.cs` with better performance and debugging assertions. Added comprehensive unit tests in `NeedsDrawTests.cs` and `StaticDrawTests.cs` to validate the new drawing logic, including edge cases and static `View.Draw` behavior. Removed redundant tests from `ViewDrawingFlowTests.cs`. Refactored diagnostic flags handling in `UICatalogRunnable.cs` for clarity. Performed general code cleanup, leveraging modern C# features and improving maintainability. |
||
|
|
6a334bbf2e |
Optimize drawing logic and refine NeedsDraw handling
Improved the drawing system by adding conditions to check `Border.NeedsDraw` and `Padding.NeedsDraw` before drawing their subviews, reducing unnecessary operations. Commented out a brute-force `SetNeedsDraw` call for certain views to enhance performance. Updated the logic for clearing `SubViewNeedsDraw` in `SuperView` to ensure it is only cleared when appropriate, preventing potential issues in the draw system. Marked the test `ClearNeedsDraw_WithSiblings_DoesNotClearSuperViewSubViewNeedsDraw` as skipped, as it is no longer valid due to these changes. |
||
|
|
641a0a599c |
Optimize View drawing logic and update ClearViewport tests
Refactored the `View` class to include a `NeedsDraw` check in multiple drawing methods, improving rendering efficiency. Adjusted `OnDrewText` and `DrewText` event handling for consistency. Removed unused code and redundant tests. Rewrote and reorganized `ClearViewportTests` for clarity and compatibility with the new `NeedsDraw` logic. Added new tests to validate `ClearViewport` behavior under various conditions, including transparent viewports, event cancellations, and content-only clearing. Updated namespaces for better alignment, disabled a noisy `ComboBoxTests` test, and improved code formatting and maintainability across files. |
||
|
|
6049857813 |
Refactor LayoutAndDraw and fix ClearNeedsDraw bugs
Refactored the `LayoutAndDraw` method in `ApplicationImpl.Screen.cs` to improve clarity, naming consistency, and redraw logic. Enhanced handling of the `Driver` object to optimize redraws. Simplified `IterationImpl` in `ApplicationMainLoop.cs` by commenting out redundant checks. Fixed a bug in `SetCursor` to ensure null safety and improve cursor positioning logic. Modified `ClearNeedsDraw` in `View.Drawing.cs` to prevent premature clearing of the `SuperView`'s `SubViewNeedsDraw` flag. Added explanatory comments to clarify the behavior. Introduced new unit tests in `NeedsDrawTests.cs` to verify the correctness of `ClearNeedsDraw`: - Ensured sibling views do not prematurely clear `SuperView`'s flags. - Verified proper clearing of flags for views, adornments, and descendants. Improved test coverage and added detailed comments to document expected behavior. |
||
|
|
a84b2c4896 |
Fixes #4419, #4148, #4408 - Toplevel is GONE - Replaced by Runnable (#4422)
* WIP: Broken
* Got working. Mostly.
* Parllel tests pass
* More progres
* Fixed app tests.
* Mouse
* more progress.
* working on shortcut
* Shortcut accept on ENTER is broken.
* One left...
* More test progress.
* All unit tests pass. Still some issues though.
* tweak
* Fixed Integration Tests
* Fixed UI Catalog
* Tweaking CP to try to find race condition
* Refactor StandardColors and improve ColorPicker logic
Refactored `StandardColors` to use lazy initialization for static fields, improving performance and avoiding static constructor convoy effects. Introduced `NamesValueFactory` and `MapValueFactory` methods for encapsulated initialization logic.
Simplified `GetColorNames` to directly return `_names.Value`. Improved `TryParseColor` by clarifying default value usage and adopting object initializer syntax. Updated `TryNameColor` to use `_argbNameMap.Value`.
Refactored `GetArgb` for better readability. Replaced `MultiStandardColorNameResolver` with `StandardColorsNameResolver` in `ColorPicker`. Commented out `app.Init("Fake")` in `ColorPickerTests` for testing purposes.
Made minor formatting improvements, including updated comments and XML documentation for consistency.
* revert
* Throttle input loop to prevent CPU spinning
Introduce a 20ms delay in the input loop of `InputImpl<TInputRecord>`
to prevent excessive CPU usage when no input is available. Removed
the `DateTime dt = Now();` line and the `while (Peek())` block, which
previously enqueued input records.
This change improves resource management, especially in scenarios
where multiple `ApplicationImpl` instances are created in parallel
tests without calling `Shutdown()`. It prevents thread pool
exhaustion and ensures better performance in such cases.
* Refactor ApplicationImpl to use IDisposable pattern
Implemented the IDisposable pattern in ApplicationImpl to improve resource management. Added `Dispose` and `DisposeCore` methods, and marked the `Shutdown` method as obsolete, encouraging the use of `Dispose` or `using` statements instead. Updated the `IApplication` interface to inherit from IDisposable and added `GetResult` methods for retrieving run session results.
Refactored unit tests to adopt the new lifecycle management approach, replacing legacy `Shutdown` calls with `Dispose` or `using`. Removed fragile and obsolete tests, and re-enabled previously skipped tests after addressing underlying issues.
Updated `FakeApplicationLifecycle` and `SetupFakeApplicationAttribute` to align with the new disposal pattern. Improved documentation and examples to guide users toward modern usage patterns. Maintained backward compatibility for legacy singleton usage.
* Add IDisposable pattern with input loop throttling
- Add IDisposable to IApplication for proper resource cleanup
- Add 20ms throttle to input loop (prevents CPU spinning)
- Add Lazy<T> to StandardColors (eliminates convoy effect)
- Add MainLoopCoordinatorTests suite (5 new tests)
- Add Dispose() calls to all 16 ColorPickerTests
- Mark Application.Shutdown() as [Obsolete]
IApplication now requires Dispose() for cleanup
Performance: 100x CPU reduction, 15x faster disposal, tests complete in <5s
Fixes: Thread leaks, CPU saturation, test hangs in parallel execution
Docs: Updated application.md and newinv2.md with disposal patterns
* Refactor test for input loop throttling clarity
Updated `InputLoop_Throttle_Limits_Poll_Rate` test to improve clarity, reliability, and efficiency:
- Rewrote summary comment to clarify purpose and emphasize the 20ms throttle's role in preventing CPU spinning.
- Replaced `var` with explicit types for better readability.
- Reduced test duration from 1s to 500ms to improve test speed.
- Revised assertions:
- Replaced range-based assertion with upper-bound check to ensure poll count is below 500, avoiding timing sensitivity issues.
- Added assertion to verify the thread ran and was not immediately canceled.
- Added a 2-second timeout to `inputTask.Wait` and verified task completion.
- Improved comments to explain test behavior and reasoning behind changes.
* tweaks
* Fix nullabiltiy stuff.
* runnable fixes
* more nullabe
* More nullability
* warnings gone
* Fixed fluent test failure.
* Refactor ApplicationImpl and update Runnable layout logic
Refactored `ApplicationImpl.Run.cs` for improved readability and
atomicity:
- Combined `if (wasModal)` with `SessionStack?.TryPop` to streamline
logic.
- Simplified restoration of `previousRunnable` by reducing nesting.
- Updated comments for clarity and retained `SetIsModal` call.
Simplified focus-setting logic in `ApplicationImpl.Run.cs` using
pattern matching for `TopRunnableView`.
In `Runnable<TResult>`, added `SetNeedsLayout` after `IsModalChanged`
to ensure layout updates. Removed an unused empty line for cleanup.
Corrected namespace in `GetViewsUnderLocationForRootTests.cs` to
align with test structure.
* Update layout on modal state change
A call to `SetNeedsLayout()` was added to the `OnIsModalChanged`
method in the `Runnable` class. This ensures that the layout
is updated whenever the modal state changes.
* Increase test timeout for inputTask.Wait to 10 seconds
Extended the timeout duration for the `inputTask.Wait` method
from 4 seconds to 10 seconds in `MainLoopCoordinatorTests`.
This change ensures the test has a longer window to complete
under conditions of increased load or slower execution
environments, reducing the likelihood of false test failures.
* Refactor project files and simplify test logic
Removed `<LangVersion>` and `<ImplicitUsings>` properties from
`UnitTests.csproj` and `UnitTests.Parallelizable.csproj` to rely
on default SDK settings and disable implicit global usings.
Simplified the `SizeChanged_Event_Still_Fires_For_Compatibility`
test in `FakeDriverTests` by removing the `screenChangedFired`
variable, its associated event handler, and related assertions.
Also removed obsolete warning suppression directives as they
are no longer needed.
* Reduce UnitTestsParallelizable iterations from 10 to 3
Reduced the number of iterations for the UnitTestsParallelizable
test suite from 10 to 3 to save time and resources while still
exposing concurrency issues. Updated the loop and log messages
to reflect the new iteration count.
* disabled InputLoop_Throttle_Limits_Poll_Rate
* Refactor app lifecycle and improve Runnable API
Refactored `Program.cs` to simplify application lifecycle:
- Modularized app creation, initialization, and disposal.
- Improved result handling and ensured proper resource cleanup.
Re-implemented `Runnable<TResult>` with a cleaner design:
- Retained functionality while improving readability and structure.
- Added XML documentation and followed the Cancellable Work Pattern.
Re-implemented `RunnableWrapper<TView, TResult>`:
- Enabled wrapping any `View` to make it runnable with typed results.
- Added examples and remarks for better developer guidance.
Re-implemented `ViewRunnableExtensions`:
- Provided fluent API for making views runnable with or without results.
- Enhanced documentation with examples for common use cases.
General improvements:
- Enhanced code readability, maintainability, and error handling.
- Replaced redundant code with cleaner, more maintainable versions.
* Modernize codebase for Terminal.Gui and MVVM updates
Refactored `LoginView` to remove redundant `Application.LayoutAndDraw()`
call. Enhanced `LoginViewModel` with new observable properties for
automatic property change notifications. Updated `Message` class to use
nullable generics for improved type safety.
Replaced legacy `Application.Init()` and `Application.Run()` calls with
the modern `IApplication` API across `Program.cs`, `Example.cs`, and
`ReactiveExample`. Ensured proper disposal of `IApplication` instances
to prevent resource leaks.
Updated `TerminalScheduler` to integrate with `IApplication` for
invoking actions and managing timeouts. Added null checks and improved
timeout disposal logic for robustness.
Refactored `ExampleWindow` for better readability and alignment with
modern `Terminal.Gui` conventions. Cleaned up unused imports and
improved code clarity across the codebase.
Updated README.md to reflect the latest `Terminal.Gui` practices,
including examples of the `IApplication` API and automatic UI refresh
handling. Renamed `LoginAction` to `LoginActions` for consistency.
* Refactor: Transition to IRunnable-based architecture
Replaced `Toplevel` with `Window` as the primary top-level UI element. Introduced the `IRunnable` interface to modernize the architecture, enabling greater flexibility and testability. Deprecated the static `Application` class in favor of the instance-based `IApplication` model, which supports multiple application contexts.
Updated methods like `Application.Run()` and `Application.RequestStop()` to use `IRunnable`. Removed or replaced legacy `Modal` properties with `IsModal`. Enhanced the `IApplication` interface with a fluent API, including methods like `Run<TRunnable>()` and `GetResult<T>()`.
Refactored tests and examples to align with the new architecture. Updated documentation to reflect the instance-based model. Deprecated obsolete members and methods, including `Application.Current` and `Application.TopRunnable`.
Improved event handling by replacing the `Accept` event with `Accepting` and using `e.Handled` for event processing. Updated threading examples to use `App?.Invoke()` or `app.Invoke()` for UI updates. Cleaned up redundant code and redefined modal behavior for better consistency.
These changes modernize the `Terminal.Gui` library, improving clarity, usability, and maintainability while ensuring backward compatibility where possible.
* Refactor: Replace Toplevel with Runnable class
This commit introduces a major architectural update to the `Terminal.Gui` library, replacing the legacy `Toplevel` class with the new `Runnable` class. The changes span the entire codebase, including core functionality, tests, documentation, and configuration files.
- **Core Class Replacement**:
- Replaced `Toplevel` with `Runnable` as the base class for modal views and session management.
- Updated all references to `Toplevel` in the codebase, including constructors, methods, and properties.
- **Configuration Updates**:
- Updated `tui-config-schema.json` to reflect the new `Runnable` scheme.
- **New Classes**:
- Added `UICatalogRunnable` for managing the UI Catalog application.
- Introduced `Runnable<TResult>` as a generic base class for blocking sessions with result handling.
- **Documentation and Tests**:
- Updated documentation to emphasize `Runnable` and mark `Toplevel` as obsolete.
- Refactored test cases to use `Runnable` and ensure compatibility.
- **Behavioral Improvements**:
- Enhanced lifecycle management and alignment with the `IRunnable` interface.
- Improved clarity and consistency in naming conventions.
These changes modernize the library, improve flexibility, and provide a clearer architecture for developers.
* Refactor: Consolidate Runnable classes and decouple View from ApplicationImpl
- Made Runnable<TResult> inherit from Runnable (eliminating ~180 LOC duplication)
- Moved View init/layout/cursor logic from ApplicationImpl to Runnable lifecycle events
- ApplicationImpl.Begin now operates purely on IRunnable interface
Related to #4419
* Simplified the disposal logic in `ApplicationImpl.Run.cs` by replacing
the type-specific check for `View` with a more general check for
`IDisposable`. This ensures proper disposal of any `IDisposable`
object, improving robustness.
Removed the `FrameworkOwnedRunnable` property from the `ApplicationImpl`
class in `ApplicationImpl.cs` and the `IApplication` interface in
`IApplication.cs`. This eliminates the need to manage this property,
reducing complexity and improving maintainability.
Updated `application.md` to reflect the removal of the
`FrameworkOwnedRunnable` property, ensuring the documentation aligns
with the updated codebase.
* Replaces the legacy `Shutdown()` method with `Dispose()` to align
with the `IDisposable` pattern, ensuring proper resource cleanup
and simplifying the API. The `Dispose()` method is now the
recommended way to release resources, with `using` statements
encouraged for automatic disposal.
Key changes:
- Marked `Shutdown()` as obsolete; it now internally calls `Dispose()`.
- Updated the fluent API to remove `Shutdown()` from chaining.
- Enhanced session lifecycle management for thread safety.
- Updated tests to validate proper disposal and state reset.
- Improved `IRunnable` integration with automatic disposal for
framework-created runnables.
- Maintained backward compatibility for the legacy static
`Application` singleton.
- Refactored documentation and examples to reflect modern practices
and emphasize `Dispose()` usage.
These changes modernize the `Terminal.Gui` lifecycle, improve
testability, and encourage alignment with .NET conventions.
* Refactor runnable app context handling in ApplicationImpl
Refactor how the application context is set for `runnable` objects
by introducing a new `SetApp` method in the `IRunnable` interface.
This replaces the previous logic of directly setting the `App`
property for `View` objects, making the process more generic and
encapsulated within `IRunnable` implementations.
Simplify `Mouse.UngrabMouse()` by removing the conditional check
and calling it unconditionally.
Make a minor formatting adjustment in the generic constraint of
`Run<TRunnable>` in `ApplicationImpl`.
Add `SetApp(IApplication app)` to the `IRunnable` interface and
implement it in the `Runnable` class to set the `App` property
to the provided application instance.
* Improve docs, tests, and modularity across the codebase
Reorganized and updated `CONTRIBUTING.md`:
- Added **Key Architecture Concepts** section and reordered the table of contents.
- Updated testing requirements to discourage legacy patterns.
- Added instructions for replicating CI workflows locally.
- Clarified PR guidelines and coding style expectations.
Enhanced `README.md` with detailed CI/CD workflow documentation.
Refactored `ColorPicker.Prompt` to use `IApplication` for improved modularity and testability.
Introduced `IApplicationScreenChangedTests` for comprehensive testing of `ScreenChanged` events and `Screen` property.
Refactored `ApplicationScreenTests` and `TextView.PromptForColors` to align with modern patterns.
Updated `Terminal.sln` to include `.github/workflows/README.md`.
Performed general cleanup:
- Removed outdated documentation links.
- Improved XML documentation and coding consistency.
* readme tweaks
* Improve thread safety, layout, and test coverage
Refactored `OutputBufferImpl.cs` to enhance thread safety by locking shared resources and adding bounds checks for columns and rows. Improved handling of wide characters and removed outdated TODO comments.
Updated `Runnable.cs` to call `SetNeedsDraw()` on modal state changes, ensuring proper layout and drawing updates. Simplified layout handling in `ApplicationImpl.Run.cs` by replacing redundant comments with a `LayoutAndDraw()` call.
Added a check in `AllViewsTester.cs` to skip creating instances of `RunnableWrapper` types with unsatisfiable generic constraints, logging a warning when encountered.
Enhanced `ListViewTests.cs` by adding explicit `app.LayoutAndDraw()` calls to validate visual output and ensure tests reflect the updated application state.
These changes improve robustness, prevent race conditions, and ensure consistent behavior across the application.
* Refactor: Rename Toplevel to Runnable and update logic
Updated the `Border` class to use `Command.Quit` instead of
`Command.QuitToplevel` in the `CloseButton.Accept` handler.
Renamed test methods in `GetViewsAtLocationTests.cs` to replace
"Toplevel" with "Runnable" for consistency. Updated `Runnable<bool>`
instances to use "topRunnable" as the `Id` property.
These changes align the codebase with updated naming conventions
and improve clarity.
* Removed `ToplevelTests` and migrated relevant test cases to
`MouseDragTests` with improved structure and coverage. Updated
tests to use `Application.Create`, `app.Begin`, and `app.End`
for better resource management and lifecycle handling.
Replaced direct event handling with `app.Mouse.RaiseMouseEvent`
to align with the application's event-handling mechanism. Added
`Runnable` objects to ensure views are properly initialized and
disposed of within the application context.
Enhanced tests to include assertions for minimum width and
height constraints during resize operations. Removed redundant
tests and streamlined logic to reduce duplication and improve
maintainability.
* Reorged Unit Test namespaces.
* more
* Refactor tests and update namespaces for consistency
Updated namespaces in `ArrangementTests.cs` and `MouseDragTests.cs` for better organization. Enhanced `ArrangementTests.cs` with additional checks for arrangement flags. Reformatted and re-added `MouseDragTests.cs` and `SchemeTests.cs` with modern C# features like nullable annotations and object initializers. Ensured no functional changes while improving code clarity and consistency.
* Fix nullability warnings in MouseDragTests.cs
Updated `app.End` calls to use the null-forgiving operator (`!`)
on `app.SessionStack` to ensure it is treated as non-null.
This change addresses potential nullability warnings and
improves code safety and clarity. Applied consistently across
all relevant test cases in the `MouseDragTests` class.
|