Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 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
899fd76
MASSIVE - Almost completely decoupled Application from View etc...
tig Nov 18, 2025
26204ff
Obsolete
tig Nov 18, 2025
7f53c47
Missed some
tig Nov 18, 2025
38eac49
More cleanup and decoupling.
tig Nov 18, 2025
504779b
Changes before error encountered
Copilot Nov 18, 2025
dedaf52
Update docfx/docs to document View.App architecture and instance-base…
Copilot Nov 18, 2025
c1877d5
Merge branch 'copilot/rename-application-top-property' of https://git…
tig Nov 18, 2025
68aaccc
Add `ToAnsi` support for ANSI escape sequence generation
tig Nov 18, 2025
c36c1de
Improve null safety and cleanup in GuiTestContext
tig Nov 18, 2025
ebe7871
Refactor docs: remove deprecated files, update architecture
tig Nov 18, 2025
93e9d13
Refactor Init/Run methods to simplify driver handling
tig Nov 19, 2025
9697a0b
Refactor: Introduce Application.Create() factory method
tig Nov 19, 2025
5c81189
Added `Application.StopAll` and fixed coupling issues.
tig Nov 19, 2025
ee30693
Refactor: Transition to IApplication interface
tig Nov 19, 2025
61db98a
Enhance null-safety and simplify codebase
tig Nov 19, 2025
0e71edc
Refactor test code to use nullable `App` property
tig Nov 19, 2025
721a9b1
Commented out exception handling in Application.Shutdown
tig Nov 19, 2025
c95694b
Fixes #4394 - Changing Theme at Runtime does not Update Some Properties
tig Nov 19, 2025
927e9d2
Tweaks to config format.
tig Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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 ();
}
}
2 changes: 1 addition & 1 deletion Examples/ReactiveExample/TerminalScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ IDisposable PostOnMainLoop ()
var cancellation = new CancellationDisposable ();

Application.Invoke (
() =>
(_) =>
{
if (!cancellation.Token.IsCancellationRequested)
{
Expand Down
5 changes: 2 additions & 3 deletions Examples/UICatalog/Resources/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"Menu": {
"Normal": {
"Foreground": "Black",
"Background": "WHite"
"Background": "White"
},
"Focus": {
"Foreground": "White",
Expand Down Expand Up @@ -136,17 +136,16 @@
{
"UI Catalog Theme": {
"Window.DefaultShadow": "Transparent",
"Button.DefaultShadow": "None",
"CheckBox.DefaultHighlightStates": "In, Pressed, PressedOutside",
"MessageBox.DefaultButtonAlignment": "Start",
"StatusBar.DefaultSeparatorLineStyle": "Single",
"Dialog.DefaultMinimumWidth": 80,
"MessageBox.DefaultBorderStyle": "Dotted",
"NerdFonts.Enable": false,
"MessageBox.DefaultMinimumWidth": 0,
"Window.DefaultBorderStyle": "Double",
"Dialog.DefaultShadow": "Opaque",
"Dialog.DefaultButtonAlignment": "Start",
"Button.DefaultShadow": "Transparent",
"FrameView.DefaultBorderStyle": "Double",
"MessageBox.DefaultMinimumHeight": 0,
"Button.DefaultHighlightStates": "In, Pressed",
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void OnWinOnInitialized (object? sender, EventArgs args)
{
// When updating from a Thread/Task always use Invoke
Application.Invoke (
() =>
(_) =>
{
_imageView.NextFrame ();
_imageView.SetNeedsDraw ();
Expand Down
119 changes: 61 additions & 58 deletions Examples/UICatalog/Scenarios/AnsiRequestsScenario.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
#nullable enable
using System.Text;

namespace UICatalog.Scenarios;
Expand All @@ -9,16 +7,19 @@ namespace UICatalog.Scenarios;
[ScenarioCategory ("Tests")]
public sealed class AnsiEscapeSequenceRequests : Scenario
{
private GraphView _graphView;
private GraphView? _graphView;

private ScatterSeries _sentSeries;
private ScatterSeries _answeredSeries;
private ScatterSeries? _sentSeries;
private ScatterSeries? _answeredSeries;

private readonly List<DateTime> _sends = new ();

private readonly object _lockAnswers = new object ();
private readonly Dictionary<DateTime, string> _answers = new ();
private Label _lblSummary;
private Label? _lblSummary;

private object? _updateTimeoutToken;
private object? _sendDarTimeoutToken;

public override void Main ()
{
Expand All @@ -32,7 +33,7 @@ public override void Main ()
CanFocus = true
};

Tab single = new Tab ();
Tab single = new ();
single.DisplayText = "Single";
single.View = BuildSingleTab ();

Expand All @@ -57,6 +58,8 @@ public override void Main ()
single.View.Dispose ();
appWindow.Dispose ();

Application.RemoveTimeout (_updateTimeoutToken!);
Application.RemoveTimeout (_sendDarTimeoutToken!);
// Shutdown - Calling Application.Shutdown is required.
Application.Shutdown ();
}
Expand All @@ -70,7 +73,7 @@ private View BuildSingleTab ()
CanFocus = true
};

w.Padding.Thickness = new (1);
w!.Padding!.Thickness = new (1);

var scrRequests = new List<string>
{
Expand Down Expand Up @@ -103,7 +106,7 @@ private View BuildSingleTab ()
}

var selAnsiEscapeSequenceRequestName = scrRequests [cbRequests.SelectedItem];
AnsiEscapeSequence selAnsiEscapeSequenceRequest = null;
AnsiEscapeSequence? selAnsiEscapeSequenceRequest = null;

switch (selAnsiEscapeSequenceRequestName)
{
Expand Down Expand Up @@ -163,12 +166,12 @@ private View BuildSingleTab ()
Value = string.IsNullOrEmpty (tfValue.Text) ? null : tfValue.Text
};

Application.Driver.QueueAnsiRequest (
Application.Driver?.QueueAnsiRequest (
new ()
{
Request = ansiEscapeSequenceRequest.Request,
Terminator = ansiEscapeSequenceRequest.Terminator,
ResponseReceived = (s) => OnSuccess (s, tvResponse, tvError, tvValue, tvTerminator, lblSuccess),
ResponseReceived = (s) => OnSuccess (s!, tvResponse, tvError, tvValue, tvTerminator, lblSuccess),
Abandoned = () => OnFail (tvResponse, tvError, tvValue, tvTerminator, lblSuccess)
});
};
Expand Down Expand Up @@ -218,21 +221,21 @@ private View BuildBulkTab ()
Width = Dim.Fill ()
};

Application.AddTimeout (
TimeSpan.FromMilliseconds (1000),
() =>
{
lock (_lockAnswers)
{
UpdateGraph ();
_updateTimeoutToken = Application.AddTimeout (
TimeSpan.FromMilliseconds (1000),
() =>
{
lock (_lockAnswers)
{
UpdateGraph ();

UpdateResponses ();
}
UpdateResponses ();
}



return true;
});
return true;
});

var tv = new TextView ()
{
Expand Down Expand Up @@ -266,28 +269,28 @@ private View BuildBulkTab ()

int lastSendTime = Environment.TickCount;
object lockObj = new object ();
Application.AddTimeout (
TimeSpan.FromMilliseconds (50),
() =>
{
lock (lockObj)
{
if (cbDar.Value > 0)
{
int interval = 1000 / cbDar.Value; // Calculate the desired interval in milliseconds
int currentTime = Environment.TickCount; // Current system time in milliseconds

// Check if the time elapsed since the last send is greater than the interval
if (currentTime - lastSendTime >= interval)
{
SendDar (); // Send the request
lastSendTime = currentTime; // Update the last send time
}
}
}

return true;
});
_sendDarTimeoutToken = Application.AddTimeout (
TimeSpan.FromMilliseconds (50),
() =>
{
lock (lockObj)
{
if (cbDar.Value > 0)
{
int interval = 1000 / cbDar.Value; // Calculate the desired interval in milliseconds
int currentTime = Environment.TickCount; // Current system time in milliseconds

// Check if the time elapsed since the last send is greater than the interval
if (currentTime - lastSendTime >= interval)
{
SendDar (); // Send the request
lastSendTime = currentTime; // Update the last send time
}
}
}

return true;
});


_graphView = new GraphView ()
Expand Down Expand Up @@ -318,7 +321,7 @@ private View BuildBulkTab ()
}
private void UpdateResponses ()
{
_lblSummary.Text = GetSummary ();
_lblSummary!.Text = GetSummary ();
_lblSummary.SetNeedsDraw ();
}

Expand All @@ -340,8 +343,8 @@ private string GetSummary ()
private void SetupGraph ()
{

_graphView.Series.Add (_sentSeries = new ScatterSeries ());
_graphView.Series.Add (_answeredSeries = new ScatterSeries ());
_graphView!.Series.Add (_sentSeries = new ScatterSeries ());
_graphView!.Series.Add (_answeredSeries = new ScatterSeries ());

_sentSeries.Fill = new GraphCellToRender (new Rune ('.'), new Attribute (ColorName16.BrightGreen, ColorName16.Black));
_answeredSeries.Fill = new GraphCellToRender (new Rune ('.'), new Attribute (ColorName16.BrightRed, ColorName16.Black));
Expand All @@ -358,17 +361,17 @@ private void SetupGraph ()

private void UpdateGraph ()
{
_sentSeries.Points = _sends
_sentSeries!.Points = _sends
.GroupBy (ToSeconds)
.Select (g => new PointF (g.Key, g.Count ()))
.ToList ();

_answeredSeries.Points = _answers.Keys
_answeredSeries!.Points = _answers.Keys
.GroupBy (ToSeconds)
.Select (g => new PointF (g.Key, g.Count ()))
.ToList ();
// _graphView.ScrollOffset = new PointF(,0);
_graphView.SetNeedsDraw ();
_graphView!.SetNeedsDraw ();

}

Expand All @@ -379,13 +382,13 @@ private int ToSeconds (DateTime t)

private void SendDar ()
{
Application.Driver.QueueAnsiRequest (
new ()
{
Request = EscSeqUtils.CSI_SendDeviceAttributes.Request,
Terminator = EscSeqUtils.CSI_SendDeviceAttributes.Terminator,
ResponseReceived = HandleResponse
});
Application.Driver?.QueueAnsiRequest (
new ()
{
Request = EscSeqUtils.CSI_SendDeviceAttributes.Request,
Terminator = EscSeqUtils.CSI_SendDeviceAttributes.Terminator,
ResponseReceived = HandleResponse!
});
_sends.Add (DateTime.Now);
}

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
Loading