Skip to content

Hide UTC timestamps option when timestamps are disabled - #19931

Open
Shubhransh Gupta (shubhransh-gupta) wants to merge 2 commits into
microsoft:mainfrom
shubhransh-gupta:fix/hide-utc-timestamp-option
Open

Hide UTC timestamps option when timestamps are disabled#19931
Shubhransh Gupta (shubhransh-gupta) wants to merge 2 commits into
microsoft:mainfrom
shubhransh-gupta:fix/hide-utc-timestamp-option

Conversation

@shubhransh-gupta

Copy link
Copy Markdown

Description

On the Console Logs page, the options menu previously showed the UTC timestamps option as a disabled checkbox even when Show timestamps was turned off. This caused visual confusion (resembling a checkbox or broken glyph rather than an inactive setting).

This PR conditionally renders the UTC timestamps option only when _showTimestamp is true. When timestamps are turned off, the option is cleanly hidden from the menu.

Fixes #19019

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🚀 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19931

Or

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The regression test has a missing namespace import and lacks required terminal JS interop setup.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Hides the UTC timestamp option when console timestamps are disabled.

Changes:

  • Conditionally renders the UTC timestamp menu item.
  • Adds focused bUnit regression coverage.
File summaries
File Description
src/Aspire.Dashboard/Components/Pages/ConsoleLogs.razor.cs Gates the UTC option on timestamp visibility.
tests/Aspire.Dashboard.Components.Tests/Pages/ConsoleLogsTerminalTests.cs Tests the hidden-option behavior.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

resourceChannelProvider: () => resourceChannel,
initialResources: [terminalResource]);

SetupConsoleLogsServices(dashboardClient);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in commit f89a9a3: moved the test to ConsoleLogsTests.cs using a standard non-terminal resource (ModelTestHelpers.CreateResource), which is the appropriate home for non-terminal console menu tests and avoids needing terminal JS interop. Also expanded the test to verify both hidden and visible states when toggling timestamps.

await cut.InvokeAsync(() => instance.HandleViewChangedForTestAsync(nameof(ConsoleLogs.ConsoleLogsView.Console)));
cut.WaitForState(() => instance.ActiveViewForTest == ConsoleLogs.ConsoleLogsView.Console);

var loc = Services.GetRequiredService<IStringLocalizer<Dashboard.Resources.ConsoleLogs>>();

@shubhransh-gupta Shubhransh Gupta (shubhransh-gupta) Sep 4, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed in commit f89a9a3: moved to ConsoleLogsTests.cs which already imports Microsoft.Extensions.Localization, and reverted ConsoleLogsTerminalTests.cs to unmodified.

@shubhransh-gupta

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused implementation matches the reported behavior and includes appropriate regression coverage.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[13.5] Logs filter should hide UTC timestamps option when Show timestamps is disabled

2 participants