Skip to content

fix: cap JSON editor max height at 400px in message views - #3842

Merged
Pratham-Mishra04 merged 1 commit into
devfrom
05-28-refactor_prompt_messages_json_content_view
May 28, 2026
Merged

Pratham-Mishra04 merged 1 commit into
devfrom
05-28-refactor_prompt_messages_json_content_view

Conversation

@impoiler

Copy link
Copy Markdown
Contributor

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

  • Bug fix

Affected areas

  • 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.
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

  • 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

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (5)
  • ui/components/prompts/components/messagesView/assistantMessageView.tsx is excluded by none and included by none
  • ui/components/prompts/components/messagesView/systemMessageView.tsx is excluded by none and included by none
  • ui/components/prompts/components/messagesView/toolCallResultView.tsx is excluded by none and included by none
  • ui/components/prompts/components/messagesView/toolCallView.tsx is excluded by none and included by none
  • ui/components/prompts/components/messagesView/userMessageView.tsx is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e84d5f38-9e50-4e7b-80a1-9c4729a3a6d0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-28-refactor_prompt_messages_json_content_view

Comment @coderabbitai help to get the list of available commands and usage tips.

impoiler commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@impoiler impoiler self-assigned this May 28, 2026
@impoiler
impoiler marked this pull request as ready for review May 28, 2026 12:09

Pratham-Mishra04 commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Merge activity

  • May 28, 12:09 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 28, 12:12 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 28, 12:13 PM UTC: @Pratham-Mishra04 merged this pull request with Graphite.

@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from 05-28-feat_enable_tool_execution_in_the_prompt_playground to graphite-base/3842 May 28, 2026 12:10
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/3842 to dev May 28, 2026 12:10
@greptile-apps

greptile-apps Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

The height cap is applied correctly, but content above 400px will be clipped and unreachable until vertical scrolling is also enabled.

The maxHeight prop stops the editor from growing, but codeEditor.tsx defaults the Monaco vertical scrollbar to hidden — meaning any JSON taller than 400px is silently cut off rather than scrollable. The PR's stated goal (content becomes scrollable at the cap) is not met without also setting showVerticalScrollbar: true in the options prop across all five changed files.

All five changed message-view files need options={{ showVerticalScrollbar: true }} added alongside maxHeight={400}.

Important Files Changed

Filename Overview
ui/components/prompts/components/messagesView/assistantMessageView.tsx Adds maxHeight={400} to cap JSON editor growth, but omits showVerticalScrollbar: true — content beyond 400px is unreachable
ui/components/prompts/components/messagesView/systemMessageView.tsx Same maxHeight cap without enabling vertical scroll — overflow content inaccessible
ui/components/prompts/components/messagesView/toolCallResultView.tsx Same maxHeight cap without enabling vertical scroll — overflow content inaccessible
ui/components/prompts/components/messagesView/toolCallView.tsx Same maxHeight cap without enabling vertical scroll — overflow content inaccessible
ui/components/prompts/components/messagesView/userMessageView.tsx Same maxHeight cap without enabling vertical scroll — overflow content inaccessible

Reviews (2): Last reviewed commit: "refactor: prompt messages json content v..." | Re-trigger Greptile

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 05-28-refactor_prompt_messages_json_content_view branch from ed09384 to f2c568b Compare May 28, 2026 12:11
@Pratham-Mishra04
Pratham-Mishra04 merged commit d04947a into dev May 28, 2026
14 checks passed
Comment on lines 165 to +168
lang="json"
readonly={disabled}
autoResize
maxHeight={400}

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.

P1 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).

@Pratham-Mishra04
Pratham-Mishra04 deleted the 05-28-refactor_prompt_messages_json_content_view branch May 28, 2026 12:13
akshaydeo pushed a commit that referenced this pull request May 29, 2026
## 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
@akshaydeo akshaydeo mentioned this pull request May 29, 2026
akshaydeo added a commit that referenced this pull request May 29, 2026
## ✨ 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)
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## 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
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
## ✨ 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)
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## 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
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
## ✨ 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants