Skip to content

Center the agent icon in the footprint render_icon_with_status reserves - #14930

Open
bobrnor wants to merge 2 commits into
warpdotdev:masterfrom
bobrnor:coral-wandering-marsh
Open

Center the agent icon in the footprint render_icon_with_status reserves#14930
bobrnor wants to merge 2 commits into
warpdotdev:masterfrom
bobrnor:coral-wandering-marsh

Conversation

@bobrnor

@bobrnor bobrnor commented Aug 11, 2026

Copy link
Copy Markdown

Description

Every surface that draws an agent avatar — the vertical tabs sidebar, the conversation list, agent notifications, ambient agent blocks, pane rows — has been rendering it flush against the top-left of the box it reserves, instead of centered in it. Two things fall out of that, and both are visible:

  • The trailing gap is wrong. render_icon_with_status reserves a total_size square, but the brand circle is only CIRCLE_RATIO (0.76) of it. Left-aligned, the remaining 24% piles up as dead space on the right, on top of whatever gap the caller already asked for. In the vertical tabs sidebar that reads as ~14px between the avatar and the title where ICON_WITH_STATUS_GAP asks for 8.
  • The status badge falls off the circle. corner_overlay_offset anchors the badge to the box's bottom-right corner. That geometry only puts the badge inside the circle's edge — which is what the comment on CIRCLE_RATIO says it is for — while the circle is centered in the box. Left-aligned, the badge's center lands outside the circle and the badge reads as hanging off the avatar.

The cause is that neither ConstrainedBox nor Stack centers a child: ConstrainedBox::layout only tightens the constraint it passes down and then paints the child at the origin it was handed, and Stack takes its size from constraint.min but likewise paints non-positioned children at its own origin. So the reserved footprint was correct and the artwork inside it was not. Routing the circle through an Align fixes both symptoms at once, and makes the two comments that already describe the intended geometry true.

Reported against the vertical tabs sidebar; the fix is in the shared component, so it lands everywhere.

Linked Issue

Closes #14958.

Related

warpdotdev/warp#14893 hit the same defect in the orchestration pill bar and worked around it there, centering inside its own CustomAvatar element and leaving icon_with_status.rs as a comments-only diff. That PR's avatar already fills the whole total_size box, so centering an element the size of its container is a no-op and the two changes compose without double-centering.

Testing

brand_circle_is_centered_in_the_reserved_footprint renders the component into a headless presenter and reads the painted rect straight out of the scene, so this is measured rather than eyeballed:

painted origin of the brand circle
before (0.0, 0.0)
after (2.88, 2.88)

2.88 is 24 * (1 - 0.76) / 2 — the circle centered in a 24px footprint. The test fails on the pre-fix code with exactly that diff, so it pins the behavior rather than passing vacuously.

./script/format, cargo clippy -p warp --all-targets --tests -- -D warnings, and cargo nextest run -p warp --lib icon_with_status (4/4) are clean.

  • I have manually tested my changes locally with ./script/run

Not checked deliberately: ./script/run builds the OSS channel without internal channel-config access, and a fresh instance has no agent conversation to draw an avatar for, so it cannot show this surface. The scene-level assertion above is the evidence; a look at the sidebar on a build with real agent panes is still worth having before merge.

Screenshots / Videos

To be attached.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

Compound Engineering

`render_icon_with_status` reserves a `total_size` square through `Stack::layout`'s
`constraint.min`, but the brand circle inside it is only `CIRCLE_RATIO` (0.76) of that,
and neither `ConstrainedBox` nor `Stack` centers a child -- both paint at the origin. The
circle was left flush against the box's top-left with `total_size * 0.24` of dead space on
its right and bottom.

That has two visible consequences on every surface carrying an agent avatar:

- The trailing gap grows by the slack. The vertical tabs sidebar rendered ~14px between
  the avatar and the title instead of the 8px `ICON_WITH_STATUS_GAP` asks for.
- `corner_overlay_offset` anchors the status badge to the box's bottom-right, which only
  lands inside the circle's edge while the circle is centered. Left-aligned, the badge sat
  clear of the circle instead of tucked into it.

Routing the circle through an `Align` restores both. The new test reads the painted rect
out of the scene: the circle moves from (0, 0) to (2.88, 2.88) in a 24px footprint.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LF4ZTotC6MZwg1DAto3VRt
@cla-bot cla-bot Bot added the cla-signed label Aug 11, 2026
@oz-for-oss

oz-for-oss Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@bobrnor

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Aug 11, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bobrnor

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

The comment claimed a left-aligned circle also grew the caller's trailing gap
by the slack. It does not: `ConstrainedBox` reports the size it was constrained
to, not its child's, so the component reserves the full footprint either way.
What the misalignment actually breaks is the badge, which is anchored to the
footprint's corner and so floats detached once the circle pulls away from it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LF4ZTotC6MZwg1DAto3VRt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent avatar renders flush top-left in its reserved box, widening the title gap and pushing the status badge off the circle

1 participant