Skip to content

Restyle the k8s-pods view and drop the demo-data copy - #13

Merged
setnilson merged 1 commit into
masterfrom
prettier-k8s-pods
Sep 30, 2026
Merged

setnilson merged 1 commit into
masterfrom
prettier-k8s-pods

Conversation

@setnilson

Copy link
Copy Markdown
Owner

What changed

The page was a bare title, a select and an unstyled table. It now has some structure:

Area Before After
Summary none Four CalloutValue cards — pods, running, needs attention, restarts — recomputed against the active filters
Status flat Badge, default/warning/danger only StatusPill graded per pod phase, so Pending reads as a warning rather than an error
Filtering namespace select pod-name search alongside the namespace select
Row order insertion order unhealthy pods sort to the top
Delete text Delete button icon-only trash with a per-pod aria-label
Confirmation bare <Text> line dismissible MessageBox
Empty "No pods in this namespace." TableEmptyState with the pod glyph, title and subtitle

Restarts and Age are right-aligned, pod names are monospace with ellipsis, and the table gets stickyHeaders + hasInnerBorders.

Copy

The header no longer says "Demo view using mock data" — it now reads "Pod health across namespaces. Unhealthy pods can be deleted from the list." No user-facing string mentions demo or mock data anymore.

The mockPods identifier and its comment are deliberately unchanged. The data is still a static fixture with no Kubernetes integration behind it, and that fact belongs in the code even when it is not in the UI — the next person to open this file should not have to discover it.

Two DRUIDS gotchas found on the way

  • InputSearch's leading magnifier occupies the same slot as floatingLabel, so a label set there renders as a clipped sliver above the input. The placeholder carries it instead. Select's floatingLabel works fine and is kept.
  • The Status column must not set shouldShrink, or CrashLoopBackOff truncates to CRASHLO….

Both were caught in the browser, not by types or lint.

Verification

Driven against the dev server in a real browser:

  • search (checkout → 2 rows, summary follows), namespace filter (database → 2 rows), delete → MessageBox + summary updates, dismiss → collapses and clears state, next delete mounts a fresh message
  • empty state renders for a no-match query
  • no horizontal overflow at an 800px viewport — this is why delete went icon-only
  • console is clean apart from pre-existing UNSAFE_componentWill* StrictMode warnings from a minified DRUIDS dependency (react-select), which this change does not touch

Root-gate checks: npm install --package-lock-only --ignore-scripts, then npm ci --ignore-scripts, npm run typecheck -w apps/k8s-pods, npm run lint, npm run build -w apps/k8s-pods — all pass. apps/k8s-pods record and node_modules/k8s-pods link both present in the root lockfile.

Version goes to 0.0.3 so this deploy gets its own error-tracking releaseVersion.

Note on the theme

main.tsx pins defaultThemePreference="light", so the app stays light regardless of the host colour scheme. Untouched here — worth a separate look if it should follow the Datadog theme in App Builder.

The page was a bare title, a select and an unstyled table. Rework it into
something presentable:

- A summary row of CalloutValue cards (pods, running, needs attention,
  restarts) that recomputes against the active filters.
- StatusPill per pod phase, graded by severity, instead of a flat Badge —
  and Pending no longer reads as an error.
- A pod-name search alongside the namespace select.
- Unhealthy pods sort to the top so the rows needing action come first.
- Icon-only delete buttons with per-pod aria-labels, which also keeps the
  actions column narrow enough that the table fits an 800px pane.
- MessageBox for the delete confirmation, and a TableEmptyState with the
  pod glyph in place of the bare "No pods in this namespace." line.

Two DRUIDS notes worth recording: InputSearch's leading magnifier occupies
the same slot as `floatingLabel`, so a label there renders clipped — the
placeholder carries it instead. And the Status column must not set
`shouldShrink`, or "CrashLoopBackOff" truncates to "CRASHLO…".

The header no longer says "Demo view using mock data". The `mockPods`
identifier and its comment stay as they are: the data is still a static
fixture, and that belongs in the code even when it is not in the UI.

Version goes to 0.0.3 so this deploy gets its own error-tracking
releaseVersion; lockfile regenerated through the root gate.

Verified in the browser against the dev server: search, namespace filter,
delete, dismiss and empty state all behave, no horizontal overflow at
800px, and npm ci / typecheck / lint / build all pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@setnilson
setnilson merged commit 0e73048 into master Sep 30, 2026
8 checks passed
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