Skip to content

fix(dashboard): production polish — mobile nav, shared nav config, virtualized logs#223

Merged
pratyush618 merged 5 commits into
masterfrom
fix/dashboard-production-polish
May 30, 2026
Merged

fix(dashboard): production polish — mobile nav, shared nav config, virtualized logs#223
pratyush618 merged 5 commits into
masterfrom
fix/dashboard-production-polish

Conversation

@pratyush618

@pratyush618 pratyush618 commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Production-polish pass on the dashboard, fixing every item surfaced by a senior-engineer review of the UI. Five focused, sequential commits — no behavior changes outside the dashboard.

Changes

  • Close mobile nav drawer on navigation — the drawer's close-on-navigate effect had an empty dependency array, so it only ran on mount; the drawer stayed open after every mobile navigation. Replaced the effect with an onClick close on each nav/external link (closes reliably, even when re-navigating to the same route).
  • Share nav config between sidebar and mobile menu — both maintained their own copy of NAV and had drifted: the mobile menu was silently missing Tasks and Webhooks. Extracted a single source of truth in layout/nav-config.ts; adding a route is now a one-line edit.
  • Reuse ErrorState in the route error boundaryRouteErrorFallback reimplemented the error card's markup; it now renders the shared ErrorState so error UI is consistent everywhere.
  • Table-shaped skeleton for the resources table — swapped an opaque block Skeleton for TableSkeleton with column widths matching the rendered table, consistent with every other table.
  • Virtualize the job logs tabJobLogsTab rendered all log lines unvirtualized, degrading the job detail page for high-volume jobs. Now uses @tanstack/react-virtual with dynamic row measurement, preserving the full wrapped-message layout.

Verification

  • pnpm typecheck — pass
  • pnpm lint (Biome, 207 files) — clean
  • pnpm test (Vitest) — 106/106
  • pnpm build — pass; logs.lazy chunk dropped from 19.35 kB → 3.41 kB gz (shares the already-loaded virtualizer)

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced job log viewing performance for large datasets.
  • Style

    • Improved resource table loading state visuals.
  • Refactor

    • Mobile menu closes immediately upon navigation selection.
    • Navigation structure unified across dashboard components.
    • Error display updated for consistent user experience.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR centralizes dashboard navigation configuration into a dedicated module, updates the mobile menu and sidebar to consume it with improved sheet-closing behavior, and independently improves component UI and performance: error boundary messaging, job logs virtualization for large datasets, and table skeleton loading states.

Changes

Navigation Configuration Centralization

Layer / File(s) Summary
Navigation config schema and data
dashboard/src/components/layout/nav-config.ts
New module exports NavItem and NavGroup interfaces, and a NAV constant with grouped navigation entries (Monitoring, Infrastructure, Reliability, Configuration) mapping routes to labels and Lucide icons.
Mobile menu refactor and close handlers
dashboard/src/components/layout/mobile-menu.tsx
Mobile menu imports NAV from nav-config, replaces auto-closing useEffect with explicit close() handlers triggered on internal and external link clicks, and simplifies icon imports.
Sidebar import cleanup and nav-config usage
dashboard/src/components/layout/sidebar.tsx
Sidebar imports are streamlined to include only AlertOctagon and ExternalLinkIcon, ensuring NAV is imported from nav-config; all sidebar rendering logic remains unchanged.

Component UI and Performance Improvements

Layer / File(s) Summary
Error boundary UI refactor
dashboard/src/components/layout/route-error-boundary.tsx
Route error fallback replaces custom AlertTriangle icon and Button layout with the shared ErrorState component, preserving error message extraction and retry callback wiring.
Job logs virtualization with dynamic row measuring
dashboard/src/features/jobs/components/job-logs-tab.tsx
Log rendering switches from a full DOM <ul> list to @tanstack/react-virtual, introducing dynamic row height measurement (measureElement), scroll container ref wiring, and absolutely positioned virtual items to efficiently handle variable-height log messages.
Resources table skeleton loading state
dashboard/src/features/resources/components/resources-table.tsx
Loading state UI upgrades from generic Skeleton to TableSkeleton with explicit row and column width configuration for better visual fidelity during load.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 A web dashboard hops with glee,
Navigation trees now in harmony,
Logs scroll fast through virtual grace,
Error states show kindly face,
Tables skeletal, then full display—
All improvements, hip-hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: mobile nav drawer closing, shared nav config extraction, and virtualized logs—all key production polish items from the PR objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dashboard-production-polish

Comment @coderabbitai help to get the list of available commands and usage tips.

@pratyush618 pratyush618 self-assigned this May 30, 2026

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (2)
dashboard/src/components/layout/nav-config.ts (1)

37-37: 💤 Low value

Consider distinct icons for Jobs and Tasks.

Both "Jobs" (line 37) and "Tasks" (line 61) currently use the ListTree icon, which may reduce visual distinction in the navigation menu.

🎨 Suggested alternative icons

If Tasks represents definitions/templates while Jobs represents running instances, consider using ClipboardList or FileText for Tasks:

-      { to: "/tasks", label: "Tasks", icon: ListTree },
+      { to: "/tasks", label: "Tasks", icon: ClipboardList },

Also applies to: 61-61

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dashboard/src/components/layout/nav-config.ts` at line 37, The Jobs and Tasks
entries in nav-config.ts both use the ListTree icon which reduces visual
distinction; update the nav item for the route with to: "/tasks" (the object
whose label is "Tasks") to use a different icon (for example ClipboardList or
FileText) while keeping the Jobs entry (to: "/jobs", label: "Jobs") as ListTree
(or choose a complementary pair), and ensure you import the chosen icon at the
top and replace the icon reference in the Tasks nav object.
dashboard/src/features/jobs/components/job-logs-tab.tsx (1)

54-69: 💤 Low value

Prefer the virtual item key for row identity

The dynamic-measurement layout (absolute positioning + data-index + measureElement + translateY(item.start)) is wired correctly. Small alignment: use item.key (TanStack Virtual’s recommended stable identity for virtual rows) for the React key instead of a composite that includes item.index, which helps avoid remounting churn if ordering changes.

♻️ Use item.key for the row key
             <div
-              key={`${log.logged_at}-${log.level}-${item.index}`}
+              key={item.key}
               ref={virtualizer.measureElement}
               data-index={item.index}
               style={{
                 position: "absolute",
                 top: 0,
                 left: 0,
                 width: "100%",
                 transform: `translateY(${item.start}px)`,
               }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@dashboard/src/features/jobs/components/job-logs-tab.tsx` around lines 54 -
69, The React key for virtual rows currently uses a composite including
log.logged_at/log.level/item.index which can cause unnecessary remounts; change
the key to use the stable virtual id by replacing the composite key with
item.key where the virtual items are rendered (the map over
virtualizer.getVirtualItems() in job-logs-tab.tsx) while keeping the existing
ref, data-index, style, and use of logs[item.index] unchanged so identity is
driven by item.key.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@dashboard/src/components/layout/nav-config.ts`:
- Line 37: The Jobs and Tasks entries in nav-config.ts both use the ListTree
icon which reduces visual distinction; update the nav item for the route with
to: "/tasks" (the object whose label is "Tasks") to use a different icon (for
example ClipboardList or FileText) while keeping the Jobs entry (to: "/jobs",
label: "Jobs") as ListTree (or choose a complementary pair), and ensure you
import the chosen icon at the top and replace the icon reference in the Tasks
nav object.

In `@dashboard/src/features/jobs/components/job-logs-tab.tsx`:
- Around line 54-69: The React key for virtual rows currently uses a composite
including log.logged_at/log.level/item.index which can cause unnecessary
remounts; change the key to use the stable virtual id by replacing the composite
key with item.key where the virtual items are rendered (the map over
virtualizer.getVirtualItems() in job-logs-tab.tsx) while keeping the existing
ref, data-index, style, and use of logs[item.index] unchanged so identity is
driven by item.key.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 389c65c9-a774-4cf0-99d7-304c5e8b7aee

📥 Commits

Reviewing files that changed from the base of the PR and between 929c062 and f36abac.

📒 Files selected for processing (6)
  • dashboard/src/components/layout/mobile-menu.tsx
  • dashboard/src/components/layout/nav-config.ts
  • dashboard/src/components/layout/route-error-boundary.tsx
  • dashboard/src/components/layout/sidebar.tsx
  • dashboard/src/features/jobs/components/job-logs-tab.tsx
  • dashboard/src/features/resources/components/resources-table.tsx

@pratyush618
pratyush618 merged commit d2c13b2 into master May 30, 2026
15 checks passed
@pratyush618
pratyush618 deleted the fix/dashboard-production-polish branch May 30, 2026 13:50
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.

1 participant