Skip to content

Dashboard performance/UX changes#55

Merged
arktronic-sep merged 4 commits into
sep:mainfrom
arktronic:dashboard-changes
Apr 13, 2026
Merged

Dashboard performance/UX changes#55
arktronic-sep merged 4 commits into
sep:mainfrom
arktronic:dashboard-changes

Conversation

@arktronic
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

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 refactors the Dashboard to improve perceived performance and UX by loading the incident timeline and response time trends asynchronously via HTMX, and includes a small query optimization in CheckQueryService.

Changes:

  • Add a lightweight GetDashboardMessageAsync query to avoid fetching full workspace details just to render the dashboard message.
  • Optimize timeline/trends aggregation by pre-grouping results by CheckId to avoid repeated filtering.
  • Split dashboard chart loading into HTMX partial handlers (Timeline / Trends) and update chart partials to support a loading state.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SAMA.Web/Services/Queries/WorkspaceQueryService.cs Adds a focused query to fetch only the dashboard message.
SAMA.Web/Services/Queries/CheckQueryService.cs Uses a Lookup to reduce repeated Where filtering when aggregating results.
SAMA.Web/Pages/Dashboard/Index.cshtml.cs Splits chart loading into separate HTMX handlers and loads dashboard message via new query.
SAMA.Web/Pages/Dashboard/Index.cshtml Switches charts to initial “loading” models and triggers HTMX fetches on load/interval.
SAMA.Web/Pages/Dashboard/_ResponseTimeTrendsChart.cshtml Adds loading/no-data behavior and initializes chart on OOB swaps.
SAMA.Web/Pages/Dashboard/_IncidentTimelineChart.cshtml Adds loading behavior and initializes chart on OOB swaps.
SAMA.Tests.Unit/Web/Pages/Dashboard/IndexModelTests.cs Updates mocks for the new dashboard message query and adds handler tests for partial endpoints.

Comment thread SAMA.Web/Services/Queries/CheckQueryService.cs Outdated
Comment thread SAMA.Web/Pages/Dashboard/_ResponseTimeTrendsChart.cshtml Outdated
Copy link
Copy Markdown
Contributor

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 refactors the Dashboard to improve perceived performance/UX by decoupling chart rendering from the main page load and reducing some repeated in-memory filtering in check timeline/trend queries.

Changes:

  • Added a targeted workspace query to fetch only the dashboard message.
  • Updated dashboard to load Incident Timeline and Response Time Trends via HTMX handlers/partials (with OOB JSON swaps) instead of in the main page model.
  • Optimized check result processing by grouping results per check (ToLookup) to reduce repeated filtering.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SAMA.Web/Services/Queries/WorkspaceQueryService.cs Adds GetDashboardMessageAsync to fetch only the dashboard message field.
SAMA.Web/Services/Queries/CheckQueryService.cs Uses ToLookup to group results by check for timeline/trend processing.
SAMA.Web/Pages/Dashboard/Index.cshtml.cs Splits dashboard into main page + two HTMX handlers returning partials for timeline/trends.
SAMA.Web/Pages/Dashboard/Index.cshtml Updates markup to render placeholder chart shells and trigger HTMX refreshes.
SAMA.Web/Pages/Dashboard/_ResponseTimeTrendsChart.cshtml Adjusts loading/no-data behavior and relies on OOB JSON swap events to (re)initialize charts.
SAMA.Web/Pages/Dashboard/_IncidentTimelineChart.cshtml Same as trends: loading/no-data behavior + OOB JSON swap-driven chart init/update.
SAMA.Tests.Unit/Web/Pages/Dashboard/IndexModelTests.cs Updates mocks and adds unit coverage for the new timeline/trends handlers.

Comment thread SAMA.Web/Services/Queries/CheckQueryService.cs Outdated
Comment thread SAMA.Web/Pages/Dashboard/Index.cshtml.cs
Comment thread SAMA.Web/Pages/Dashboard/Index.cshtml.cs
Copy link
Copy Markdown
Contributor

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 improves the Dashboard’s perceived performance and refresh behavior by splitting expensive chart data loading into separate HTMX endpoints and reducing repeated in-memory scanning in query logic.

Changes:

  • Added a lightweight GetDashboardMessageAsync query to avoid loading full workspace details just to render the dashboard message.
  • Optimized dashboard query computations by grouping check results via ToLookup to avoid repeated filtering over the full results set.
  • Changed the Dashboard page to load incident timeline and response time trends via dedicated HTMX handlers that return OOB-updated JSON script tags; added unit tests for the new handlers.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SAMA.Web/Services/Queries/WorkspaceQueryService.cs Adds a focused query for dashboard message retrieval.
SAMA.Web/Services/Queries/CheckQueryService.cs Improves timeline/trends computations by indexing results per check ID.
SAMA.Web/Pages/Dashboard/Index.cshtml.cs Adds OnGetTimelineAsync / OnGetTrendsAsync handlers and uses lightweight dashboard message query.
SAMA.Web/Pages/Dashboard/Index.cshtml Updates page to render chart shells and fetch chart data via HTMX polling/OOB swaps.
SAMA.Web/Pages/Dashboard/_IncidentTimelineChart.cshtml Adjusts initialization to run on HTMX OOB swaps and improves loading/no-data behavior.
SAMA.Web/Pages/Dashboard/_ResponseTimeTrendsChart.cshtml Adjusts initialization to run on HTMX OOB swaps and improves loading/no-data behavior.
SAMA.Tests.Unit/Web/Pages/Dashboard/IndexModelTests.cs Updates mocks and adds tests for new timeline/trends handlers.

Comment on lines +159 to +162
<div class="d-none"
hx-get="/Dashboard/Index?handler=Timeline&workspaceId=@Model.WorkspaceId&timelineHours=@Model.TimelineHours"
hx-trigger="load, every @(Model.RefreshIntervalSeconds)s"
hx-swap="none"></div>
Comment on lines +170 to +173
<div class="d-none"
hx-get="/Dashboard/Index?handler=Trends&workspaceId=@Model.WorkspaceId&trendsHours=@Model.TrendsHours"
hx-trigger="load, every @(Model.RefreshIntervalSeconds)s"
hx-swap="none"></div>
@arktronic-sep arktronic-sep merged commit eefd1e1 into sep:main Apr 13, 2026
8 checks passed
@arktronic arktronic deleted the dashboard-changes branch April 13, 2026 03:39
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.

3 participants