Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/open-api-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.0.3
info:
title: The Agent's user-facing API
description: The user-facing parts of The Agent's API service (excluding system-level endpoints, chat completion, maintenance endpoints, etc.)
version: 5.16.0
version: 5.16.1
license:
name: MIT
url: https://opensource.org/licenses/MIT
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "the-agent"
version = "5.16.0"
version = "5.16.1"

[tool.setuptools]
package-dir = {"" = "src"}
Expand Down
3 changes: 2 additions & 1 deletion src/features/social_cards/card_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
PHOTO_GAP = 4 # gap between stacked photos
AVATAR_SIZE = 64
AVATAR_GAP = 16 # gap between avatar and name column
LOGO_SIZE = 40
LOGO_SIZE = 32
LOGO_CIRCLE_R = 26
X_ICON_SIZE = 12 # footer X/Twitter icon
HEADER_HEIGHT = AVATAR_SIZE + CARD_INNER_PAD
DIVIDER_OPACITY = 0.2
Expand Down
19 changes: 16 additions & 3 deletions src/features/social_cards/card_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
FONT_SIZE_NAME,
FOOTER_OPACITY,
LINE_HEIGHT_BODY,
LOGO_CIRCLE_R,
LOGO_SIZE,
PHOTO_CORNER_RADIUS,
PHOTO_GAP,
Expand Down Expand Up @@ -400,11 +401,23 @@ def _name_segments(text: str) -> list[tuple[str, str, str, bool]]:
f'fill="{theme.text_color}" fill-opacity="0.7">{dt_str}</text>',
)

# Agent logo (top-right)
logo_x = cx + card_width - CARD_INNER_PAD - LOGO_SIZE
logo_y = y + (AVATAR_SIZE - LOGO_SIZE) // 2
# Agent logo (top-right) with contrast circle
logo_cx = cx + card_width - CARD_INNER_PAD - LOGO_CIRCLE_R
logo_cy = y + AVATAR_SIZE // 2
logo_key = _agent_logo_key(theme)
logo_b64 = _logo_svg_b64(logo_key)
if logo_key == "agent_logo_color":
content.append(
f'<circle cx="{logo_cx}" cy="{logo_cy}" r="{LOGO_CIRCLE_R}" '
f'fill="{theme.text_color}" fill-opacity="0.5"/>',
)
else:
content.append(
f'<circle cx="{logo_cx}" cy="{logo_cy}" r="{LOGO_CIRCLE_R}" '
f'fill="none" stroke="{theme.text_color}" stroke-width="1.3"/>',
)
logo_x = logo_cx - LOGO_SIZE // 2
logo_y = logo_cy - LOGO_SIZE // 2 - round(LOGO_SIZE * 0.05)
logo_opacity = ' opacity="0.8"' if logo_key != "agent_logo_color" else ""
content.append(
f'<image x="{logo_x}" y="{logo_y}" width="{LOGO_SIZE}" height="{LOGO_SIZE}" href="{logo_b64}"{logo_opacity}/>',
Expand Down
Loading