WIP: Testing CI#270
Closed
andyleejordan wants to merge 47 commits intomainfrom
Closed
Conversation
WIP: Builds but doesn't run
Refactored `ConsoleGui.cs` to improve modularity, readability, and maintainability. Added dynamic layout handling, improved filtering logic, and enhanced status bar functionality. Simplified data loading and display string updates. Updated `GridViewHelpers.cs` to handle nullable column widths and improve robustness. Replaced `Terminal.Gui` package reference with a local project reference in `Microsoft.PowerShell.ConsoleGuiTools.csproj` to facilitate debugging. Added `<CopyLocalLockFileAssemblies>` for better build handling. Added new launch profiles in `launchSettings.json` for streamlined debugging with preloaded `Out-ConsoleGridView` module. Upgraded Visual Studio version in `GraphicalTools.sln` to 18.3.11206.111.
Enhanced the filtering functionality by introducing `_filterErrorView` to display filter-related errors and updated the `ApplyFilter` method to handle `RegexParseException` gracefully. Adjusted `_header` positioning dynamically based on `_filterErrorView` and ensured `ListView` selection defaults to the first item if none is selected. Refactored `ListViewSource_MarkChanged` to handle null `_inputSource` safely. Simplified `StatusBar` creation and improved `filterErrorView` behavior with `Dim.Auto` for dynamic height and error-specific styling. Updated `launchSettings.json` with new configurations (`OCGV -Filter`, `OCGV`, `OCGV -MinUi`) for better debugging flexibility. Cleaned up redundant code, improved null safety, and adjusted `Window` dimensions for `MinUI` mode.
Refactored `OnWinSubViewLayout` to add null checks for `_header` to ensure safety and prevent runtime exceptions. Simplified "Select All" and "Select None" logic by replacing manual iteration with `_listView?.MarkAll` calls and added comments to address a `Terminal.Gui` bug requiring explicit redraws. Removed default `Ctrl-A` keybinding from `_listView` to allow custom handling in the status bar. Updated `LangVersion` in `Microsoft.PowerShell.ConsoleGuiTools.csproj` to `preview` to enable preview language features. Fixed formatting in the `ProjectReference` element for consistency.
Add SOT launch config and update Esc shortcut description Added a new "SOT" launch configuration in `launchSettings.json` to run the `Show-ObjectTree` command using PowerShell 7-preview. Updated the "Esc" key shortcut description in `ShowObjectView.cs` from `"~ESC~ Close"` to `"Close"` for improved clarity.
Refactored `ConsoleGui` and `ShowObjectView` classes to improve readability, maintainability, and adherence to modern C# conventions. Key changes include: - Updated `FILTER_LABEL` to `_Filter` for UI consistency. - Simplified `ConsoleGui` initialization logic and removed redundant `SetNeedsDraw` call. - Rewrote `ShowObjectView` to use nullable fields, modern syntax, and dynamic regex validation. - Refactored `GetChildren` to handle nested objects with a `while` loop. - Improved `CachedMemberResult` and `CachedMemberResultElement` with better encapsulation and naming conventions. - Enhanced `RegexTreeViewTextFilter` with a primary constructor and better regex error handling. - Simplified `Run` method in `ShowObjectView` for cleaner application lifecycle management. - Fixed typos in comments and replaced redundant comments with concise explanations. - General cleanup using modern C# features like expression-bodied methods, pattern matching, and `null`-coalescing operators.
Refactored namespaces to align with `Microsoft.PowerShell` conventions, replacing `OutGridView.Cmdlet` and `OutGridView.Models`. Updated the module version to `0.9.0` to reflect significant changes. Improved code readability and maintainability by adding XML documentation, enforcing consistent naming conventions, and removing redundant code. Enhanced null safety with nullable annotations and null checks. Refactored key classes (`ConsoleGui`, `GridViewDataSource`, `GridViewDetails`, `GridViewHelpers`, `OutConsoleGridviewCmdletCommand`, `ShowObjectTreeCmdletCommand`, etc.) to simplify logic, improve error handling, and ensure modern C# practices. Updated `launchSettings.json` to rename the `SOT` profile to `SHOT` for consistency with the `Show-ObjectTree` cmdlet. Enhanced serialization logic in `Serializers.cs` and improved type handling in `TypeGetter.cs`. These changes improve the maintainability, safety, and usability of the module while aligning with modern development standards.
Refactored the `ConsoleGui` class into a new class named `OutConsoleGridView` to improve modularity and maintainability. The `ConsoleGui` class was removed, and its functionality was moved to `OutConsoleGridView`, which is now implemented in a separate file (`OutConsoleGridView.cs`). Updated all references to `ConsoleGui` in `OutConsoleGridViewCmdletCommand`: - Replaced `_consoleGui` with `_outConsoleGridView`. - Updated method calls to use `OutConsoleGridView` methods. - Updated the `Dispose` method to dispose of `_outConsoleGridView`. This change reorganizes the codebase for better readability and separation of concerns without introducing any functional changes.
The `Cmdlet` attribute for the `OutConsoleGridViewCmdletCommand` class
was updated to rename the cmdlet from `Out-ConsoleGridView` to
`ConsoleGridView`. This change simplifies the cmdlet name and may align
with a new naming convention.
The alias `[Alias("ocgv")]` remains unchanged, ensuring backward
compatibility for users familiar with the shorthand.
… unit testing. Refactored `OutConsoleGridView` and `ShowObjectTree` for improved maintainability and performance: - Introduced `OutGridViewWindow` and `ShowObjectTreeWindow` to encapsulate UI logic. - Added `CachedMemberResult` and `CachedMemberResultElement` for better object hierarchy handling. - Implemented `RegexTreeViewTextFilter` for regex-based filtering in tree views. Enhanced data handling and UI: - Replaced `DataTable` with direct `PSObjects` handling in `ApplicationData`. - Improved grid view filtering, column width calculations, and status bar shortcuts. - Enhanced tree view to display object hierarchies with filtering and status bar updates. Refactored `TypeGetter`: - Added caching for `FormatViewDefinition` lookups. - Made `CastObjectsToTableView` static for reusability. Updated dependencies and removed legacy code: - Updated `Directory.Packages.props` to use `System.Management.Automation`. - Removed redundant and outdated code from `OutConsoleGridView`. Bug fixes and documentation: - Fixed column width calculation issues and concurrency in `TypeGetter`. - Improved error handling for invalid regex patterns. - Added XML documentation for all new and modified classes.
Added a null check in `GetFormatViewDefinitionForObject` to handle cases where `typeName` is null, returning early if necessary. Introduced a caching mechanism using `_formatCache.TryGetValue` to improve performance by reusing cached format view definitions. Refactored object-to-data-table conversion code for better readability by reformatting inline initializations of `DecimalValue` and `StringValue`. Improved clarity in data type assignment logic by wrapping nested loops in braces and adopting modern C# syntax (`is not`) for type checks.
Updated `GetFormatViewDefinitionForType` to create a runspace with the default initial session state, ensuring proper loading of format data. Removed redundant fallback logic for `Get-FormatData` invocation. Added `Debug.Assert` to validate non-null results. Updated comments to reflect the new behavior. Included `System.Diagnostics` for debugging utilities.
Enhanced object formatting and display logic in the `Out-ConsoleGridView` cmdlet: - Added `GetFormatDataForObjects` to retrieve format data for PowerShell objects. - Updated `EndProcessing` to include format data in `ApplicationData`. - Improved `DataTable` construction to use format data and added dynamic column formatting. - Introduced `IsIdentifierProperty` to handle identifier-specific formatting. - Added `FormatString` and `FormatValue` to `DataTableColumn` for flexible value formatting. - Enhanced `IValue` interface with `OriginalValue` for raw data access. Refactored `TypeGetter` to simplify format data retrieval and object-to-table conversion. Updated `launchSettings.json` to include new profiles and simplify commands. Performed general code cleanup, removed legacy methods, and improved documentation for better maintainability.
Refactored `Render` method in `GridViewDataSource` to improve alignment handling. Enhanced column width management in `OutGridViewWindow` by introducing natural width calculations, truncation safeguards, and scrollbar support. Simplified layout handling with dynamic content size adjustments. Removed deprecated `GetFormatDataForObjects` method and `FormatData` property, transitioning to dynamic column definitions using `TypeGetter`. Improved type handling with caching, ANSI escape sequence stripping, and better fallback logic for primitive types. Updated launch configurations for testing new scenarios. Performed general code cleanup, improving readability, maintainability, and error handling.
Refactored the AddHeaders method to be an inline local function within AddListView, improving modularity and encapsulation. Removed the original AddHeaders implementation and its call from the constructor. The new AddHeaders method is conditionally invoked when _applicationData.MinUI is false. Updated the Y positioning of _listView to use _filterErrorView instead of _filterLabel. Adjusted _listView padding and scrollbar position to integrate the header. Changed MARGIN_LEFT constant from 1 to 0 to refine UI layout.
Add AllProperties toggle to Out-ConsoleGridView cmdlet Introduced a new `AllProperties` parameter to the `Out-ConsoleGridView` cmdlet, allowing users to display all object properties instead of default display properties. Key changes: - Added `AllProperties` as a `SwitchParameter` in `OutConsoleGridViewCmdletCommand`. - Updated `ApplicationData` to store the `AllProperties` state. - Enhanced `OutGridViewWindow` with a `CheckBox` for toggling `AllProperties` and dynamic updates to the grid view and status bar. - Added `ReloadDataWithAllProperties` and `UpdateStatusBar` methods to handle UI updates. - Modified `TypeGetter` to support `AllProperties`, prioritizing format view definitions, default display property sets, and fallback to all properties. - Updated `CastObjectsToTableView` to include an `allProperties` parameter. - Improved compatibility with CIM instances by using the current runspace for format data retrieval. These changes enhance the cmdlet's flexibility and usability, particularly for inspecting all object properties.
Refactored `OutConsoleGridViewCmdletCommand` and `OutGridViewWindow` classes for improved readability, maintainability, and performance. Introduced a new `Header` class for dynamic grid column headers with bold and underlined styles. Simplified logic, removed redundant methods, and optimized nullability handling. Enhanced `TypeGetter` to filter out expensive `PS*` metadata properties, improving performance. Updated `ApplicationData` to clarify `AllProperties` behavior and removed unused imports. Added a new launch configuration in `launchSettings.json` for testing the `-AllProperties` parameter. Improved status bar shortcuts and event handling for better user experience. Updated comments and documentation for consistency.
Updated the assignment of `dataTableColumns` to explicitly convert the result of `typeGetter.GetDataColumnsForObject` into a `List<DataTableColumn>` using `.ToList()`. This change ensures compatibility and enables list-specific operations, improving code clarity and robustness.
- Bump TargetFramework to net10.0 and update SDK to 10.0.101 - Switch NuGet source to nuget.org; comment out PowerShell feed - Replace UseNetDriver with ForceDriver for driver selection - Refactor app startup for Terminal.Gui 2.0 (IApplication, driver API) - Update UI code for Terminal.Gui 2.0: focus, events, property names - Add support for specifying driver (ansi, windows, unix) via cmdlet - Modernize code with C# 12 features and improve nullability - Standardize help text to "TUI" and clean up comments - Update package references and launch settings for debugging
- Replace deprecated ListView properties with ShowMarks/MarkMultiple and update scrollbar config for Terminal.Gui 2.0.0-beta.11. - Add bounds checking to IsMarked; remove Length property in favor of MaxItemLength. - Simplify Enter key handling and ListView.Accepted event logic. - Use Value instead of CheckedState for "All Properties" checkbox. - Update launch profile to use -OutputMode: Single. - Minor: ignore exception variable in TypeGetter.
- Remove GridViewDetails; manage column widths/layout in OutGridViewWindow - Refactor GridViewDataSource: simplify IListDataSource, add viewportX to Render, make MaxItemLength settable - Replace _listViewSource with _filteredSource for clarity; update filtering and event logic - Ensure headers and column widths update with data/filter changes - Remove redundant code and reflection; improve naming and style - Update Header view for clarity; update launchSettings.json debug profiles - Comment out Terminal.Gui package reference for manual management
Eliminated redundant lines setting ShowMarks, MarkMultiple, and CheckBox Value properties to improve code clarity and maintainability.
- Re-enable Central Package Management (Directory.Build.props) - Centralize all package versions in Directory.Packages.props - Update Terminal.Gui to 2.0.0-beta.81 (latest v2 beta) - Restore PowerShellCore_PublicPackages NuGet feed with source mapping - Remove inline Version= from .csproj files (CPM pattern) - Gitignore IDE files (.sln, .vscode/, launchSettings.json) - Add tools/ide/ with tracked IDE templates - Add tools/initDevEnvironment.ps1 to regenerate IDE files after clone Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ps feed access Add RestoreConfigFile condition to Directory.Build.props so that if a nuget.local.config exists it is used instead of nuget.config. This lets contributors without Azure DevOps credentials use nuget.org directly while the team's nuget.config (with the PowerShellCore_PublicPackages feed) remains unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Updated Terminal.Gui to 2.0.0-beta.149 and refactored code to use new PaddingView and Adornment APIs in Header.cs and OutGridViewWindow.cs. Added launchSettings.json with multiple PowerShell launch profiles for easier debugging and testing.
Scaffold test infrastructure for the project: - xUnit test project with 73 tests (66 unit + 7 integration) - Unit tests for DataTableColumn, DataTableRow, Serializers, GridViewHelpers, TypeGetter - Integration tests for OutGridViewWindow using Terminal.Gui's headless ANSI driver and VirtualTimeProvider (Begin/LayoutAndDraw/End pattern) - Pester test file for module-level smoke tests - InternalsVisibleTo on both source projects - Test task in build script and CI workflow
…tig-terminal_gui_v2
New cmdlet that mirrors Out-ConsoleGridView but uses TableView instead of ListView for native column headers, sizing, and horizontal scrolling. Includes spinner status bar indicator, regex filtering, mark/select support, and AllProperties toggle in the status bar. Addresses #209 architecture - streaming pipeline support will be layered on once the cooperative Terminal.Gui run model is available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tig-terminal_gui_v2
Remove the -AllProperties parameter, status bar checkbox toggle, and ReloadDataWithAllProperties logic from both Out-ConsoleGridView and Out-ConsoleTableView. Also removes the allProperties parameter from TypeGetter.CastObjectsToTableView and GetDataColumnsForObject, the AllProperties property from ApplicationData, the -AllProperties launch profiles, and related documentation references. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rename ForceDriver to Driver across all cmdlets and ApplicationData for consistency; update help text - Switch to ProjectReference for Terminal.Gui, update solution and project files for local dev - Refactor MinUI handling and help text; clarify that only title/status bar are hidden, filter shown if specified - Use FrameView.DefaultBorderStyle and modularize filter/status bar logic in OutGridViewWindow, OutTableViewWindow, and ShowObjectTreeWindow - Add FullScreen param to ShowObjectTreeCmdletCommand; set AppModel accordingly in ShowObjectView - Ensure explicit disposal of windows and apps in all entry points - Expose TreeView<T>.GetSize() for accurate sizing - Update launchSettings.json and tests for new Driver param and MinUI usage - Improve null-safety, event handling, and consistency throughout UI code
Delete OutConsoleTableView.cs, OutConsoleTableViewCmdletCommand.cs, OutTableViewWindow.cs, and OutTableViewDataSource.cs. Remove the Out-ConsoleTableView cmdlet and octv alias from the module manifest. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clarified -MinUi parameter descriptions for both cmdlets. Documented new -Driver and -FullScreen parameters for Out-ConsoleGridView and Show-ObjectTree. Updated usage example to use -OutputMode Multiple instead of deprecated -PassThru. Added Show-ObjectTree to project architecture in README.
Switched to Terminal.Gui NuGet package (2.0.0-rc.3) in place of local project reference. Updated GraphicalTools.sln for VS 18, added Solution Items, and set SolutionGuid. Added a local NuGet package source to nuget.config.
The tracked GraphicalTools.sln carried stale ProjectReferences to
local Terminal.Gui sources, breaking CI's `dotnet test` (which was
implicitly resolving the solution). Switch to the modern .slnx format
and track it directly so the solution is reviewable and small.
- Replace GraphicalTools.sln with GraphicalTools.slnx (5-line XML;
lists the 3 real projects, no dead Terminal.Gui ProjectReferences)
- Stop ignoring .slnx and .vscode/; track them
- Remove tools/initDevEnvironment.ps1 and tools/ide/ — no longer
needed; .slnx is small enough to track and VS Code workspace
files are now the supported way to share dev config
- Add .vscode/{launch,tasks,extensions}.json:
* launch.json: single coreclr profile with a pickString input for
selecting one of the OCGV / Show-ObjectTree sample commands
* tasks.json: build (Invoke-Build), test (zero-arg dotnet test
auto-resolves the .slnx), clean
* extensions.json: recommends C# Dev Kit + PowerShell
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
@andyleejordan V2 has been released. Latest ver is <PackageVersion Include="Terminal.Gui" Version="2.0.1" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening a draft here to test CI for tig#3