Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 demos/Termina.Demo.Conformance/Pages/ConformancePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override void OnBound()
.WithForeground(Color.Yellow)
.NoWrap();

_input = new TextInputNode()
_input = new TextInputNode(frameProvider: RenderFrameProvider)
.WithPlaceholder("Type here, press Enter to submit. Up/Down should still be keyboard input.")
.WithForeground(Color.Cyan);
}
Expand Down
10 changes: 5 additions & 5 deletions demos/Termina.Demo.Gallery/Pages/AnimationsGalleryPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ private ILayoutNode BuildPreviewArea()
// Create a reactive layout that swaps spinners based on selection
return ViewModel.SelectedStyle
.Select(style => BuildSpinnerPreview(style))
.AsLayout()
.AsLayout(RenderFrameProvider)
.Fill();
}

private static ILayoutNode BuildSpinnerPreview(LayoutSpinnerStyle style)
private ILayoutNode BuildSpinnerPreview(LayoutSpinnerStyle style)
{
var (name, color, _) = GetStyleInfo(style);

Expand All @@ -136,15 +136,15 @@ private static ILayoutNode BuildSpinnerPreview(LayoutSpinnerStyle style)
Layouts.Horizontal()
.WithChild(new TextNode(" ").WidthAuto())
.WithChild(
new SpinnerNode(style, intervalMs: 80)
new SpinnerNode(style, intervalMs: 80, frameProvider: RenderFrameProvider)
.WithSpinnerColor(color))
.Height(1))
.WithChild(new TextNode(" ").Height(1))
.WithChild(
Layouts.Horizontal()
.WithChild(new TextNode(" ").WidthAuto())
.WithChild(
new SpinnerNode(style, intervalMs: 80)
new SpinnerNode(style, intervalMs: 80, frameProvider: RenderFrameProvider)
.WithLabel("Loading...")
.WithSpinnerColor(color)
.WithLabelColor(Color.White))
Expand All @@ -154,7 +154,7 @@ private static ILayoutNode BuildSpinnerPreview(LayoutSpinnerStyle style)
Layouts.Horizontal()
.WithChild(new TextNode(" ").WidthAuto())
.WithChild(
new SpinnerNode(style, intervalMs: 120)
new SpinnerNode(style, intervalMs: 120, frameProvider: RenderFrameProvider)
.WithLabel("Processing request...")
.WithSpinnerColor(color)
.WithLabelColor(Color.Gray))
Expand Down
2 changes: 1 addition & 1 deletion demos/Termina.Demo.Gallery/Pages/ClipboardGalleryPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected override void OnBound()
.WithCopyBindings(new CopyKeyBinding(ConsoleKey.Enter), new CopyKeyBinding(ConsoleKey.C, ConsoleModifiers.Control))
.WithHint("Use Ctrl+A to select all, Enter or Ctrl+C to copy");

_pasteInput = new TextInputNode()
_pasteInput = new TextInputNode(frameProvider: RenderFrameProvider)
.WithPlaceholder("Paste text here with Ctrl+Shift+V or your terminal paste shortcut...");
}

Expand Down
4 changes: 3 additions & 1 deletion demos/Termina.Demo.Gallery/Pages/GraphGalleryPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public override void OnNavigatedTo()
.DisposeWith(Subscriptions);

ViewModel.SelectedStyle
.ObserveOn(RenderFrameProvider)
.Subscribe(style => _demoGraph.WithStyle(style))
.DisposeWith(Subscriptions);

Observable.Interval(TimeSpan.FromMilliseconds(200), TimeProvider.System)
.ObserveOn(RenderFrameProvider)
.Subscribe(_ => PushData())
.DisposeWith(Subscriptions);

Expand Down Expand Up @@ -80,7 +82,7 @@ public override ILayoutNode BuildLayout()

var gradient = Gradient.Create(Color.FromRgb(0, 100, 255), Color.FromRgb(0, 255, 100), Color.FromRgb(255, 255, 0));

_demoGraph = new GraphNode(intervalMs: 0)
_demoGraph = new GraphNode(intervalMs: 0, frameProvider: RenderFrameProvider)
.WithStyle(ViewModel.SelectedStyle.Value)
.WithGradient(gradient)
.WithRange(0, 100);
Expand Down
6 changes: 3 additions & 3 deletions demos/Termina.Demo.Gallery/Pages/TextInputGalleryPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ private void CycleFocus()

public override ILayoutNode BuildLayout()
{
_basicInput = new TextInputNode();
_basicInput = new TextInputNode(frameProvider: RenderFrameProvider);

_placeholderInput = new TextInputNode()
_placeholderInput = new TextInputNode(frameProvider: RenderFrameProvider)
.WithPlaceholder("Type something here...");

_textArea = new TextAreaNode()
_textArea = new TextAreaNode(frameProvider: RenderFrameProvider)
.WithPlaceholder("Enter multi-line text...")
.WithMaxHeight(6);

Expand Down
12 changes: 6 additions & 6 deletions demos/Termina.Demo.Grid/DashboardPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,28 @@ private ILayoutNode BuildMetricsGrid()
new TextNode("CPU:").WithForeground(Color.Gray),
ViewModel.CpuUsage
.Select<int, ILayoutNode>(cpu => BuildProgressBar(cpu, GetMetricColor(cpu)))
.AsLayout());
.AsLayout(RenderFrameProvider));

// Memory row
metricsGrid.AddRow(
new TextNode("Memory:").WithForeground(Color.Gray),
ViewModel.MemoryUsage
.Select<int, ILayoutNode>(mem => BuildProgressBar(mem, GetMetricColor(mem)))
.AsLayout());
.AsLayout(RenderFrameProvider));

// Disk row
metricsGrid.AddRow(
new TextNode("Disk:").WithForeground(Color.Gray),
ViewModel.DiskUsage
.Select<int, ILayoutNode>(disk => BuildProgressBar(disk, GetMetricColor(disk)))
.AsLayout());
.AsLayout(RenderFrameProvider));

// Network row
metricsGrid.AddRow(
new TextNode("Network:").WithForeground(Color.Gray),
ViewModel.NetworkUsage
.Select<int, ILayoutNode>(net => BuildProgressBar(net, GetMetricColor(net)))
.AsLayout());
.AsLayout(RenderFrameProvider));

return metricsGrid;
}
Expand Down Expand Up @@ -183,7 +183,7 @@ private ILayoutNode BuildLogsGrid()

return (ILayoutNode)logsGrid;
})
.AsLayout();
.AsLayout(RenderFrameProvider);
}

private static Color GetLevelColor(string level)
Expand All @@ -206,7 +206,7 @@ private HorizontalLayout BuildStatusBar()
.Select<string, ILayoutNode>(status => new TextNode(status)
.WithForeground(Color.BrightYellow)
.NoWrap())
.AsLayout()
.AsLayout(RenderFrameProvider)
.Fill())
.WithChild(
new TextNode("[↑/↓] Select [R] Refresh [C] Clear [Esc] Quit")
Expand Down
1 change: 1 addition & 0 deletions demos/Termina.Demo.Grid/DashboardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public override void OnActivated()

// Start simulation timer to update metrics
_simulationTimer = Observable.Interval(TimeSpan.FromSeconds(2))
.ObserveOn(RenderFrameProvider)
.Subscribe(_ => UpdateMetrics());

Subscriptions.Add(_simulationTimer);
Expand Down
3 changes: 1 addition & 2 deletions demos/Termina.Demo.KittyScroll/Pages/KittyScrollPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected override void OnBound()
Color.White);
}

_input = new TextInputNode()
_input = new TextInputNode(frameProvider: RenderFrameProvider)
.WithPlaceholder("Type a message and press Enter (Ctrl+C twice to quit)…")
.WithForeground(Color.Cyan);
}
Expand Down Expand Up @@ -124,4 +124,3 @@ public override ILayoutNode BuildLayout()
.Height(3));
}
}

10 changes: 5 additions & 5 deletions demos/Termina.Demo.Streaming/Pages/StreamingChatPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected override void OnBound()
.WithPrefix(" ", Color.Gray)
.WithScrollbar();

_promptInput = new TextInputNode()
_promptInput = new TextInputNode(frameProvider: RenderFrameProvider)
.WithPlaceholder("Enter your question...")
.WithForeground(Color.Cyan)
.WithHistory();
Expand Down Expand Up @@ -252,7 +252,7 @@ public override ILayoutNode BuildLayout()
.WithChild(new TextNode(" Choose an option:").WithForeground(Color.Yellow).Height(1))
.WithChild(decisionList)
.HeightAuto()) // Auto-size to content, don't compete with Fill() elements
.AsLayout())
.AsLayout(RenderFrameProvider))
// Input panel - always visible
.WithChild(
new PanelNode()
Expand All @@ -273,12 +273,12 @@ public override ILayoutNode BuildLayout()
? "[Esc] Cancel [PgUp/PgDn/Wheel] Scroll [Ctrl+Q] Quit"
: "[Enter] Send [Ctrl+Shift+V] Paste [↑/↓] History [PgUp/PgDn/Wheel] Scroll [Esc] Clear/Quit [Ctrl+Q] Quit")
.Select<string, ILayoutNode>(text => new TextNode(text).WithForeground(Color.BrightBlack).NoWrap())
.AsLayout()
.AsLayout(RenderFrameProvider)
.Height(1))
.WithChild(
ViewModel.StatusMessage
.Select<string, ILayoutNode>(msg => new TextNode(msg).WithForeground(Color.White))
.AsLayout()
.AsLayout(RenderFrameProvider)
.Height(1));
}
}
}
Loading