A container registry that uses the AT Protocol for manifest storage and S3 for blob storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix word wrapping

+15 -6
+15 -6
pkg/appview/handlers/opengraph.go
··· 70 70 card.DrawAvatarOrPlaceholder(avatarURL, layout.IconX, layout.IconY, ogcard.AvatarSize, 71 71 strings.ToUpper(string(repository[0]))) 72 72 73 - // Draw owner handle and repo name on same line: @owner / repo 73 + // Draw owner handle and repo name - wrap to new line if too long 74 74 ownerText := "@" + user.Handle + " / " 75 - card.DrawText(ownerText, layout.TextX, layout.TextY, ogcard.FontTitle, ogcard.ColorMuted, ogcard.AlignLeft, false) 76 - 77 - // Measure owner text width to position repo name 78 75 ownerWidth := card.MeasureText(ownerText, ogcard.FontTitle, false) 79 - card.DrawText(repository, layout.TextX+float64(ownerWidth), layout.TextY, ogcard.FontTitle, ogcard.ColorText, ogcard.AlignLeft, true) 76 + repoWidth := card.MeasureText(repository, ogcard.FontTitle, true) 77 + combinedWidth := ownerWidth + repoWidth 80 78 81 - // Draw description (if present, with wrapping) 82 79 textY := layout.TextY 80 + if combinedWidth > layout.MaxWidth { 81 + // Too long - put repo name on new line 82 + card.DrawText("@"+user.Handle+" /", layout.TextX, textY, ogcard.FontTitle, ogcard.ColorMuted, ogcard.AlignLeft, false) 83 + textY += ogcard.LineSpacingLarge 84 + card.DrawText(repository, layout.TextX, textY, ogcard.FontTitle, ogcard.ColorText, ogcard.AlignLeft, true) 85 + } else { 86 + // Fits on one line 87 + card.DrawText(ownerText, layout.TextX, textY, ogcard.FontTitle, ogcard.ColorMuted, ogcard.AlignLeft, false) 88 + card.DrawText(repository, layout.TextX+float64(ownerWidth), textY, ogcard.FontTitle, ogcard.ColorText, ogcard.AlignLeft, true) 89 + } 90 + 91 + // Track current Y position for description 83 92 if description != "" { 84 93 textY += ogcard.LineSpacingSmall 85 94 card.DrawTextWrapped(description, layout.TextX, textY, ogcard.FontDescription, ogcard.ColorMuted, layout.MaxWidth, false)