feat(clusters): hide container ops on self-hosted, gate Deployments on auth#1540
Conversation
…n auth Self-hosted clusters have no managed container lifecycle (Harper doesn't control their runtime), so the Container action group — Start, Start in safe mode, Restart, Restart in safe mode, Stop — is now hidden for them in both the cluster-card context menu (ClusterCard) and the per-instance menu (useInstanceMenuItems). This matches ClusterStateMenu, which already hides the "Cluster actions" dropdown entirely for self-hosted clusters. Also gate the "Deployments" cluster-card menu item on cluster authentication (!!auth.user, the same signal ClusterHome uses for its connected state), so it only appears once you've authenticated with the cluster. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request hides container lifecycle actions (such as start, stop, and restart) for self-managed/self-hosted clusters in both the instance menu items and the cluster card, as Harper does not control their runtime. Additionally, it restricts the visibility of the deployments action in the cluster card to authenticated users. There are no review comments, and I have no feedback to provide.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
DavidCockerill
left a comment
There was a problem hiding this comment.
LGTM — clean visibility fix. Hiding the Container group on self-hosted clusters is correct (Harper doesn't control their runtime), and it uses the canonical clusterIsSelfManaged / the isSelfManaged param consistently, so the cluster card, per-instance menu, and ClusterStateMenu now all agree. Verified isSelfManaged is in scope (it's a declared param of useInstanceMenuItems, already used just below), so no undefined-ref risk. One minor, non-blocking: the Deployments gate uses !!auth.user (any authenticated Studio user) — worth confirming that's the intended signal vs a cluster-scoped one, but it's a reasonable minimum.
— DAIvid (Claude Fable 5)
|
Yup, it's intentional on the Deployments. |
What
Hides a few cluster features that don't apply to self-hosted clusters, plus gates the Deployments menu item on cluster authentication.
1. Container actions hidden on self-hosted clusters
Self-hosted clusters have no managed container lifecycle — Harper doesn't control their runtime — so the Container action group (Start, Start in safe mode, Restart, Restart in safe mode, Stop) is now hidden for them in:
ClusterCard)useInstanceMenuItems)This matches the existing behavior of the cluster-overview "Cluster actions" dropdown (
ClusterStateMenu), which already returnsnullfor self-hosted clusters — so no change was needed there.2. "Deployments" gated on cluster authentication
The Deployments cluster-card menu item now only appears once you've authenticated with the cluster (
!!auth.user, the same signalClusterHomeuses for its connected state) — previously it showed whenever you had view permission.Verification
tsc -b,oxlint,dprint, and the fullvitestsuite (241 files / 1732 tests) all pass.The managed cluster confirms the container-ops change is correctly scoped to self-hosted; Deployments disappearing for both clusters (where it previously showed unconditionally) confirms the auth gate.
🤖 Generated with Claude Code