Skip to content

Comments

feat(swarm): services table improvements — image digest truncation and running/desired replica count#1833

Open
scyto wants to merge 7 commits intogetarcaneapp:feat/docker-swarmfrom
scyto:feat/docker-swarm
Open

feat(swarm): services table improvements — image digest truncation and running/desired replica count#1833
scyto wants to merge 7 commits intogetarcaneapp:feat/docker-swarmfrom
scyto:feat/docker-swarm

Conversation

@scyto
Copy link

@scyto scyto commented Feb 20, 2026

Summary

Two improvements to the Docker Swarm services table:

  • Image digest truncation — replaces full @sha256:<64-char-hash> digests with a readable @sha256:<7-char> short form in both the services and images tables, keeping the display useful without flooding the column
  • Running / desired replica count — displays replicas as running / desired (e.g. 2 / 3) instead of a single desired count; fixes global services showing 0 by using ServiceStatus.DesiredTasks which reflects the number of eligible nodes; surfaces real-time convergence state via ServiceStatus.RunningTasks

Changes

Image digest truncation (feat/swarm/services-table.svelte, images/image-table.svelte, string.utils.ts)

  • Adds truncateImageDigest() helper that trims @sha256:<64-hex> to @sha256:<7-hex>
  • Applied to the image column in the swarm services table and the repo column in the images table

Running / desired replica count (types/swarm/service.go, swarm_service.go, swarm.type.ts, services-table.svelte)

  • Adds RunningReplicas field to ServiceSummary; NewServiceSummary reads ServiceStatus.RunningTasks
  • For global services, uses ServiceStatus.DesiredTasks as the desired count (was hardcoded 0)
  • ServiceList now passes Status: true to populate ServiceStatus
  • Sort binding uses RunningReplicas as a tiebreaker on equal desired counts
  • Frontend renders x / y in both desktop table and mobile card views

Test plan

  • Image columns in services and images tables show truncated digests (@sha256:abc1234) instead of full hashes
  • Replicated service with all replicas running shows N / N
  • Replicated service with a failed task briefly shows N-1 / N until Swarm reschedules
  • Global service shows N / N (number of eligible nodes) instead of 0
  • Sorting by the Replicas column orders by desired count, with running count as tiebreaker
  • Mobile card view shows the same x / y format

🤖 Generated with Claude Code

Disclaimer Greptiles Reviews use AI, make sure to check over its work.

To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike

Greptile Summary

Enhanced Docker Swarm services table with two UI improvements: truncated SHA256 image digests for better readability (64-char → 7-char) and running/desired replica count display (e.g., 2 / 3).

  • Backend now requests service status data (Status: true) and populates RunningReplicas from ServiceStatus.RunningTasks
  • Global services now correctly show desired count from ServiceStatus.DesiredTasks instead of hardcoded 0
  • Replicas column sort uses running count as tiebreaker when desired counts are equal
  • Frontend displays x / y format in both desktop table and mobile card views
  • Image digest truncation applied via regex replacement (@sha256:<7-hex>)

The implementation is clean and follows established patterns. All changes are well-scoped to the specific features being added.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward UI improvements with well-defined scope. The backend changes properly enable service status fetching and handle both replicated and global service modes. The frontend correctly displays the new data in both desktop and mobile views. The regex pattern for digest truncation is correct for Docker's lowercase hex SHA256 format. No security concerns or breaking changes.
  • No files require special attention

Important Files Changed

Filename Overview
types/swarm/service.go added RunningReplicas field and logic to populate desired replicas for global services from ServiceStatus.DesiredTasks
backend/internal/services/swarm_service.go enabled Status: true in ServiceList call and added running replicas as tiebreaker in sort logic
frontend/src/lib/utils/string.utils.ts added truncateImageDigest function to truncate SHA256 digests from 64 to 7 characters
frontend/src/routes/(app)/swarm/services/services-table.svelte added image digest truncation and running/desired replica display in both desktop and mobile views

Last reviewed commit: 3c921fd

(5/5) You can turn off certain types of comments like style here!

scyto and others added 2 commits February 21, 2026 11:45
…nd images tables

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Display replicas as 'x / y' (running / desired) instead of a single
desired count. Fixes global services showing 0 replicas by using
ServiceStatus.DesiredTasks, and surfaces real-time health for replicated
services via ServiceStatus.RunningTasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@scyto scyto requested a review from a team as a code owner February 20, 2026 22:46
@scyto
Copy link
Author

scyto commented Feb 20, 2026

@kmendell ok finally a PR that is clean, claude really seems to have more issues than nomal with a forked version of the repo and gh operations - I think its the active linting and some of the agent rules that mean feat branch > feat branch PRs get really weird..... not sure i have actionable feedback yet on what to change

these have been tested in my onwn CI image builds, if you want to pull that you can at ghcr.io/scyto/arcane:pr-13

oh i stcuk with showing @sha256:nnnnnnn as there is a reason swarms show this by default and dont use tags (because tags dont dictate image stability and all swarm nodes to know tehy are using the same sha version, not tag, and so users can validate that)

scyto and others added 5 commits February 21, 2026 14:39
…and network info

Redesign the services table to show node placement, networks, and mounts
via expandable row details. Collapsed rows show stack, short name (prefix
stripped), mode, replicas, nodes, networks, and ports with overflow badges.
Expanded rows reveal full service name, image, mounts, and complete lists.

- Add generic expandable row support to ArcaneTable (desktop + mobile)
- Enrich ServiceSummary backend type with nodes, networks, mounts fields
- Fetch tasks/nodes in ListServicesPaginated to resolve node placement
- Add OverflowCell pattern showing up to 3 items with "+N more" badge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add shouldIgnoreRowClick guard to mobile view matching the existing
desktop behavior, so tapping dropdown menus or buttons no longer
inadvertently expands/collapses the row.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat(swarm): expandable rows for services table
The build-pr-images workflow on main compiles Go/frontend on the host
then packages into Docker images, but the referenced Dockerfile.ci-manager
and Dockerfile.ci-agent didn't exist yet, causing all PR builds to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ci: add missing CI packaging Dockerfiles
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