Skip to content

feat(admin): tidy the Hosts table and show per-host detail in a panel - #1995

Open
Devin-Holland wants to merge 3 commits into
stagefrom
admin-hosts-table-tidy
Open

Devin-Holland wants to merge 3 commits into
stagefrom
admin-hosts-table-tidy

Conversation

@Devin-Holland

@Devin-Holland Devin-Holland commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #1975 from feedback on stage.

⊙ Problem

The Admin → Hosts columns ran together: Studio's table cells have no padding. "1" instances and "0.1 / 4" CPU read as "10.1 / 4". A shared host's Organizations cell listed every organization with an instance on it. The location repeated a full place name. CPU showed a decimal nobody could interpret.

🤔 Should the per-instance organizations leave the table entirely?

No, they move to the panel. Staff still need "who runs on this shared host", just not in a column that grows with every tenant.

💡 Solution

🤔 Why a percentage for CPU?

usedCPUCores is not an allocation. Each heartbeat, the host manager samples CPU for 100 ms and reports busy cores, so "0.1 of 4" meant 0.1 cores busy at that instant. A percentage says that without implying fractional reservations.

⚖️ Alternatives

  • Expandable rows instead of a panel: a shared host's organization list is long enough to push the rest of the table off screen.

🔧 Changes

✅ Verification

  • pnpm test 5947 passing on this head. Page tests and formatter tests cover:

    • the dedicated-only Organizations column, the short location, and the id shown only when it differs;
    • the panel opening from a row and from the host name, staying on its host while a filter change drops it, and returning focus on close;
    • the CPU percentage and the -1 and zero-capacity formatting.

    Reverting any of these fails a test.

  • Rendered the real page against stub data shaped like stage's four hosts (desktop dark, and mobile): columns separate, the panel lists the per-instance organizations with counts.

Related PRs: #1975 overlaps (this follows it up; it is merged)
Complexity: low

🤖 Generated by Claude Code (Claude Opus 5.5); posted via @Devin-Holland.

Review-Coverage: authored=claude; ran=codex,gemini; adjudicated=domain; blocked=cursor-composer(auth); declined=cursor-grok,cursor-kimi,cursor-muse,muse; rounds=1; full=1 @ 23cddf6

Review-Attention: read ~6m (decisions: whole-row-click-opens-modal, org-column-dedicated-only, location-code-over-name, cpu-as-sampled-percentage, do-less-alternative; raised: degraded review) @ 23cddf6

Devin-Holland and others added 2 commits October 22, 2026 09:18
The Organizations column lists only the organizations a host is dedicated to
(or "Shared"); the organizations with instances on a host, with their counts,
move to a details panel that opens from the row. Locations show the location
code and provider, cells get spacing, CPU reads as the share of cores busy in
the last heartbeat sample, and the -1 central-manager stores for an unreported
value shows as unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on close

The panel holds the clicked host, refreshed from the list when present, so a
refetch or filter change that drops it neither closes nor later reopens it.
Closing returns focus to the row's host name. A missing or -1 capacity shows
as unknown for memory and disk as it does for CPU, and the table keeps the
provider when a host has no location code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 80.33% 15248 / 18980
🔵 Statements 80.27% 16191 / 20169
🔵 Functions 75.77% 4107 / 5420
🔵 Branches 74.88% 11887 / 15873
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/features/admin/hosts/index.tsx 89.55% 79.74% 84% 92.52% 137, 138, 139, 303-304, 308, 313-315, 327, 365-377
Generated in workflow #2412 for commit 23cddf6 by the Vitest Coverage Report Action

gemini-code-assist[bot]

This comment was marked as resolved.

Closing now only clears an open flag; the clicked host stays selected, so the
panel no longer empties during its exit animation, and focus return reads it
directly instead of a separate ref.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Devin-Holland
Devin-Holland marked this pull request as ready for review October 22, 2026 16:06
@Devin-Holland
Devin-Holland requested a review from a team as a code owner October 22, 2026 16:06
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.

2 participants