fix: cap JSON editor max height at 400px in message views - #3842
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (5)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
Confidence Score: 4/5The height cap is applied correctly, but content above 400px will be clipped and unreachable until vertical scrolling is also enabled. The All five changed message-view files need Important Files Changed
Reviews (2): Last reviewed commit: "refactor: prompt messages json content v..." | Re-trigger Greptile |
ed09384 to
f2c568b
Compare
| lang="json" | ||
| readonly={disabled} | ||
| autoResize | ||
| maxHeight={400} |
There was a problem hiding this comment.
Content above 400px is silently clipped — no vertical scrollbar
codeEditor.tsx line 162 sets vertical: props.options?.showVerticalScrollbar ? "auto" : "hidden", so the vertical scrollbar is hidden by default. When maxHeight={400} clamps the auto-resize, Monaco's container stops growing but the internal scrollbar remains hidden, making any JSON taller than 400px completely inaccessible. The PR description says the editor should "become scrollable" at the cap, but without showVerticalScrollbar: true in options, overflow content is just cut off. The same fix is needed in all five changed files (systemMessageView.tsx, toolCallResultView.tsx, toolCallView.tsx, userMessageView.tsx).
## Summary
JSON editors in the message views (assistant, system, user, tool call, and tool call result) could grow unbounded when displaying large JSON payloads, making the UI difficult to use. This PR caps the auto-resizing height of those editors at 400px.
## Changes
- Added `maxHeight={400}` to the auto-resizing JSON editor in each message view component, preventing the editor from expanding beyond 400px regardless of content size.
## Type of change
- [x] Bug fix
## Affected areas
- [x] UI (React)
## How to test
1. Open a prompt with a message containing a large JSON payload (assistant, system, user, tool call, or tool call result).
2. Verify that the JSON editor expands as content grows but stops at 400px and becomes scrollable rather than continuing to expand.
```sh
cd ui
pnpm i || npm i
pnpm build || npm run build
```
## Screenshots/Recordings
Before: JSON editors expand to the full height of the content, pushing other elements far down the page.
After: JSON editors cap at 400px and scroll internally for content that exceeds that height.
## Breaking changes
- [x] No
## Related issues
## Security considerations
None.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
## ✨ Features - **Direct API Key Header** - Pass a provider API key directly via request header (#3817) - **MCP Per-User Authentication** - New per-user header auth type with credential storage and lazy-auth submission flow (#3703, #3704, #3705) - **MCP TLS Configuration** - Configurable TLS (insecureSkipVerify, caCertPem) for HTTP/SSE MCP client connections (#3779, #3783) - **MCP Sessions Management** - Filter, search, and pagination on the MCP sessions list API and table, plus a can_reauth identity gate (#3823, #3824, #3825) - **Tool Call Execution UI** - Inline tool-call execution, stop streaming, bulk execute/submit, and a redesigned tool-call UI (#3837, #3843) - **Dimension Rankings Dashboard** - New dashboard tabs for team, customer, BU, and user rankings, backed by a GetDimensionRankings API (#3766) - **Model Pricing Attributes** - additional_attributes on model pricing rows with management API and UI editor (#3829) - **Prompt Cache Retention** - Prompt cache retention parameter on responses requests (#3810) - **Opus 4.8 Support** - System message handling and compatibility for Opus 4.8 (#3878, #3868) - **Key Rotation** - Rotate keys on 401/402/403 and return 502 upstream_credentials_exhausted when all keys are permanently dead (#3491) - **OTel Metrics** - OTel spec compatible metrics plus provider and semantic cache attributes in metrics export (#3865, #3816) - **Sheet Navigation** - Prev/next keyboard navigation and URL state across virtual key, MCP client, and routing rule sheets (#3739, #3740, #3744, #3745) - **Go 1.26.3** - Upgraded toolchain to Go 1.26.3 (#3782) ## 🐞 Fixed - **Bedrock Tool Names** - Truncate Bedrock function/tool names to the provider length limit - **Bedrock Guardrails** - Set guardrail config in Bedrock request built from responses (#3862) - **Anthropic Tool Use** - Default Anthropic tool_use input to {} when arguments are absent (#3880) - **Responses Streaming** - Fixed responses stream events (#3838) - **Compat Flow** - Fixed missing parameter parsing on the compat flow (#3881) - **Passthrough API Version** - Set a default API version in passthrough requests as a fallback (#3853) - **Virtual Key Updates** - Avoid overriding optional fields during virtual key update (#3855) - **User-Mode Flows** - Gate user-mode flows on caller user_id, skip temp token mint, and unify flow/credential kind filtering for pending flows (#3841, #3859) - **Partial Tool Calls** - Handle partial tool call execution failures and return successful results (#3849) - **URL Query Escaping** - Support escaped characters in URL query parameters (#3826) - **MCP Auth Errors** - Inline banner and retry support for MCP auth-required errors (#3856) - **JSON Editor Height** - Cap JSON editor max height at 400px in message views (#3842)
## Summary
JSON editors in the message views (assistant, system, user, tool call, and tool call result) could grow unbounded when displaying large JSON payloads, making the UI difficult to use. This PR caps the auto-resizing height of those editors at 400px.
## Changes
- Added `maxHeight={400}` to the auto-resizing JSON editor in each message view component, preventing the editor from expanding beyond 400px regardless of content size.
## Type of change
- [x] Bug fix
## Affected areas
- [x] UI (React)
## How to test
1. Open a prompt with a message containing a large JSON payload (assistant, system, user, tool call, or tool call result).
2. Verify that the JSON editor expands as content grows but stops at 400px and becomes scrollable rather than continuing to expand.
```sh
cd ui
pnpm i || npm i
pnpm build || npm run build
```
## Screenshots/Recordings
Before: JSON editors expand to the full height of the content, pushing other elements far down the page.
After: JSON editors cap at 400px and scroll internally for content that exceeds that height.
## Breaking changes
- [x] No
## Related issues
## Security considerations
None.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
## ✨ Features - **Direct API Key Header** - Pass a provider API key directly via request header (maximhq#3817) - **MCP Per-User Authentication** - New per-user header auth type with credential storage and lazy-auth submission flow (maximhq#3703, maximhq#3704, maximhq#3705) - **MCP TLS Configuration** - Configurable TLS (insecureSkipVerify, caCertPem) for HTTP/SSE MCP client connections (maximhq#3779, maximhq#3783) - **MCP Sessions Management** - Filter, search, and pagination on the MCP sessions list API and table, plus a can_reauth identity gate (maximhq#3823, maximhq#3824, maximhq#3825) - **Tool Call Execution UI** - Inline tool-call execution, stop streaming, bulk execute/submit, and a redesigned tool-call UI (maximhq#3837, maximhq#3843) - **Dimension Rankings Dashboard** - New dashboard tabs for team, customer, BU, and user rankings, backed by a GetDimensionRankings API (maximhq#3766) - **Model Pricing Attributes** - additional_attributes on model pricing rows with management API and UI editor (maximhq#3829) - **Prompt Cache Retention** - Prompt cache retention parameter on responses requests (maximhq#3810) - **Opus 4.8 Support** - System message handling and compatibility for Opus 4.8 (maximhq#3878, maximhq#3868) - **Key Rotation** - Rotate keys on 401/402/403 and return 502 upstream_credentials_exhausted when all keys are permanently dead (maximhq#3491) - **OTel Metrics** - OTel spec compatible metrics plus provider and semantic cache attributes in metrics export (maximhq#3865, maximhq#3816) - **Sheet Navigation** - Prev/next keyboard navigation and URL state across virtual key, MCP client, and routing rule sheets (maximhq#3739, maximhq#3740, maximhq#3744, maximhq#3745) - **Go 1.26.3** - Upgraded toolchain to Go 1.26.3 (maximhq#3782) ## 🐞 Fixed - **Bedrock Tool Names** - Truncate Bedrock function/tool names to the provider length limit - **Bedrock Guardrails** - Set guardrail config in Bedrock request built from responses (maximhq#3862) - **Anthropic Tool Use** - Default Anthropic tool_use input to {} when arguments are absent (maximhq#3880) - **Responses Streaming** - Fixed responses stream events (maximhq#3838) - **Compat Flow** - Fixed missing parameter parsing on the compat flow (maximhq#3881) - **Passthrough API Version** - Set a default API version in passthrough requests as a fallback (maximhq#3853) - **Virtual Key Updates** - Avoid overriding optional fields during virtual key update (maximhq#3855) - **User-Mode Flows** - Gate user-mode flows on caller user_id, skip temp token mint, and unify flow/credential kind filtering for pending flows (maximhq#3841, maximhq#3859) - **Partial Tool Calls** - Handle partial tool call execution failures and return successful results (maximhq#3849) - **URL Query Escaping** - Support escaped characters in URL query parameters (maximhq#3826) - **MCP Auth Errors** - Inline banner and retry support for MCP auth-required errors (maximhq#3856) - **JSON Editor Height** - Cap JSON editor max height at 400px in message views (maximhq#3842)
## Summary
JSON editors in the message views (assistant, system, user, tool call, and tool call result) could grow unbounded when displaying large JSON payloads, making the UI difficult to use. This PR caps the auto-resizing height of those editors at 400px.
## Changes
- Added `maxHeight={400}` to the auto-resizing JSON editor in each message view component, preventing the editor from expanding beyond 400px regardless of content size.
## Type of change
- [x] Bug fix
## Affected areas
- [x] UI (React)
## How to test
1. Open a prompt with a message containing a large JSON payload (assistant, system, user, tool call, or tool call result).
2. Verify that the JSON editor expands as content grows but stops at 400px and becomes scrollable rather than continuing to expand.
```sh
cd ui
pnpm i || npm i
pnpm build || npm run build
```
## Screenshots/Recordings
Before: JSON editors expand to the full height of the content, pushing other elements far down the page.
After: JSON editors cap at 400px and scroll internally for content that exceeds that height.
## Breaking changes
- [x] No
## Related issues
## Security considerations
None.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
## ✨ Features - **Direct API Key Header** - Pass a provider API key directly via request header (maximhq#3817) - **MCP Per-User Authentication** - New per-user header auth type with credential storage and lazy-auth submission flow (maximhq#3703, maximhq#3704, maximhq#3705) - **MCP TLS Configuration** - Configurable TLS (insecureSkipVerify, caCertPem) for HTTP/SSE MCP client connections (maximhq#3779, maximhq#3783) - **MCP Sessions Management** - Filter, search, and pagination on the MCP sessions list API and table, plus a can_reauth identity gate (maximhq#3823, maximhq#3824, maximhq#3825) - **Tool Call Execution UI** - Inline tool-call execution, stop streaming, bulk execute/submit, and a redesigned tool-call UI (maximhq#3837, maximhq#3843) - **Dimension Rankings Dashboard** - New dashboard tabs for team, customer, BU, and user rankings, backed by a GetDimensionRankings API (maximhq#3766) - **Model Pricing Attributes** - additional_attributes on model pricing rows with management API and UI editor (maximhq#3829) - **Prompt Cache Retention** - Prompt cache retention parameter on responses requests (maximhq#3810) - **Opus 4.8 Support** - System message handling and compatibility for Opus 4.8 (maximhq#3878, maximhq#3868) - **Key Rotation** - Rotate keys on 401/402/403 and return 502 upstream_credentials_exhausted when all keys are permanently dead (maximhq#3491) - **OTel Metrics** - OTel spec compatible metrics plus provider and semantic cache attributes in metrics export (maximhq#3865, maximhq#3816) - **Sheet Navigation** - Prev/next keyboard navigation and URL state across virtual key, MCP client, and routing rule sheets (maximhq#3739, maximhq#3740, maximhq#3744, maximhq#3745) - **Go 1.26.3** - Upgraded toolchain to Go 1.26.3 (maximhq#3782) ## 🐞 Fixed - **Bedrock Tool Names** - Truncate Bedrock function/tool names to the provider length limit - **Bedrock Guardrails** - Set guardrail config in Bedrock request built from responses (maximhq#3862) - **Anthropic Tool Use** - Default Anthropic tool_use input to {} when arguments are absent (maximhq#3880) - **Responses Streaming** - Fixed responses stream events (maximhq#3838) - **Compat Flow** - Fixed missing parameter parsing on the compat flow (maximhq#3881) - **Passthrough API Version** - Set a default API version in passthrough requests as a fallback (maximhq#3853) - **Virtual Key Updates** - Avoid overriding optional fields during virtual key update (maximhq#3855) - **User-Mode Flows** - Gate user-mode flows on caller user_id, skip temp token mint, and unify flow/credential kind filtering for pending flows (maximhq#3841, maximhq#3859) - **Partial Tool Calls** - Handle partial tool call execution failures and return successful results (maximhq#3849) - **URL Query Escaping** - Support escaped characters in URL query parameters (maximhq#3826) - **MCP Auth Errors** - Inline banner and retry support for MCP auth-required errors (maximhq#3856) - **JSON Editor Height** - Cap JSON editor max height at 400px in message views (maximhq#3842)

Summary
JSON editors in the message views (assistant, system, user, tool call, and tool call result) could grow unbounded when displaying large JSON payloads, making the UI difficult to use. This PR caps the auto-resizing height of those editors at 400px.
Changes
maxHeight={400}to the auto-resizing JSON editor in each message view component, preventing the editor from expanding beyond 400px regardless of content size.Type of change
Affected areas
How to test
Screenshots/Recordings
Before: JSON editors expand to the full height of the content, pushing other elements far down the page.
After: JSON editors cap at 400px and scroll internally for content that exceeds that height.
Breaking changes
Related issues
Security considerations
None.
Checklist
docs/contributing/README.mdand followed the guidelines