Skip to content

[PoC] Add aspire monitor TUI command#14402

Draft
mitchdenny wants to merge 34 commits intomainfrom
feature/aspire-monitor-tui
Draft

[PoC] Add aspire monitor TUI command#14402
mitchdenny wants to merge 34 commits intomainfrom
feature/aspire-monitor-tui

Conversation

@mitchdenny
Copy link
Member

Summary

Proof-of-concept aspire monitor command that launches a full-screen TUI for monitoring running Aspire AppHosts. This is behind the monitorCommandEnabled feature flag and serves as a platform to iterate on what a future aspire run TUI experience might look like.

Features

  • Animated splash screen — braille particle whirlwind animation of the Aspire logo on startup
  • AppHost discovery — discovers running AppHosts via the backchannel infrastructure
  • Live resource table — displays resources with name, type, state, health (💚/💔), URLs, and action buttons (start/stop/restart)
  • Resource console logs — embedded terminal panel below the resource table streams live logs for the selected resource via the backchannel
  • Resizable panels — HSplitter for AppHost list / content, DragBarPanel for table / log terminal
  • Background polling — polls for new/offline AppHosts every 3s with notifications
  • Offline detection — detects when an AppHost goes offline, offers reconnect/remove options
  • Aspire brand theme — purple color palette matching the Aspire brand

Key files

File Description
src/Aspire.Cli/UI/AspireMonitorTui.cs Main TUI layout and state management
src/Aspire.Cli/UI/AspireMonitorSplash.cs Animated braille splash screen
src/Aspire.Cli/UI/AspireTheme.cs Aspire brand color theme
src/Aspire.Cli/UI/AspireResourceConsoleLogWorkload.cs Log streaming workload for embedded terminal
src/Aspire.Cli/Commands/MonitorCommand.cs Command registration
tests/Aspire.Cli.EndToEnd.Tests/MonitorCommandTests.cs E2E test

How to try it

aspire config set features.monitorCommandEnabled true -g
aspire run --detach   # start an AppHost
aspire monitor        # launch the TUI

Dependencies

  • Hex1b terminal UI library (1.0.0-local build)

Note: This is a proof of concept for team review. The monitor command itself will likely not ship — the goal is to explore TUI patterns for a future aspire run experience.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14402

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14402"

@mitchdenny mitchdenny force-pushed the feature/aspire-monitor-tui branch from b2c8a8c to 7fcb953 Compare February 10, 2026 23:29
Mitch Denny added 28 commits February 12, 2026 13:04
- Add MonitorCommand behind MonitorCommandEnabled feature flag
- Create AspireMonitorTui with Hex1b-based TUI layout:
  - Drawer panel for AppHost selection
  - TabPanel with Resources and Parameters tabs
  - InfoBar with keyboard shortcuts
- Create AspireMonitorSplash with braille Aspire logo
- Wire into existing backchannel infrastructure for AppHost discovery
  and resource streaming
- Update Hex1b packages to 0.75.0
- Add MonitorCommandStrings resource strings
Replace List widget with Table widget for structured column display
with headers (Name, Type, State, Health, Endpoints) and proper sizing.
Define AspireTheme with colors derived from the Aspire logo SVG:
  - #512BD4 deep purple (primary)
  - #7455DD / #9780E5 / #B9AAEE / #DCD5F6 purple gradient
  - Dark surface palette for backgrounds
Theme covers Global, Table, Border, TabPanel, TabBar, InfoBar,
Button, List, Separator, and NotificationCard elements.
Entire TUI is wrapped in a ThemePanel for consistent styling.
Adds horizontal separators between rows for better readability.
Rename Endpoints column to URLs. Add Actions column with inline
▶ (start), ■ (stop), ↻ (restart) buttons that execute resource
commands via the backchannel.
The left pane is now a fixed-width splitter panel (30 cols) instead
of a collapsible drawer, allowing mouse-drag resizing.
- Re-processed logo pixels: replaced white background with black at full
  resolution before downsampling, so edge anti-aliasing blends toward
  dark purple instead of white
- Extended dissolve wave from 600ms to 900ms
- Extended total exit phase from 2200ms to 3200ms (total splash: 6.0s)
- Background polling every 3s rescans for new/offline AppHosts
- New AppHosts trigger a notification with a Connect action button
- Offline AppHosts show a centered panel with Remove/Reconnect options
- Watch stream errors and disconnects auto-mark AppHost as offline
- AppHost list shows ⚠ indicator for offline entries
- Previously offline AppHosts coming back online trigger a notification
Animation sequence:
1. Whirlwind (0-2.2s): Braille particles spiral from random positions,
   circling their target before settling into place
2. Braille hold (2.2-2.6s): Static braille logo
3. Crossfade (2.6-3.2s): Braille dims through black, half-blocks brighten
4. Half-block hold (3.2-4.0s): Solid half-block logo
5. Dissolve/melt (4.0-7.0s): Rows dissolve to braille, fall with gravity

Original half-block fly-in code preserved (RenderFlyIn) for future use.
Splash is now fully braille-based:
1. Whirlwind (0-2.2s): Braille dots spiral into position
2. Hold (2.2-3.0s): Static braille logo
3. Dissolve/fall (3.0-6.0s): Row-by-row braille dissolve with gravity

Removed PixelState, RenderFlyIn, RenderStatic, RenderStaticWithBrightness,
RenderStaticRows, RenderHalfBlocks, and crossfade phase.
- Create AspireResourceConsoleLogWorkload implementing IHex1bTerminalWorkloadAdapter
  that streams resource logs via the backchannel into an embedded Hex1b terminal
- Add DragBarPanel layout in resources tab: table on top, log terminal on bottom
- Wire resource row selection to switch log streams automatically
- Update Hex1b to 1.0.0-local.20260209100759 for DragBarPanel/TerminalWidget support
- Log workload handles stream switching, cancellation, and ANSI color for errors
- Creates a starter project, starts AppHost with --detach
- Enables monitorCommandEnabled feature flag via aspire config
- Launches aspire monitor TUI and waits for 'Healthy' text
- Ctrl+C exits the TUI, then stops the AppHost
- Replace full UI with centered message explaining monitor will
  auto-detect AppHosts when they start
- Auto-connect to first AppHost when discovered via polling
- Only show notification for subsequent AppHosts
- After the braille splash completes, the main UI is rendered as a
  WidgetLayer inside a Surface with a HackRevealEffect overlay
- Borders and structural characters fade in bottom-up from black
- Alphanumeric text appears as scrambled hacker-style characters
  before settling into the actual content over 4 seconds
- Once the reveal completes, the Surface is replaced with the
  normal interactive widget tree
NotificationPanel requires a ZStack parent which isn't available
when rendering inside a WidgetLayer. Pass interactive flag to
BuildMainScreen to conditionally omit NotificationPanel during
the hack reveal transition.
The Update(1,1) call before the Surface callback was resizing the
cell array to 1x1 on every frame, destroying the captured content
from the WidgetLayer. The real Update with correct dimensions
happens inside the Surface callback.
Mitch Denny added 6 commits February 12, 2026 13:04
Instead of capturing a static snapshot on the first frame, the
effect now continuously checks for new content appearing in cells.
When new content streams in (e.g., resources loading), it gets
assigned reveal times relative to the current progress so it
smoothly joins the animation. Content changes in already-revealed
cells update in place.
Phase 1 (first frame): full-screen capture of WidgetLayer content,
all cells return black. Random timing values are locked in once.

Phase 2 (subsequent frames): reveal from cached data using the
locked-in timing. Empty cells are still promoted to content cells
when new data streams in, with reveal times relative to current
progress so they smoothly join the animation.
…rktree support, vscode:// link, clean up log formatting
@mitchdenny mitchdenny force-pushed the feature/aspire-monitor-tui branch from faafa7d to fe51656 Compare February 12, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant