* fixed bug
* Refactor DialogTests and add sizing regression tests
- Refactored DialogTests.cs to use concise object and array initializers, improving readability and consistency.
- Added two regression tests to ensure Dialog sizing never exceeds screen/container bounds:
- Dialog_Frame_Clamped_To_Container
- Dialog_Height_Never_Exceeds_Screen_Height
- Updated drawing tests to use indented multiline string literals for expected output.
- Improved test output with additional debug info via ITestOutputHelper.
- Made minor code cleanups (e.g., variable declarations, property immutability).
- No changes to Dialog implementation; all updates are to test code only.
* New workflow that will analyze the dmp file on the macos runner.
* Refactor View props; update docs for new template install
Refactored View.Enabled and View.Visible to use auto-properties
with initial values, removing private backing fields and updating
setters to use 'field'. Updated comments for clarity.
Revised README.md and getting-started.md to use the new
dotnet new install Terminal.Gui.Templates@2.0.0-alpha.* syntax
for template installation and updated sample usage instructions
to match the latest versioning and installation approach.
Refactored View.Enabled and View.Visible to use auto-properties
with initial values, removing private backing fields and updating
setters to use 'field'. Updated comments for clarity.
Revised README.md and getting-started.md to use the new
dotnet new install Terminal.Gui.Templates@2.0.0-alpha.* syntax
for template installation and updated sample usage instructions
to match the latest versioning and installation approach.
* New workflow that will analyze the dmp file on the macos runner.
* Fixes#4629 -
* Update Terminal.Gui/App/Keyboard/KeyboardImpl.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add redraw propagation and arrangement tests, refactor tests
Adds new tests to verify redraw propagation when moving views
and when multiple runnables are stacked, addressing issues
#4623 and #4629. Refactors existing tests in
BorderArrangementTests.cs and NeedsDrawTests.cs for clarity,
resource management, and consistency. Improves object
initialization, assertion messages, and removes unnecessary
code. Ensures redraw logic is robust in complex view
arrangements and improves overall test reliability.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan
* Refactor MouseGrabView to WeakReference - Core implementation complete
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Replace MouseGrabView with IsGrabbed(view) in test files
Updated test files to use the new IsGrabbed(view) method instead of the deprecated MouseGrabView property:
- Assert.Equal(view, mouse.MouseGrabView) → Assert.True(mouse.IsGrabbed(view))
- Assert.Null(mouse.MouseGrabView) → Assert.False(mouse.IsGrabbed(anyView))
- mouse.MouseGrabView == view → mouse.IsGrabbed(view)
- mouse.MouseGrabView != view → !mouse.IsGrabbed(view)
- Updated method names and comments referencing MouseGrabView
Files updated:
- Tests/UnitTests/Application/Mouse/ApplicationMouseTests.cs
- Tests/UnitTestsParallelizable/ViewBase/Mouse/HighlightStatesTests.cs
- Tests/UnitTestsParallelizable/Application/RunTests.cs
- Tests/UnitTestsParallelizable/Application/Runnable/RunnableIntegrationTests.cs
- Tests/UnitTestsParallelizable/Application/ApplicationImplTests.cs
- Tests/UnitTestsParallelizable/Application/InitTests.cs
- Tests/UnitTests/View/Adornment/ShadowStyleTests.cs
- Tests/UnitTests/View/ArrangementTests.cs
- Tests/UnitTests/View/Mouse/MouseTests.cs
All tests pass successfully.
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Complete MouseGrabView refactoring - tests and documentation updated
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix mouse grab enter/leave logic - check grab state first
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Improve null-conditional pattern consistency for IsGrabbed calls
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix code style - use target-typed new() for WeakReference
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Code clean up and org.
* Code cleanup and better docs.
* Add IMouseGrabHandler.IsGrabbed() and related tests
Introduce a new parameterless IsGrabbed() method to IMouseGrabHandler, allowing checks for any active mouse grab regardless of view. Implement this method in MouseImpl, using WeakReference to determine grab state. Add comprehensive unit tests in ApplicationMouseTests and MouseInterfaceTests to verify correct behavior across grab, ungrab, disposal, and state reset scenarios. Also, perform minor code cleanups in MouseInterfaceTests.cs for clarity and consistency.
* 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>
Refactored ListViewWithSelection.cs to enable nullable reference
types, updated field and event handler signatures, and improved
using directives. Cleaned up ComboBox.cs by removing redundant
event handler and clarifying Accepting logic. Improves null
safety, code clarity, and maintainability.
- Clarified and unified ListView selection and marking logic for all four ShowMarks/MarkMultiple combinations (standard, hidden marks, radio button, checkbox).
- Moved command and key/mouse binding setup to new SetupBindingsAndCommands method in ListView.Commands.cs.
- Refactored mouse and keyboard event handling to ensure correct marking/selection behavior for all input types and modes.
- Improved and documented marking methods (MarkUnmarkSelectedItem, MarkAll, UnmarkAll, UnmarkAllButSelected) with clear behavior for each mode.
- Updated and expanded unit tests, including new ListViewTests_Combinations.cs for comprehensive coverage of all combinations and transitions.
- Improved code organization, comments, and documentation throughout for maintainability and clarity.
- Result: more robust, predictable, and testable ListView selection/marking system.
Renamed AllowsMarking → ShowMarks and AllowsMultipleMarking → MarkMultiple for clarity. ShowMarks now controls mark glyph visibility; MarkMultiple controls checkbox vs radio button behavior. Updated all usages, docs, UI, and tests. Refactored drawing logic for all combinations. IListDataSource and related comments updated for new terminology. Improves API clarity and marking flexibility.
Split ListView into partial classes for clarity and maintainability. Improved multi-selection and marking logic, ensuring marks reflect selection state and drawing highlights multi-selected items distinctly. Updated key/mouse bindings for robust multi-selection. No functional changes to IListDataSource or ListWrapper<T> beyond formatting. Sample scenario updated to match new logic.
Introduce AllowXPlusWidthGreaterThanContentWidth, AllowYPlusHeightGreaterThanContentHeight, and AllowLocationPlusSizeGreaterThanContentSize flags to enable viewport overscroll and blank space beyond content. Update clamping logic in View to respect these flags. Refactor ViewportSettingsFlags enum for clarity. Enable overscroll by default in TextView. Update and expand tests to cover new behaviors and ensure backward compatibility.
* New workflow that will analyze the dmp file on the macos runner.
* Add IValue<T> implementation plan document
Documents the plan to standardize IValue<T> interface across all
value-bearing Views, including:
- Non-generic IValue interface for command propagation
- Classification of Views that should/shouldn't implement IValue<T>
- Phased implementation approach
- Testing strategy
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add non-generic IValue interface
Phase 1 of IValue standardization:
- Add IValue interface with GetValue() method for boxed value access
- Update IValue<T> to inherit from IValue
- Add default implementation: IValue.GetValue() => Value
- Add unit tests for GetValue() and polymorphic usage
This enables command propagation to carry values without knowing
the generic type, supporting CommandContext.Value population.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* NumericUpDown implements IValue<T> with CWP events
- NumericUpDown<T> now implements IValue<T>
- Changed events from CancelEventArgs<T>/EventArgs<T> to
ValueChangingEventArgs<T>/ValueChangedEventArgs<T>
- Added virtual OnValueChanging and OnValueChanged methods
- Updated UICatalog scenarios for new event signatures
- Changed .Cancel to .Handled
- Updated event handler type arguments
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Implement IValue on CheckBox, TextField, and SelectorBase
- CheckBox implements IValue with GetValue() returning CheckedState
- TextField implements IValue with GetValue() returning Text
- SelectorBase implements IValue with GetValue() returning Value (int?)
- OptionSelector<TEnum> overrides GetValue() to return typed enum value
- FlagSelector<TFlags> overrides GetValue() to return typed flags value
- Added unit tests for all IValue implementations
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* Implement IValue<T> on remaining value-bearing Views
- ScrollBar: IValue<int> mapping to Position
- DateField: IValue<DateTime?> mapping to Date
- TimeField: IValue<TimeSpan> mapping to Time
- DatePicker: IValue<DateTime> mapping to Date
- ListView: IValue<int?> mapping to SelectedItem
- CharMap: IValue<Rune> mapping to SelectedCodePoint
Also updates ValueChangedEventArgs usage from .Value to .NewValue
across UICatalog scenarios and tests.
Updates ivalue-implementation-plan.md with:
- Completion status for all implementations
- Detailed analysis of LinearRange<T> design challenges
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* cleanup
* revised
* 1. CheckBox - Removed CheckedState, CheckedStateChanging, CheckedStateChanged. Now uses Value, ValueChanging, ValueChanged.
2. ScrollBar - Removed Position, PositionChanging, PositionChanged. Now uses Value, ValueChanging, ValueChanged.
3. DateField - Removed Date, DateChanged. Now uses Value, ValueChanged.
4. TimeField - Removed Time, TimeChanged. Now uses Value, ValueChanged.
5. DatePicker - Removed Date property. Now uses Value.
6. ListView - Removed SelectedItemChanged. Now uses ValueChanged. SelectedItem is kept as a semantic alias for Value.
7. CharMap - Removed SelectedCodePointChanged. Now uses ValueChanged. SelectedCodePoint is kept as a semantic alias for Value.
8. ColorPicker - Removed ColorChanged. Now uses ValueChanged. SelectedColor is kept as a semantic alias for Value.
9. ColorPicker16 - Added IValue<ColorName16> implementation with Value, ValueChanging, ValueChanged.
Files Updated Across Codebase
- Examples: UICatalogRunnable.cs, TimeAndDate.cs, ScrollBarDemo.cs, CharacterMap.cs, Wizards.cs, Scrolling.cs, Themes.cs,
TextInputControls.cs, PromptExample/Program.cs, and many scenario files
- Tests: CheckBoxTests.cs, ScrollBarTests.cs, TimeFieldTests.cs, DateFieldTests.cs, DatePickerTests.cs, IValueTests.cs, and
others
Event Args Changes
- CheckedStateChangingEventArgs → ValueChangingEventArgs<CheckState> with NewValue (not Result)
- CheckedStateChangedEventArgs → ValueChangedEventArgs<CheckState> with NewValue (not Value)
- Similar pattern for all other views
* Code cleanup
* fixed merge issues
* Fixed regression
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Add MarkWidth and EffectiveMaxItemLength helper properties
- Update SetContentSize calls to use EffectiveMaxItemLength which includes
mark columns (2) when AllowsMarking is true
- Update LeftItem clamping to use EffectiveMaxItemLength
- Update AllowsMarking setter to recalculate content size when changed
- Add 2 unit tests for mark width content size behavior
The horizontal scrollbar now correctly appears when viewport width is less
than (MaxItemLength + 2) when marks are enabled.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update LeftItem setter to clamp values to [0, MaxItemLength - Viewport.Width]
instead of throwing ArgumentException for out-of-range values
- Update TopItem setter to clamp values to [0, Count - Viewport.Height]
ensuring scrolling stops when last items are visible
- Add 4 new unit tests for clamping behavior
- Update existing LeftItem_TopItem_Tests to use smaller viewport to properly
test scrolling with the new clamping behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add RenderMark method to IListDataSource interface with default
implementation returning false
- Add virtual RenderMark method to ListWrapper<T> to allow subclass
overrides via standard override keyword
- Update OnDrawingContent to call Source.RenderMark() before default
mark rendering, allowing custom data sources to handle marks
- Add 3 unit tests for RenderMark functionality
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Marks ([x]/[ ]) now render with VisualRole.Normal attribute
- Provides visual clarity by keeping marks consistent across selection states
- Save/restore attribute around mark rendering
- Add 2 new unit tests for mark rendering behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update OnDrawingContent to use VisualRole.Highlight for multi-selected items
- VisualRole.Focus for focused SelectedItem (cursor position)
- VisualRole.Highlight for items in MultiSelectedItems
- VisualRole.Active for SelectedItem without focus
- Update AllowsMultipleSelection setter to clear MultiSelectedItems
- Add 4 new unit tests for rendering behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Shift+Click extends selection from anchor to clicked item
- Ctrl+Click toggles individual items in multi-selection
- Normal click clears multi-selection and selects single item
- Add mouse bindings for modifier combinations (overrides base View)
- Add 5 new unit tests for mouse modifier behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update MoveUp/Down/PageUp/PageDown/Home/End methods with extend parameter
- Add Command.UpExtend, DownExtend, PageUpExtend, PageDownExtend,
StartExtend, EndExtend handlers
- Add Shift+Arrow/Page/Home/End key bindings for extend commands
- Add 12 new unit tests for extend functionality
- Fix existing test to use Ctrl+D instead of Shift+Down (now bound)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added a clear progress tracking table at the top of the plan document
showing all 8 phases with their current status:
- Phase 0: ✅ COMPLETED
- Phase 1: ✅ COMPLETED (already implemented)
- Phases 2-7: ⏳ PENDING
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>