Skip to content

Mitchdenny/run-apphost-logs #9952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed

Conversation

mitchdenny
Copy link
Member

@mitchdenny mitchdenny commented Jun 19, 2025

Fixes: #9622

This change changes the way that we render the terminal dashboard for aspire run. Here is a summary of the changes:

  1. Introduced a custom set of "renderables" which represent the dashboard.
  2. Used this custom renderable in the _ansiConsole.Live(...) call and changed the callback code for Live(...) to effectively be a render loop.
  3. State used to control what is rendered is in a DashboardState type which is passed to a set of background threads that do things like process keyboard input, stream resource states, and get dashboard URLs.
  4. Now that we are in control of the rendering and we have a keyboard input process we react to the user pressing the V key they see the latest apphost logs.

This isn't a replacement for aspire run --debug but its something that you can use to get a quick glance at apphost logs. This is also not a fully blown TUI since that is a lot larger effort (based on some spiking that I did):

aspire-run-tui-light.mp4

@Copilot Copilot AI review requested due to automatic review settings June 19, 2025 12:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates resource strings used by the Aspire CLI application and introduces a new dashboard rendering for app host logs. Key changes include:

  • Refactoring resource strings to shorten text and relocate description notes.
  • Adding a new trans-unit for displaying a prompt to view app host logs in various locales.
  • Implementing a new dashboard rendering view and updating keyboard handling in RunCommand.

Reviewed Changes

Copilot reviewed 19 out of 22 changed files in this pull request and generated 13 comments.

File Description
src/Aspire.Cli/Resources/xlf/RunCommandStrings.*.xlf Updated resource strings for resource health and added a new prompt for viewing app host logs.
src/Aspire.Cli/Resources/RunCommandStrings.resx Updated resource strings similarly for the default resources file.
src/Aspire.Cli/Rendering/Dashboard/* Added new dashboard renderables and state management for app host logs.
src/Aspire.Cli/Commands/RunCommand.cs Enhanced RunCommand with dashboard integration and keyboard input handling.
Files not reviewed (1)
  • src/Aspire.Cli/Resources/RunCommandStrings.Designer.cs: Language not supported

@mitchdenny mitchdenny requested a review from davidfowl June 20, 2025 02:34
@@ -151,3 +151,4 @@ playground/**/publish/

# Verify
*.received.*
**/.aspire/settings.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just figured it would be helpful to folks since everyone is often using a different playground project.

@davidfowl
Copy link
Member

  • The scrolling is not working when I switch back it left some artifacts on the screen from the logs.
  • CTRL + C clears the table, it shouldn't clear.

@mitchdenny
Copy link
Member Author

  • The scrolling is not working when I switch back it left some artifacts on the screen from the logs.
  • CTRL + C clears the table, it shouldn't clear.

I'll look at clearing the screens when we flick. Regarding clearing the table when we CTRL-C -- we kind of have to do it that way to make the logs thing work. We are using an alternate buffer / screen to make this all work. So, when you step back from the alternate buffer / screen you get the original content back (it's not that the table is cleared, it's that it was never on that original buffer to begin with).

@davidfowl
Copy link
Member

Scrolling also seems pretty broken with this change.

@mitchdenny mitchdenny closed this Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error logs output from the apphost and dcp don't show up during aspire run
2 participants