Fix MCP JSON viewer key vertically centered against tall expanded string - #14949
Merged
Conversation
warp-agent-staging
Bot
force-pushed
the
fix/mcp-json-tree-key-alignment-app-5312
branch
from
August 11, 2026 19:41
949d928 to
58a5e79
Compare
Group the chevron and key label of a long-string JSON tree row into their own nested row, centered against each other, and give the outer row unconditional top alignment. The chevron now always centers against its key's line box, while that pair top-aligns with the value's first line regardless of how tall the value is -- with no branch on expansion state. Fixes APP-5312. Co-Authored-By: Warp Agent <agent@warp.dev>
warp-agent-staging
Bot
force-pushed
the
fix/mcp-json-tree-key-alignment-app-5312
branch
from
August 11, 2026 19:45
58a5e79 to
cd54f2e
Compare
acarl005
approved these changes
Aug 11, 2026
acarl005
marked this pull request as ready for review
August 11, 2026 19:47
iamwavecut
pushed a commit
to iamwavecut/warp
that referenced
this pull request
Aug 12, 2026
…ing (warpdotdev#14949) ## Description Fixes the MCP JSON viewer key alignment bug reported in Slack: when the request/response JSON tree for an MCP tool call is expanded and a key's string value is expanded and wraps to many lines (e.g. a long multi-line `note` field), the key label and chevron were vertically **centered** against the whole tall value block instead of sitting on the value's first line. Root cause: `render_long_string_row` in `app/src/ui_components/json_tree.rs` put the chevron, key label, and value into a single `Flex::row()` with `CrossAxisAlignment::Center`. That's correct while the value is a single line, but once the expanded string wraps to multiple lines, `Center` centers the chevron/key against the *entire* value block instead of its first line. ## Linked Issue Fixes [APP-5312](https://linear.app/warpdotdev/issue/APP-5312/mcp-json-viewer-key-vertically-centered-against-tall-expanded-string). - [x] Screenshots included below. ## Changes - `render_long_string_row`: group the chevron and key label into their own nested `Flex::row()` with `CrossAxisAlignment::Center` (so they stay centered against each other, as before), and add that group as a single child of the outer row, which now uses `CrossAxisAlignment::Start` unconditionally. The chevron+key pair's line box top-aligns with the value's first line, whatever the value's height — so there's no longer a branch on expansion state, and the row looks the same as before for single-line (collapsed/short) values. - `render_container_node` and `render_scalar_row` were left untouched — their rows only ever render a single line of content, so they can't exhibit this bug, and their output is unaffected by this change. ## Testing - `cargo build -p warp --bin warp` — succeeds. - `cargo clippy -p warp --all-targets --tests -- -D warnings` — passes with no new warnings. - `cargo nextest run -p warp --lib json_tree` — all 34 existing `json_tree` unit tests pass unchanged. - Per the requester's instruction, no new tests or comments were added. ### Screenshots / Videos Verified by driving the actual `render_json_tree` / `render_long_string_row` production code path (from `app/src/ui_components/json_tree.rs`) in a temporary, uncommitted scratch example, with a payload shaped like the report: an object with a few short keys (`id`, `status`) and one long `note` value that wraps to ~30 lines, rendered both collapsed and expanded. Full window — both sections:  Close-up of the expanded `note` row — the chevron is centered against the `note:` label as a pair, and that pair sits on the value's first line:  Observed: the `id`/`status` single-line rows and the collapsed `note` row (single-line truncated preview) are pixel-unaffected and identical across both sections — only the expanded, multi-line case changes. - [ ] I have manually tested my changes locally with `./script/run` ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode CHANGELOG-BUG-FIX: Fixed the MCP tool-call JSON viewer's key/chevron being vertically centered against a tall expanded multi-line string value instead of aligned to its top. _Conversation: https://staging.warp.dev/conversation/2b5f2fc5-0a58-4b64-ae97-899f9985870b_ _Run: https://oz.staging.warp.dev/runs/019ff1e8-1dd5-707a-a1f8-46dd41a7c505_ _This PR was generated with [Oz](https://warp.dev/oz)._ Co-authored-by: Oz <oz-agent@warp.dev> Co-authored-by: Warp Agent <agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the MCP JSON viewer key alignment bug reported in Slack: when the request/response JSON tree for an MCP tool call is expanded and a key's string value is expanded and wraps to many lines (e.g. a long multi-line
notefield), the key label and chevron were vertically centered against the whole tall value block instead of sitting on the value's first line.Root cause:
render_long_string_rowinapp/src/ui_components/json_tree.rsput the chevron, key label, and value into a singleFlex::row()withCrossAxisAlignment::Center. That's correct while the value is a single line, but once the expanded string wraps to multiple lines,Centercenters the chevron/key against the entire value block instead of its first line.Linked Issue
Fixes APP-5312.
Changes
render_long_string_row: group the chevron and key label into their own nestedFlex::row()withCrossAxisAlignment::Center(so they stay centered against each other, as before), and add that group as a single child of the outer row, which now usesCrossAxisAlignment::Startunconditionally. The chevron+key pair's line box top-aligns with the value's first line, whatever the value's height — so there's no longer a branch on expansion state, and the row looks the same as before for single-line (collapsed/short) values.render_container_nodeandrender_scalar_rowwere left untouched — their rows only ever render a single line of content, so they can't exhibit this bug, and their output is unaffected by this change.Testing
cargo build -p warp --bin warp— succeeds.cargo clippy -p warp --all-targets --tests -- -D warnings— passes with no new warnings.cargo nextest run -p warp --lib json_tree— all 34 existingjson_treeunit tests pass unchanged.Screenshots / Videos
Verified by driving the actual
render_json_tree/render_long_string_rowproduction code path (fromapp/src/ui_components/json_tree.rs) in a temporary, uncommitted scratch example, with a payload shaped like the report: an object with a few short keys (id,status) and one longnotevalue that wraps to ~30 lines, rendered both collapsed and expanded.Full window — both sections:
Close-up of the expanded
noterow — the chevron is centered against thenote:label as a pair, and that pair sits on the value's first line:Observed: the
id/statussingle-line rows and the collapsednoterow (single-line truncated preview) are pixel-unaffected and identical across both sections — only the expanded, multi-line case changes../script/runAgent Mode
CHANGELOG-BUG-FIX: Fixed the MCP tool-call JSON viewer's key/chevron being vertically centered against a tall expanded multi-line string value instead of aligned to its top.
Conversation: https://staging.warp.dev/conversation/2b5f2fc5-0a58-4b64-ae97-899f9985870b
Run: https://oz.staging.warp.dev/runs/019ff1e8-1dd5-707a-a1f8-46dd41a7c505
This PR was generated with Oz.