zed/docs/src/development
Richard Feldman b5ac0f9bc6
Render images in agent threads (#46167)
Now when the agent reads images (which the tool now explicitly
advertises to agents that it is capable of; previously the tool said it
could only read text even though it can actually read images), we see
them in the thread, and also they are auto-expanded by default so you
can see them when scrolling through:

<img width="725" height="1019" alt="Screenshot 2026-01-06 at 2 57 11 PM"
src="https://github.com/user-attachments/assets/5c908bad-48f2-46c2-afaa-7f189a178e05"
/>

This also adds a visual regression test that verifies images render
correctly in the agent thread view.

Unlike our previous visual tests, this one only renders the agent panel,
not the entire Zed window.

The "screenshot" it generates (rendered to a Metal texture) is from
completely mocked/simulated data structures, and looks like this:

<img width="546" height="984" alt="Screenshot 2026-01-06 at 2 54 41 PM"
src="https://github.com/user-attachments/assets/89a0921f-59e9-4dfe-94b2-4c3b625a851b"
/>

## Changes

- **New visual test**: `agent_thread_with_image` renders an
`AcpThreadView` containing a tool call with image content (the Zed app
icon)
- **Test infrastructure**: Added `StubAgentServer` helper and required
feature flags for visual testing
- **Test-support API**: Added `expand_tool_call()` method to
`AcpThreadView` to allow expanding tool calls for visual testing
- **Baseline screenshot**: Included baseline image showing the Zed logo
rendered in a tool call output

## How to run

```bash
# Run the visual tests
cargo run -p zed --bin visual_test_runner --features visual-tests

# Update baselines if UI intentionally changed  
UPDATE_BASELINE=1 cargo run -p zed --bin visual_test_runner --features visual-tests
```

Release Notes:
- N/A

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Amp <amp@ampcode.com>
2026-01-06 19:48:49 -05:00
..
debuggers.md Fix a typo: to -> two (#44272) 2025-12-06 09:35:18 +02:00
debugging-crashes.md Update crash handling docs (#38026) 2025-09-12 03:00:35 +00:00
freebsd.md docs: Add FreeBSD build instructions and current status (#33617) 2025-07-01 15:18:34 +00:00
glossary.md glossary: Fix grammar and typo (#45267) 2025-12-18 17:03:46 +00:00
linux.md docs: Remove local collaboration docs (#45301) 2025-12-18 21:42:28 +00:00
macos.md Render images in agent threads (#46167) 2026-01-06 19:48:49 -05:00
release-notes.md docs: Fix broken links in docs with lychee (#42404) 2025-11-11 13:55:02 +01:00
windows.md Screenshot testing (#45259) 2026-01-05 16:34:36 -05:00