Skip to content

Dashboard - #2

Merged
floris-xlx merged 9 commits into
mainfrom
dashboard
Apr 28, 2026
Merged

Dashboard#2
floris-xlx merged 9 commits into
mainfrom
dashboard

Conversation

@floris-xlx

@floris-xlx floris-xlx commented Apr 28, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Large dashboard refactor/addition with new pages, client-side YAML CRUD, and significant dependency/tooling changes (React 19, Tailwind/HeroUI, Next rewrites), which may introduce runtime/build and API-integration regressions. No backend/runtime monitoring logic is modified.

Overview
Overhauls the /dashboard Next.js app into a multi-page UI with a persistent Sidebar, toasts, theme toggle, and an initial backend-offline banner.

Adds new pages for monitor management and drilldowns (list/create/edit/delete/trigger probes backed by editing xbp.yml via /api/config), story list + detail + trigger, and event/result drilldowns with response redaction handling; the home page is reworked into a status/alerts overview with a shared ResultsDrawer.

Updates dashboard tooling: switches styling to Tailwind + HeroUI, adds a centralized lib/api.ts with configurable API base URL (localStorage/env) and improved HTML-error detection, adds dev rewrites to proxy API calls to the Rust backend on :3000, and updates scripts/deps (React 19, HeroUI, Tailwind/PostCSS, pnpm lockfile).

Reviewed by Cursor Bugbot for commit 58c8c69. Bugbot is set up for automated code reviews on this repo. Configure here.

floris-xlx and others added 9 commits April 27, 2026 22:21
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
… status

- Introduced a new component that checks the status of the backend API.
- Displays a warning banner when the backend connection is lost.
- Includes a retry button to manually check the connection.
- The status check occurs every 20 seconds.
- Updated the pnpm workspace state timestamp.
…management hook

Co-authored-by: Copilot <copilot@github.com>
…from configuration; add theme toggle component

Co-authored-by: Copilot <copilot@github.com>
@floris-xlx
floris-xlx merged commit 79a57e3 into main Apr 28, 2026
5 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 58c8c69. Configure here.

Comment thread dashboard/lib/api.ts
return request<StoryResult>(
`/api/stories/${encodeURIComponent(name)}/trigger`
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

API paths break in production static export

High Severity

All probe and story API functions use an /api/ prefix (e.g., /api/probes, /api/stories/...), but the Rust backend serves these at /probes/... and /stories/... (without the prefix). The Next.js dev rewrites strip the /api/ prefix in development, but with output: "export", production builds are purely static files with no server-side rewrites. Every probe/story API call will hit the wrong path in production, breaking the entire dashboard except config and restart.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 58c8c69. Configure here.

Comment thread dashboard/app/page.tsx
<td className="max-w-[420px] truncate px-4 py-3 text-default-700">{errorMessage}</td>
<td className="px-4 py-3 text-default-500">1m ago</td>
<td className="px-4 py-3 text-default-500">3h ago</td>
<td className="px-4 py-3 font-semibold text-default-800">{Math.max(1, recentResults.length * 53)}</td>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hardcoded placeholder data in Error Groups table

Medium Severity

The Error Groups table contains hardcoded mock values: "First seen" is always "1m ago", "Last seen" is always "3h ago", and the event count uses a synthetic formula Math.max(1, recentResults.length * 53). These don't reflect real data and appear to be placeholder values left from development.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 58c8c69. Configure here.

Comment thread dashboard/app/page.tsx
}
}
const healthPct =
stats.total > 0 ? Math.round((stats.ok / stats.total) * 100) : 100;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Availability percentage decimal places always zero

Low Severity

healthPct is computed with Math.round(...) which returns an integer, then displayed with .toFixed(2). This always produces values like "100.00%" or "50.00%" — the two decimal places are always zero, making the precision meaningless. Either remove Math.round to preserve fractional precision, or drop .toFixed(2).

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 58c8c69. Configure here.

const [loading, setLoading] = useState(true);
const [createOpen, setCreateOpen] = useState(false);
const [editProbe, setEditProbe] = useState<Probe | null>(null);
const [resultsProbe, setResultsProbe] = useState<string | null>(null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Results drawer can never open on monitors page

Low Severity

The resultsProbe state is initialized to null and only ever set back to null in the onClose handler. No code in the monitors page ever calls setResultsProbe with a probe name, so the ResultsDrawer component can never open. This is dead code — the state and the drawer component serve no purpose.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 58c8c69. Configure here.

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.

1 participant