-
Notifications
You must be signed in to change notification settings - Fork 34
Add real-time diagnostics HUD for serve mode #2563
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
… initialization flow
Features: - Add segmented diagnostics pill in header showing [icon] [count] [name] per severity - Each segment has animated gradient background matching severity color - Segments with count 0 are automatically hidden - Add diagnostics HUD panel with filter toggle buttons for errors/warnings/hints - Add "All" button when any filter is inactive - Sort diagnostics by severity: errors > warnings > hints - Add copy button for each diagnostic row - Stream diagnostics via SSE with broadcast pattern for multiple clients - Run in-memory validation build in parallel with live reload - Optimize builds by reusing MockFileSystem and only regenerating OpenAPI when specs change - Add --skip-api flag to docs-builder command for faster builds
The logger was being created at module load time, which failed when other modules imported logging functions before the LoggerProvider was initialized. Changed to lazy initialization using a getter function. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When the user has the diagnostics HUD open and the page reloads (via live reload or manual), the HUD now stays open instead of collapsing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Split initIsolatedHeader into two functions: - setInitialHeaderOffset(): Sets CSS variable immediately on script load - initIsolatedHeader(): Full init with scroll listener on DOMContentLoaded This prevents the visual jump where the header height changes after the page has already rendered. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated all experimental OpenTelemetry packages to 0.209.0 to ensure consistent versions across the dependency tree. The version mismatch between api-logs@0.208.0 and sdk-logs@0.209.0 was causing module initialization errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added .no-transitions class that disables all transitions during initial page load to prevent visible animation when setting the header offset based on scroll position. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Moved the removal of no-transitions class from setInitialHeaderOffset to initIsolatedHeader, ensuring transitions stay disabled until after updateLayout sets the header element styles. This prevents the logo from animating on page load when scrolled down. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds cursor: pointer to all clickable elements in the diagnostics UI: - Diagnostic pill buttons in header (all states) - Filter buttons in HUD - Copy button on diagnostic rows - All/Close buttons in HUD header Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
src/Elastic.Documentation.Site/Assets/web-components/Diagnostics/DiagnosticsHud.tsx
Fixed
Show fixed
Hide fixed
…tion or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
| foreach (var channel in _clientChannels) | ||
| { | ||
| if (!channel.Writer.TryWrite(buildEvent)) | ||
| { | ||
| // Channel is full or closed, mark for removal | ||
| deadChannels.Add(channel); | ||
| } | ||
| } |
| catch (Exception ex) | ||
| { | ||
| _logger.LogError(ex, "Error during in-memory build: {Message}", ex.Message); | ||
| Status = BuildStatus.Complete; | ||
|
|
||
| // Emit build_complete with current counts even on error | ||
| await BroadcastEventAsync(new BuildEvent( | ||
| "build_complete", | ||
| DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), | ||
| Errors: ErrorCount, | ||
| Warnings: WarningCount, | ||
| Hints: HintCount | ||
| )); | ||
| } |
reakaleek
left a comment
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.
❤️ 🚀
LGTM
Not a blocker: But IMO it would be nice if we stick with EUI. But I can take a look at it when working on dev docs.
Agreed! There are a few more things I want to do with diagnostics. Ensure each diagnostics has a code, document all error/warnings/hints inluding a fix/remedy. And link to those from the HUD (and CLI output). |
|
|
||
| // SessionStorage key for persisting HUD open state | ||
| const HUD_OPEN_KEY = 'diagnostics-hud-open' | ||
|
|
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.
In the ask ai store we are using zustand with the sessionStorage provider
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.
Ahh here I am also using zustand for the diagnostics itself. Should this go into indexeddb?
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.
it looks to me that the diagnotics stuff is fine for just in-memory zustand.
And small UI state also sounds good for the sessionStorage..
I used IndexedDB for the chat because it could potentially become huge, and there is virtually no storage limit. (the downside is that it is slower)
But for UI state, like flyout open/closed.. we are also using sessionStorage.
Summary
docs-builder servethat shows build errors, warnings, and hints in real-timeFeatures
cursorful-video-1769454422244.mp4