Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3e0177b
Initial plan
Copilot Oct 25, 2025
09c4dd1
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 25, 2025
eb10cff
Add comprehensive terminology proposal for Application.Top/Toplevel r…
Copilot Oct 25, 2025
99c0b73
Add terminology proposal summary document
Copilot Oct 25, 2025
52945aa
Add before/after comparison document for terminology proposal
Copilot Oct 25, 2025
abc760e
Add index document for terminology proposal
Copilot Oct 25, 2025
896f6d7
Add Mermaid diagrams visualizing the terminology proposal
Copilot Oct 25, 2025
9fcc1ca
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 25, 2025
03ad037
Move terminology docs to docfx/docs per CONTRIBUTING.md guidelines
Copilot Oct 25, 2025
9529569
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 26, 2025
9cce64a
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 26, 2025
b509183
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 26, 2025
788a72b
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 26, 2025
bd9c450
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 26, 2025
bc75bd9
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 26, 2025
901d081
Update terminology proposal to reflect recent modernization (post-Mai…
Copilot Oct 26, 2025
9748232
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Oct 28, 2025
de9d547
Update terminology proposal - validate against recent driver refactor…
Copilot Oct 28, 2025
deb09cc
Merge branch 'v2_develop' into copilot/rename-application-top-property
Copilot Nov 12, 2025
af49362
Update proposal after massive v2_develop modernization - TopLevels no…
Copilot Nov 12, 2025
b440881
Update proposal: RunStack → SessionStack to align with SessionToken t…
Copilot Nov 12, 2025
06d010c
Phase 1: Core API rename - Application.Top→Current, TopLevels→Session…
Copilot Nov 12, 2025
f17af9d
Phase 2: Fix test compilation errors for renamed properties
Copilot Nov 12, 2025
b1c056d
Phase 3: Update documentation files with new terminology
Copilot Nov 12, 2025
3e22309
Refactor generic type names and remove unused field
tig Nov 12, 2025
938ea87
Increase minimum code coverage target to 75%
tig Nov 12, 2025
eeffae7
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Nov 12, 2025
55d3213
Merge branch 'v2_develop' into copilot/rename-application-top-property
tig Nov 12, 2025
ae5817f
Add comprehensive unit tests for ApplicationImpl Begin/End logic
Copilot Nov 16, 2025
e5d994c
Refactor ApplicationImplBeginEndTests to work with ApplicationImpl in…
Copilot Nov 16, 2025
429bfbf
Fix ApplicationImplBeginEndTests: Remove explicit ResetState calls, r…
Copilot Nov 16, 2025
439e161
Phase 1: Enable nullable by default, add directives to all files
Copilot Nov 16, 2025
06bd50d
Phase 2: Remove nullable disable from all non-View files - COMPLETE!
Copilot Nov 16, 2025
81cc071
WIP: fixing nullability issues.
tig Nov 16, 2025
1ac80eb
Fixed final nullability issues.
tig Nov 16, 2025
3e72e53
Moved Arrangment tests
tig Nov 16, 2025
8ebcc47
Refactor and improve modularity across multiple classes
tig Nov 16, 2025
a418431
Refactor to make IDriver dependency explicit
tig Nov 16, 2025
acfcce8
WIP: Started migrating to View.App
tig Nov 16, 2025
165c390
WIP: Next set of View.App changes
tig Nov 17, 2025
eab0ea4
Adds View clip tests.
tig Nov 17, 2025
d7f5603
Merged
tig Nov 17, 2025
23a1c9c
Merged
tig Nov 17, 2025
fec8014
wip
tig Nov 17, 2025
a5a6882
Fixed test bug.
tig Nov 17, 2025
db737f9
Refactored Thickness.Draw to require driver.
tig Nov 17, 2025
7e13393
Made TextFormatter.Draw require driver.
tig Nov 17, 2025
bc48545
Code cleanup.
tig Nov 17, 2025
0a43202
Un did stoopid idea.
tig Nov 17, 2025
e25e04f
Decouped Application.Navigation
tig Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/CommunityToolkitExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private static void Main (string [] args)
Services = ConfigureServices ();
Application.Init ();
Application.Run (Services.GetRequiredService<LoginView> ());
Application.Top?.Dispose ();
Application.Current?.Dispose ();
Application.Shutdown ();
}

Expand Down
2 changes: 1 addition & 1 deletion Examples/ReactiveExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ private static void Main (string [] args)
RxApp.MainThreadScheduler = TerminalScheduler.Default;
RxApp.TaskpoolScheduler = TaskPoolScheduler.Default;
Application.Run (new LoginView (new LoginViewModel ()));
Application.Top.Dispose ();
Application.Current.Dispose ();
Application.Shutdown ();
}
}
4 changes: 2 additions & 2 deletions Examples/UICatalog/Scenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void OnApplicationOnIteration (object? s, IterationEventArgs a)

private void OnApplicationSessionBegun (object? sender, SessionTokenEventArgs e)
{
SubscribeAllSubViews (Application.Top!);
SubscribeAllSubViews (Application.Current!);

_demoKeys = GetDemoKeyStrokes ();

Expand All @@ -241,7 +241,7 @@ private void OnApplicationSessionBegun (object? sender, SessionTokenEventArgs e)

return;

// Get a list of all subviews under Application.Top (and their subviews, etc.)
// Get a list of all subviews under Application.Current (and their subviews, etc.)
// and subscribe to their DrawComplete event
void SubscribeAllSubViews (View view)
{
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/AllViewsTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class AllViewsTester : Scenario

public override void Main ()
{
// Don't create a sub-win (Scenario.Win); just use Application.Top
// Don't create a sub-win (Scenario.Win); just use Application.Current
Application.Init ();

var app = new Window
Expand Down
16 changes: 8 additions & 8 deletions Examples/UICatalog/Scenarios/Bars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override void Main ()
// QuitKey and it only sticks if changed after init
private void App_Loaded (object sender, EventArgs e)
{
Application.Top!.Title = GetQuitKeyAndName ();
Application.Current!.Title = GetQuitKeyAndName ();

ObservableCollection<string> eventSource = new ();
ListView eventLog = new ListView ()
Expand All @@ -41,7 +41,7 @@ private void App_Loaded (object sender, EventArgs e)
Source = new ListWrapper<string> (eventSource)
};
eventLog.Border!.Thickness = new (0, 1, 0, 0);
Application.Top.Add (eventLog);
Application.Current.Add (eventLog);

FrameView menuBarLikeExamples = new ()
{
Expand All @@ -51,7 +51,7 @@ private void App_Loaded (object sender, EventArgs e)
Width = Dim.Fill () - Dim.Width (eventLog),
Height = Dim.Percent(33),
};
Application.Top.Add (menuBarLikeExamples);
Application.Current.Add (menuBarLikeExamples);

Label label = new Label ()
{
Expand Down Expand Up @@ -98,7 +98,7 @@ private void App_Loaded (object sender, EventArgs e)
Width = Dim.Fill () - Dim.Width (eventLog),
Height = Dim.Percent (33),
};
Application.Top.Add (menuLikeExamples);
Application.Current.Add (menuLikeExamples);

label = new Label ()
{
Expand Down Expand Up @@ -212,7 +212,7 @@ void MenuLikeExamplesMouseEvent (object _, MouseEventArgs e)
Width = Dim.Width (menuLikeExamples),
Height = Dim.Percent (33),
};
Application.Top.Add (statusBarLikeExamples);
Application.Current.Add (statusBarLikeExamples);

label = new Label ()
{
Expand Down Expand Up @@ -249,7 +249,7 @@ void MenuLikeExamplesMouseEvent (object _, MouseEventArgs e)
ConfigStatusBar (bar);
statusBarLikeExamples.Add (bar);

foreach (FrameView frameView in Application.Top.SubViews.Where (f => f is FrameView)!)
foreach (FrameView frameView in Application.Current.SubViews.Where (f => f is FrameView)!)
{
foreach (Bar barView in frameView.SubViews.Where (b => b is Bar)!)
{
Expand All @@ -269,8 +269,8 @@ void MenuLikeExamplesMouseEvent (object _, MouseEventArgs e)

//private void SetupContentMenu ()
//{
// Application.Top.Add (new Label { Text = "Right Click for Context Menu", X = Pos.Center (), Y = 4 });
// Application.Top.MouseClick += ShowContextMenu;
// Application.Current.Add (new Label { Text = "Right Click for Context Menu", X = Pos.Center (), Y = 4 });
// Application.Current.MouseClick += ShowContextMenu;
//}

//private void ShowContextMenu (object s, MouseEventEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/CombiningMarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public override void Main ()
top.DrawComplete += (s, e) =>
{
// Forces reset _lineColsOffset because we're dealing with direct draw
Application.Top!.SetNeedsDraw ();
Application.Current!.SetNeedsDraw ();

var i = -1;
top.AddStr ("Terminal.Gui only supports combining marks that normalize. See Issue #2616.");
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/ConfigurationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public override void Main ()

void ConfigurationManagerOnApplied (object? sender, ConfigurationManagerEventArgs e)
{
Application.Top?.SetNeedsDraw ();
Application.Current?.SetNeedsDraw ();
}
}
public void Save ()
Expand Down
2 changes: 1 addition & 1 deletion Examples/UICatalog/Scenarios/CsvEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private void Open (string filename)
// Only set the current filename if we successfully loaded the entire file
_currentFile = filename;
_selectedCellTextField.SuperView.Enabled = true;
Application.Top.Title = $"{GetName ()} - {Path.GetFileName (_currentFile)}";
Application.Current.Title = $"{GetName ()} - {Path.GetFileName (_currentFile)}";
}
catch (Exception ex)
{
Expand Down
6 changes: 3 additions & 3 deletions Examples/UICatalog/Scenarios/Mazing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private void TopCommandNotBound (object? sender, CommandEventArgs e)
if (_m.PlayerHp <= 0)
{
_message = "You died!";
Application.Top!.SetNeedsDraw (); // trigger redraw
Application.Current!.SetNeedsDraw (); // trigger redraw
_dead = true;

return; // Stop further action if dead
Expand All @@ -190,7 +190,7 @@ private void TopCommandNotBound (object? sender, CommandEventArgs e)
_message = string.Empty;
}

Application.Top!.SetNeedsDraw (); // trigger redraw
Application.Current!.SetNeedsDraw (); // trigger redraw
}

// Optional win condition:
Expand All @@ -200,7 +200,7 @@ private void TopCommandNotBound (object? sender, CommandEventArgs e)
_m = new (); // Generate a new maze
_m.PlayerHp = hp;
GenerateNpcs ();
Application.Top!.SetNeedsDraw (); // trigger redraw
Application.Current!.SetNeedsDraw (); // trigger redraw
}
}
}
Expand Down
54 changes: 27 additions & 27 deletions Examples/UICatalog/Scenarios/Shortcuts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override void Main ()
private void App_Loaded (object? sender, EventArgs e)
{
Application.QuitKey = Key.F4.WithCtrl;
Application.Top!.Title = GetQuitKeyAndName ();
Application.Current!.Title = GetQuitKeyAndName ();

ObservableCollection<string> eventSource = new ();

Expand All @@ -46,14 +46,14 @@ private void App_Loaded (object? sender, EventArgs e)

eventLog.Width = Dim.Func (
_ => Math.Min (
Application.Top.Viewport.Width / 2,
Application.Current.Viewport.Width / 2,
eventLog?.MaxLength + eventLog!.GetAdornmentsThickness ().Horizontal ?? 0));

eventLog.Width = Dim.Func (
_ => Math.Min (
eventLog.SuperView!.Viewport.Width / 2,
eventLog?.MaxLength + eventLog!.GetAdornmentsThickness ().Horizontal ?? 0));
Application.Top.Add (eventLog);
Application.Current.Add (eventLog);

var alignKeysShortcut = new Shortcut
{
Expand Down Expand Up @@ -86,7 +86,7 @@ private void App_Loaded (object? sender, EventArgs e)
};


Application.Top.Add (alignKeysShortcut);
Application.Current.Add (alignKeysShortcut);

var commandFirstShortcut = new Shortcut
{
Expand Down Expand Up @@ -115,7 +115,7 @@ private void App_Loaded (object? sender, EventArgs e)
$"{commandFirstShortcut.Id}.CommandView.CheckedStateChanging: {cb.Text}");
eventLog.MoveDown ();

IEnumerable<View> toAlign = Application.Top.SubViews.OfType<Shortcut> ();
IEnumerable<View> toAlign = Application.Current.SubViews.OfType<Shortcut> ();
IEnumerable<View> enumerable = toAlign as View [] ?? toAlign.ToArray ();

foreach (View view in enumerable)
Expand All @@ -134,7 +134,7 @@ private void App_Loaded (object? sender, EventArgs e)
}
};

Application.Top.Add (commandFirstShortcut);
Application.Current.Add (commandFirstShortcut);

var canFocusShortcut = new Shortcut
{
Expand All @@ -159,7 +159,7 @@ private void App_Loaded (object? sender, EventArgs e)
SetCanFocus (e.Result == CheckState.Checked);
}
};
Application.Top.Add (canFocusShortcut);
Application.Current.Add (canFocusShortcut);

var appShortcut = new Shortcut
{
Expand All @@ -173,7 +173,7 @@ private void App_Loaded (object? sender, EventArgs e)
BindKeyToApplication = true
};

Application.Top.Add (appShortcut);
Application.Current.Add (appShortcut);

var buttonShortcut = new Shortcut
{
Expand All @@ -193,7 +193,7 @@ private void App_Loaded (object? sender, EventArgs e)
var button = (Button)buttonShortcut.CommandView;
buttonShortcut.Accepting += Button_Clicked;

Application.Top.Add (buttonShortcut);
Application.Current.Add (buttonShortcut);

var optionSelectorShortcut = new Shortcut
{
Expand Down Expand Up @@ -221,7 +221,7 @@ private void App_Loaded (object? sender, EventArgs e)
}
};

Application.Top.Add (optionSelectorShortcut);
Application.Current.Add (optionSelectorShortcut);

var sliderShortcut = new Shortcut
{
Expand All @@ -248,7 +248,7 @@ private void App_Loaded (object? sender, EventArgs e)
eventLog.MoveDown ();
};

Application.Top.Add (sliderShortcut);
Application.Current.Add (sliderShortcut);

ListView listView = new ListView ()
{
Expand All @@ -270,7 +270,7 @@ private void App_Loaded (object? sender, EventArgs e)
Key = Key.F5.WithCtrl,
};

Application.Top.Add (listViewShortcut);
Application.Current.Add (listViewShortcut);

var noCommandShortcut = new Shortcut
{
Expand All @@ -282,7 +282,7 @@ private void App_Loaded (object? sender, EventArgs e)
Key = Key.D0
};

Application.Top.Add (noCommandShortcut);
Application.Current.Add (noCommandShortcut);

var noKeyShortcut = new Shortcut
{
Expand All @@ -295,7 +295,7 @@ private void App_Loaded (object? sender, EventArgs e)
HelpText = "Keyless"
};

Application.Top.Add (noKeyShortcut);
Application.Current.Add (noKeyShortcut);

var noHelpShortcut = new Shortcut
{
Expand All @@ -308,7 +308,7 @@ private void App_Loaded (object? sender, EventArgs e)
HelpText = ""
};

Application.Top.Add (noHelpShortcut);
Application.Current.Add (noHelpShortcut);
noHelpShortcut.SetFocus ();

var framedShortcut = new Shortcut
Expand Down Expand Up @@ -340,7 +340,7 @@ private void App_Loaded (object? sender, EventArgs e)
}

framedShortcut.SchemeName = SchemeManager.SchemesToSchemeName (Schemes.Toplevel);
Application.Top.Add (framedShortcut);
Application.Current.Add (framedShortcut);

// Horizontal
var progressShortcut = new Shortcut
Expand Down Expand Up @@ -387,7 +387,7 @@ private void App_Loaded (object? sender, EventArgs e)
};
timer.Start ();

Application.Top.Add (progressShortcut);
Application.Current.Add (progressShortcut);

var textField = new TextField
{
Expand All @@ -408,7 +408,7 @@ private void App_Loaded (object? sender, EventArgs e)
};
textField.CanFocus = true;

Application.Top.Add (textFieldShortcut);
Application.Current.Add (textFieldShortcut);

var bgColorShortcut = new Shortcut
{
Expand Down Expand Up @@ -450,19 +450,19 @@ private void App_Loaded (object? sender, EventArgs e)
eventSource.Add ($"ColorChanged: {o.GetType ().Name} - {args.Result}");
eventLog.MoveDown ();

Application.Top.SetScheme (
new (Application.Top.GetScheme ())
Application.Current.SetScheme (
new (Application.Current.GetScheme ())
{
Normal = new (
Application.Top!.GetAttributeForRole (VisualRole.Normal).Foreground,
Application.Current!.GetAttributeForRole (VisualRole.Normal).Foreground,
args.Result,
Application.Top!.GetAttributeForRole (VisualRole.Normal).Style)
Application.Current!.GetAttributeForRole (VisualRole.Normal).Style)
});
}
};
bgColorShortcut.CommandView = bgColor;

Application.Top.Add (bgColorShortcut);
Application.Current.Add (bgColorShortcut);

var appQuitShortcut = new Shortcut
{
Expand All @@ -476,9 +476,9 @@ private void App_Loaded (object? sender, EventArgs e)
};
appQuitShortcut.Accepting += (o, args) => { Application.RequestStop (); };

Application.Top.Add (appQuitShortcut);
Application.Current.Add (appQuitShortcut);

foreach (Shortcut shortcut in Application.Top.SubViews.OfType<Shortcut> ())
foreach (Shortcut shortcut in Application.Current.SubViews.OfType<Shortcut> ())
{
shortcut.Selecting += (o, args) =>
{
Expand Down Expand Up @@ -529,7 +529,7 @@ private void App_Loaded (object? sender, EventArgs e)

void SetCanFocus (bool canFocus)
{
foreach (Shortcut peer in Application.Top!.SubViews.OfType<Shortcut> ())
foreach (Shortcut peer in Application.Current!.SubViews.OfType<Shortcut> ())
{
if (peer.CanFocus)
{
Expand All @@ -542,7 +542,7 @@ void AlignKeys (bool align)
{
var max = 0;

IEnumerable<Shortcut> toAlign = Application.Top!.SubViews.OfType<Shortcut> ().Where(s => !s.Y.Has<PosAnchorEnd>(out _)).Cast<Shortcut>();
IEnumerable<Shortcut> toAlign = Application.Current!.SubViews.OfType<Shortcut> ().Where(s => !s.Y.Has<PosAnchorEnd>(out _)).Cast<Shortcut>();
IEnumerable<Shortcut> enumerable = toAlign as Shortcut [] ?? toAlign.ToArray ();

if (align)
Expand Down
4 changes: 2 additions & 2 deletions Examples/UICatalog/Scenarios/SingleBackgroundWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ private void RunWorker ()

var builderUI =
new StagingUIController (_startStaging, e.Result as ObservableCollection<string>);
Toplevel top = Application.Top;
Toplevel top = Application.Current;
top.Visible = false;
Application.Top.Visible = false;
Application.Current.Visible = false;
builderUI.Load ();
builderUI.Dispose ();
top.Visible = true;
Expand Down
Loading
Loading