detached 3a02f23

fix: address Copilot review round 2

- Use rune count instead of byte length for attachment name truncation
- Use styles.IconTreeBranch/IconTreeLast constants instead of hardcoded chars
- Update comment from 'ASCII' to 'Unicode box-drawing' for tree structure
- Update comments from 'debugging' to 'display in routes table'
- Apply stripRegistryPrefix to attachment images for consistency
commit
3a02f231403863db6deb0bc1f2fa8b2f1be12e71
author
brice · · 2026-01-17 14:51 UTC
parent
494c50d
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +11 -10
M internal/adapters/in/cli/routes.go +7 -6
@@ -170,18 +170,19 @@ func runRoutesListRemote(ctx context.Context, client *remote.Client) error {
170170 rows = append(rows, []string{route.Domain, displayImage, displayNetwork, containerBadge, httpStatus})
171171
172172 for i, attachment := range route.Attachments {
173- // ASCII tree structure for nested attachments
174- prefix := "├─"
173+ // Unicode box-drawing tree structure for nested attachments
174+ prefix := styles.IconTreeBranch + styles.IconTreeLine
175175 if i == len(route.Attachments)-1 {
176- prefix = "└─"
176+ prefix = styles.IconTreeLast + styles.IconTreeLine
177177 }
178178 attachmentName := prefix + " " + attachment.Name
179- if len(attachmentName) > 25 {
180- attachmentName = attachmentName[:22] + "..."
179+ runes := []rune(attachmentName)
180+ if len(runes) > 25 {
181+ attachmentName = string(runes[:22]) + "..."
181182 }
182183 attachmentStatus := components.ContainerStatusBadge(attachment.Status)
183184 attachmentImage := truncateImage(attachment.Image, imageColWidth)
184- // Show attachment's actual network for debugging/verification
185+ // Display the attachment's actual network in the routes table
185186 attachmentNetwork := truncateNetwork(attachment.Network, networkColWidth)
186187 rows = append(rows, []string{attachmentName, attachmentImage, attachmentNetwork, attachmentStatus, "-"})
187188 }
@@ -170,18 +170,19 @@ func runRoutesListRemote(ctx context.Context, client *remote.Client) error {
170 rows = append(rows, []string{route.Domain, displayImage, displayNetwork, containerBadge, httpStatus})170 rows = append(rows, []string{route.Domain, displayImage, displayNetwork, containerBadge, httpStatus})
171 171
172 for i, attachment := range route.Attachments {172 for i, attachment := range route.Attachments {
173- // ASCII tree structure for nested attachments173+ // Unicode box-drawing tree structure for nested attachments
174- prefix := "├─"174+ prefix := styles.IconTreeBranch + styles.IconTreeLine
175 if i == len(route.Attachments)-1 {175 if i == len(route.Attachments)-1 {
176- prefix = "└─"176+ prefix = styles.IconTreeLast + styles.IconTreeLine
177 }177 }
178 attachmentName := prefix + " " + attachment.Name178 attachmentName := prefix + " " + attachment.Name
179- if len(attachmentName) > 25 {179+ runes := []rune(attachmentName)
180- attachmentName = attachmentName[:22] + "..."180+ if len(runes) > 25 {
181+ attachmentName = string(runes[:22]) + "..."
181 }182 }
182 attachmentStatus := components.ContainerStatusBadge(attachment.Status)183 attachmentStatus := components.ContainerStatusBadge(attachment.Status)
183 attachmentImage := truncateImage(attachment.Image, imageColWidth)184 attachmentImage := truncateImage(attachment.Image, imageColWidth)
184- // Show attachment's actual network for debugging/verification185+ // Display the attachment's actual network in the routes table
185 attachmentNetwork := truncateNetwork(attachment.Network, networkColWidth)186 attachmentNetwork := truncateNetwork(attachment.Network, networkColWidth)
186 rows = append(rows, []string{attachmentName, attachmentImage, attachmentNetwork, attachmentStatus, "-"})187 rows = append(rows, []string{attachmentName, attachmentImage, attachmentNetwork, attachmentStatus, "-"})
187 }188 }
M internal/usecase/container/service.go +4 -4
@@ -987,14 +987,14 @@ func (s *Service) getAllAttachments(ctx context.Context) map[string][]domain.Att
987987 image = labelImage
988988 serviceName = extractServiceName(labelImage)
989989 }
990- // Get the container's network for debugging/verification
990+ // Get the container's network for display in the routes table
991991 network := ""
992992 if networkName, err := s.runtime.GetContainerNetwork(ctx, container.ID); err == nil {
993993 network = networkName
994994 }
995995 attachment := domain.Attachment{
996996 Name: serviceName,
997- Image: image,
997+ Image: s.stripRegistryPrefix(image),
998998 ContainerID: container.ID,
999999 Status: container.Status,
10001000 Network: network,
@@ -1024,14 +1024,14 @@ func (s *Service) filterAttachments(ctx context.Context, containers []*domain.Co
10241024 image = labelImage
10251025 serviceName = extractServiceName(labelImage)
10261026 }
1027- // Get the container's network for debugging/verification
1027+ // Get the container's network for display in the routes table
10281028 network := ""
10291029 if networkName, err := s.runtime.GetContainerNetwork(ctx, container.ID); err == nil {
10301030 network = networkName
10311031 }
10321032 attachment := domain.Attachment{
10331033 Name: serviceName,
1034- Image: image,
1034+ Image: s.stripRegistryPrefix(image),
10351035 ContainerID: container.ID,
10361036 Status: container.Status,
10371037 Network: network,
@@ -987,14 +987,14 @@ func (s *Service) getAllAttachments(ctx context.Context) map[string][]domain.Att
987 image = labelImage987 image = labelImage
988 serviceName = extractServiceName(labelImage)988 serviceName = extractServiceName(labelImage)
989 }989 }
990- // Get the container's network for debugging/verification990+ // Get the container's network for display in the routes table
991 network := ""991 network := ""
992 if networkName, err := s.runtime.GetContainerNetwork(ctx, container.ID); err == nil {992 if networkName, err := s.runtime.GetContainerNetwork(ctx, container.ID); err == nil {
993 network = networkName993 network = networkName
994 }994 }
995 attachment := domain.Attachment{995 attachment := domain.Attachment{
996 Name: serviceName,996 Name: serviceName,
997- Image: image,997+ Image: s.stripRegistryPrefix(image),
998 ContainerID: container.ID,998 ContainerID: container.ID,
999 Status: container.Status,999 Status: container.Status,
1000 Network: network,1000 Network: network,
@@ -1024,14 +1024,14 @@ func (s *Service) filterAttachments(ctx context.Context, containers []*domain.Co
1024 image = labelImage1024 image = labelImage
1025 serviceName = extractServiceName(labelImage)1025 serviceName = extractServiceName(labelImage)
1026 }1026 }
1027- // Get the container's network for debugging/verification1027+ // Get the container's network for display in the routes table
1028 network := ""1028 network := ""
1029 if networkName, err := s.runtime.GetContainerNetwork(ctx, container.ID); err == nil {1029 if networkName, err := s.runtime.GetContainerNetwork(ctx, container.ID); err == nil {
1030 network = networkName1030 network = networkName
1031 }1031 }
1032 attachment := domain.Attachment{1032 attachment := domain.Attachment{
1033 Name: serviceName,1033 Name: serviceName,
1034- Image: image,1034+ Image: s.stripRegistryPrefix(image),
1035 ContainerID: container.ID,1035 ContainerID: container.ID,
1036 Status: container.Status,1036 Status: container.Status,
1037 Network: network,1037 Network: network,

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close