Skip to content
This repository was archived by the owner on Jun 24, 2026. It is now read-only.

Commit 1a93320

Browse files
tigCopilot
andcommitted
Remove AllProperties feature
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>
1 parent a5d2f60 commit 1a93320

10 files changed

Lines changed: 156 additions & 283 deletions

File tree

‎docs/OutTableView-Plan.md‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The current OCGV uses `ListView` with a custom `GridViewDataSource` and manual c
5959

6060
**Parameters** — identical to OCGV:
6161
- `InputObject` (ValueFromPipeline)
62-
- `Title`, `OutputMode`, `Filter`, `MinUI`, `ForceDriver`, `AllProperties`
62+
- `Title`, `OutputMode`, `Filter`, `MinUI`, `ForceDriver`
6363

6464
**Key difference from OCGV:** Move data processing from `EndProcessing` into `ProcessRecord`:
6565

@@ -166,12 +166,7 @@ var tableView = new TableView(dataSource)
166166
- Remove frame, filter TextField, and StatusBar (same as OCGV)
167167
- TableView only
168168

169-
#### 2.2 — AllProperties Toggle
170-
- Checkbox in filter bar (Alt+A)
171-
- On toggle: re-run `TypeGetter.CastObjectsToTableView` with `allProperties: true`
172-
- Rebuild columns and data source
173-
174-
#### 2.3 — Keyboard Bindings
169+
#### 2.2 — Keyboard Bindings
175170
Match OCGV behavior:
176171
| Key | Action |
177172
|-----|--------|
@@ -180,10 +175,9 @@ Match OCGV behavior:
180175
| Esc | Cancel, close (return nothing) |
181176
| Ctrl+A | Mark all (Multiple mode) |
182177
| Ctrl+D | Unmark all |
183-
| Alt+A | Toggle AllProperties |
184178
| Up/Down/PgUp/PgDn/Home/End | Navigation (TableView built-in) |
185179

186-
#### 2.4 — Column Width Calculation
180+
#### 2.3 — Column Width Calculation
187181
- Use `ColumnStyle.MinWidth` / `MaxWidth` per column
188182
- Calculate natural widths from first N rows (not all, for streaming perf)
189183
- Recalculate periodically as new rows arrive (or on user request)
@@ -222,8 +216,7 @@ Match OCGV behavior:
222216

223217
### Step 5: Polish
224218
1. MinUI mode
225-
2. AllProperties toggle
226-
3. Column width auto-sizing with periodic recalculation
219+
2. Column width auto-sizing with periodic recalculation
227220
4. ForceDriver support
228221
5. Error handling parity with OCGV
229222

‎src/Microsoft.PowerShell.ConsoleGuiTools/OutConsoleGridviewCmdletCommand.cs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ public class OutConsoleGridViewCmdletCommand : PSCmdlet, IDisposable
7474
public string? ForceDriver { set; get; }
7575

7676
/// <summary>
77-
/// Gets or sets a value indicating whether all properties should be displayed instead of just the default display properties.
77+
/// Gets or sets a value indicating whether the application should run in full-screen mode
78+
/// using the alternate screen buffer. By default, the application renders inline.
7879
/// </summary>
7980
[Parameter(HelpMessage =
80-
"If specified, all properties of the objects will be displayed instead of just the default display properties.")]
81-
public SwitchParameter AllProperties { set; get; }
81+
"If specified, the application runs in full-screen mode using the alternate screen buffer. By default, the application renders inline.")]
82+
public SwitchParameter FullScreen { set; get; }
8283

8384
/// <summary>
8485
/// Gets a value indicating whether the Verbose switch is present.
@@ -170,13 +171,14 @@ protected override void EndProcessing()
170171
Filter = Filter,
171172
MinUI = MinUI,
172173
ForceDriver = ForceDriver,
173-
AllProperties = AllProperties,
174+
FullScreen = FullScreen,
174175
Verbose = Verbose,
175176
Debug = Debug,
176177
ModuleVersion = MyInvocation.MyCommand.Version.ToString()
177178
};
178179

179180
HashSet<int> selectedIndexes = _outConsoleGridView.Run(applicationData);
181+
180182
foreach (var idx in selectedIndexes)
181183
{
182184
var selectedObject = _psObjects[idx];

‎src/Microsoft.PowerShell.ConsoleGuiTools/OutConsoleTableView.cs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public HashSet<int> Run(ApplicationData applicationData)
2727
if (applicationData.PSObjects is { Count: > 0 })
2828
{
2929
var psObjects = applicationData.PSObjects.Cast<PSObject>().ToList();
30-
dataTable = TypeGetter.CastObjectsToTableView(psObjects, applicationData.AllProperties);
30+
dataTable = TypeGetter.CastObjectsToTableView(psObjects);
3131
}
3232
else
3333
{
@@ -38,10 +38,14 @@ public HashSet<int> Run(ApplicationData applicationData)
3838

3939
Terminal.Gui.Configuration.ConfigurationManager.Enable(Terminal.Gui.Configuration.ConfigLocations.All);
4040

41-
using OutTableViewWindow window = new(applicationData, dataSource);
41+
OutTableViewWindow window = new(applicationData, dataSource);
4242
window.OnPipelineComplete(); // All data is available upfront
43-
using IApplication app = Application.Create().Init(driverName: applicationData.ForceDriver);
43+
IApplication app = Application.Create();
44+
app.AppModel = applicationData.FullScreen ? AppModel.FullScreen : AppModel.Inline;
45+
app.Init(driverName: applicationData.ForceDriver);
4446
HashSet<int>? selectedIndexes = app.Run(window) as HashSet<int>;
47+
window.Dispose();
48+
app.Dispose();
4549
return selectedIndexes ?? [];
4650
}
4751

‎src/Microsoft.PowerShell.ConsoleGuiTools/OutConsoleTableViewCmdletCommand.cs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ public class OutConsoleTableViewCmdletCommand : PSCmdlet, IDisposable
7676
public string? ForceDriver { set; get; }
7777

7878
/// <summary>
79-
/// Gets or sets a value indicating whether all properties should be displayed.
79+
/// Gets or sets a value indicating whether the application should run in full-screen mode
80+
/// using the alternate screen buffer. By default, the application renders inline.
8081
/// </summary>
8182
[Parameter(HelpMessage =
82-
"If specified, all properties of the objects will be displayed instead of just the default display properties.")]
83-
public SwitchParameter AllProperties { set; get; }
83+
"If specified, the application runs in full-screen mode using the alternate screen buffer. By default, the application renders inline.")]
84+
public SwitchParameter FullScreen { set; get; }
8485

8586
/// <summary>
8687
/// Gets a value indicating whether the Verbose switch is present.
@@ -167,7 +168,7 @@ protected override void EndProcessing()
167168
Filter = Filter,
168169
MinUI = MinUI,
169170
ForceDriver = ForceDriver,
170-
AllProperties = AllProperties,
171+
FullScreen = FullScreen,
171172
Verbose = Verbose,
172173
Debug = Debug,
173174
ModuleVersion = MyInvocation.MyCommand.Version.ToString()

0 commit comments

Comments
 (0)