Skip to content

feat(overview): add active deployments indicator to sidebar - #5431

Open
hmh6a wants to merge 2 commits into
Dokploy:canaryfrom
hmh6a:feature/active-deployments
Open

hmh6a wants to merge 2 commits into
Dokploy:canaryfrom
hmh6a:feature/active-deployments

Conversation

@hmh6a

@hmh6a hmh6a commented Sep 12, 2026

Copy link
Copy Markdown

Summary

Adds an Active Deployments indicator to the sidebar so users can see at a glance when something is deploying and jump straight to it, without leaving the page they are on.

  • A compact indicator (spinner + count) appears in the sidebar header, next to the notification bell, only while at least one service is deploying. It is rendered on every dashboard page, including project pages where the top header is hidden.
  • One deploying service → the indicator links directly to it (deployments tab for application/compose, service page for databases).
  • Several → a dropdown lists each service with its icon, project · environment, a "Deploying" status and, when available, when the deployment started. Each row links to the service.
  • The organization switcher shows a per-organization badge with the number of deploying services, so users with several organizations can see where activity is happening.
  • Collapsed sidebar: icon-only button with a count badge, same pattern as the notification bell.

Why applicationStatus instead of the deployment table

Only applications and compose create rows in deployment; databases (postgres, mysql, mariadb, mongo, redis, libsql) don't. The applicationStatus / composeStatus column is the one signal shared by all eight service types and is already what the Overview page uses — it only holds running while a deploy is in progress (labelled "Deploying" there). Using it means the indicator covers database deploys too and never double-counts a service.

Changes

  • packages/server/src/services/overview.tsgetAllServicesForOrganization accepts an optional status filter (applied per service type inside getServicesOfType).
  • apps/dokploy/server/api/routers/overview.ts
    • overview.services accepts an optional { status } input (backward compatible; existing callers pass nothing).
    • new overview.activeDeploymentsByOrganization: for every organization the user belongs to, checks service:read with that organization's membership, applies accessedServices for non-owner/admin members, and returns { [organizationId]: count }.
  • apps/dokploy/components/layouts/active-deployments.tsx — the indicator (new).
  • apps/dokploy/components/layouts/side.tsx — mounts the indicator; per-organization badge in the organization switcher.
  • apps/dokploy/components/dashboard/overview/show-overview-services.tsx — extracts the existing icon logic into OverviewServiceIcon so it can be reused (no behaviour change).

No new dependencies, no schema/migration changes.

Updates

Dokploy has no status subscription channel (websockets are only used for log streaming), so this follows the existing React Query polling pattern:

  • Indicator: overview.services({ status: "running" }), 3 s while something is deploying, 10 s when idle. Disabled entirely without service:read.
  • Organization badges: overview.activeDeploymentsByOrganization, fetched only while the organization popover is open (5 s), so there is no extra background polling.

Authorization

  • overview.services keeps withPermission("service", "read") and the member accessedServices scoping.
  • activeDeploymentsByOrganization evaluates permissions per organization via hasPermission with that org's activeOrganizationId; organizations where the user lacks service:read report 0.

Tests

  • New __test__/services/overview-services-status.test.ts: no status clause by default, the status clause is added to all eight service-type queries (7 × applicationStatus, 1 × composeStatus), and member scoping is preserved alongside it.
  • pnpm -r typecheck and Biome pass on all touched files; the full apps/dokploy suite passes (the application.real.test.ts cases require nixpacks and a network clone and are unaffected).

Manual test

  1. Deploy any service (an image pull or a git build gives you a few seconds).
  2. The sidebar shows ⟳ 1 active; hovering shows the service name; clicking opens it.
  3. Deploy a second one → 2 active with a dropdown listing both.
  4. Open the organization switcher → a ⟳ N badge next to the organization.
  5. When the deploys finish (or fail / are cancelled) the counts drop and the indicator disappears.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with all previous findings addressed and no new actionable regressions identified.

Summary

Adds a sidebar indicator for deploying services across all eight service types, with direct navigation for one service and a dropdown for multiple services.

  • Polls every three seconds while deployments are active and every ten seconds when idle, gated by service-read permission.
  • Shows per-organization counts while the organization switcher is open, using dedicated count-only queries with membership permissions and accessed-service filtering.
  • Restricts API-key count requests to the key’s authenticated organization.
  • Opens application and Compose deployment tabs only with deployment-read permission; otherwise links to the general service page.
  • Adds regression tests for status filtering, scoped counts, and permission-aware links.
  • All three previous findings are addressed; no new actionable issues were identified in the changes since the previous review.

Reviews (2) · Last reviewed commit: "fix(overview): scope active deployment c..."

Show a compact indicator in the sidebar header whenever one or more
services are deploying (status "running"), covering applications,
compose and databases. A single active deployment links straight to
the service; multiple open a dropdown listing service, project /
environment and elapsed time. The organization switcher also shows a
per-organization count of deploying services.

- overview.services accepts an optional status filter so the indicator
  only fetches deploying services
- new overview.activeDeploymentsByOrganization, permission-checked per
  organization membership
- extract OverviewServiceIcon from the overview table for reuse

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hmh6a
hmh6a requested a review from Siumauricio as a code owner September 12, 2026 16:46
Comment thread apps/dokploy/server/api/routers/overview.ts Outdated
Comment thread apps/dokploy/components/layouts/active-deployments.tsx Outdated
Comment thread apps/dokploy/server/api/routers/overview.ts Outdated
- API-key requests are scoped to the key's organization, so
  activeDeploymentsByOrganization no longer enumerates the key owner's
  other memberships
- count deploying services with count(*) instead of loading full
  overview rows just to read their length
- link application/compose to the deployments tab only when the user
  has deployment.read; otherwise fall back to the service page

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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