-
Couldn't load subscription status.
- Fork 712
Add option to console logs to wrap log lines #10271
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
Conversation
There was a problem hiding this 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 introduces a user toggle to disable wrapping of long console log lines and persists that setting in local storage.
- Adds CSS rules and a wrapper class to control log line wrapping
- Introduces new resource keys and XLF entries for “Wrap log lines” and “No wrap log lines”
- Updates the ConsoleLogs page and LogViewer control to surface the new toggle and persist its state
Reviewed Changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wwwroot/css/app.css | Adds .wrap-log-container styles for no-wrap |
| Resources/ConsoleLogs.resx & *.xlf | Adds new resource keys for wrap/no-wrap |
| Components/Pages/ConsoleLogs.razor.cs | Adds _noWrapLogs, toggle handler, and settings |
| Components/Pages/ConsoleLogs.razor | Passes NoWrapLogs parameter to LogViewer |
| Components/Controls/LogViewer.razor.cs | Declares new NoWrapLogs parameter |
| Components/Controls/LogViewer.razor | Applies wrap-log-container class when toggled |
Files not reviewed (1)
- src/Aspire.Dashboard/Resources/ConsoleLogs.Designer.cs: Language not supported
Comments suppressed due to low confidence (3)
src/Aspire.Dashboard/Components/Controls/LogViewer.razor:13
- [nitpick] The class name
wrap-log-containeris misleading since it actually disables wrapping. Consider renaming tono-wrap-log-containerfor clarity.
<div class="@($"log-container console-container {(NoWrapLogs ? "wrap-log-container" : null)}")" id="logContainer">
src/Aspire.Dashboard/Components/Controls/LogViewer.razor.cs:43
- Please add an XML doc comment summarizing the purpose of the
NoWrapLogsparameter to maintain documentation consistency with other component parameters.
public bool NoWrapLogs { get; set; }
src/Aspire.Dashboard/Components/Pages/ConsoleLogs.razor.cs:417
- The new
ToggleWrapLogsAsyncbehavior is not covered by existing tests. Consider adding a unit or integration test to verify the wrap toggle persists and updates the UI correctly.
private async Task ToggleWrapLogsAsync(bool noWrapLogs)
|
I generally dislike having options like "don't do X." Can the option instead be "Wrap log lines" and just default to enabled? |
|
The text changes depending on the current state. The default state is wrapping long lines, and then you click Alernatively the UI could be a checkbox like UTC timestamp. |
|
/backport to release/9.4 |
|
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16207875133 |
Description
I can't reproduce the issue with console logs. I think the problem is long lines can wrap, which means they have unequal height, which the Blazor virtualize control doesn't support.
This change adds an option to turn off wrapping. People who have the problem can try out turning this on and see whether the issue disappears.
Contributes to #7969
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate