Skip to content

feat(ws): improve message panel UX - #8465

Merged
sid-bruno merged 5 commits into
usebruno:mainfrom
pooja-bruno:feat/websocket-message-panel-enhancements
Jul 6, 2026
Merged

sid-bruno merged 5 commits into
usebruno:mainfrom
pooja-bruno:feat/websocket-message-panel-enhancements

Conversation

@pooja-bruno

@pooja-bruno pooja-bruno commented Jul 2, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Sticky active-message header while scrolling its body
  • Removed the divider below the last message
  • New messages default to an empty body (... placeholder) instead of {}
  • Better active-message highlight for Dark Monochrome themes

JIRA

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • New Features
    • Added dedicated theming for active WebSocket message labels across supported themes.
  • Bug Fixes
    • New WebSocket messages now default to an empty body (instead of {}).
    • Updated WebSocket message styling: last row border is removed; enabled accordion headers are sticky; improved stacking behavior for the message list.
    • Tightened WebSocket request schema to require activeMessage.label.
  • Tests
    • Added Playwright coverage for the default WebSocket message body and updated WebSocket fixtures accordingly.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: adf295e7-40c5-43f4-9948-5b1791da7dec

📥 Commits

Reviewing files that changed from the base of the PR and between 90cb493 and 7e02ba2.

📒 Files selected for processing (15)
  • packages/bruno-app/src/components/RequestPane/WsBody/BodyMode/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/WsBody/SingleWSMessage/StyledWrapper.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
  • packages/bruno-app/src/themes/dark/catppuccin-frappe.js
  • packages/bruno-app/src/themes/dark/catppuccin-macchiato.js
  • packages/bruno-app/src/themes/dark/catppuccin-mocha.js
  • packages/bruno-app/src/themes/dark/dark-pastel.js
  • packages/bruno-app/src/themes/dark/dark.js
  • packages/bruno-app/src/themes/dark/nord.js
  • packages/bruno-app/src/themes/dark/vscode.js
  • packages/bruno-app/src/themes/light/catppuccin-latte.js
  • packages/bruno-app/src/themes/light/light-monochrome.js
  • packages/bruno-app/src/themes/light/light-pastel.js
  • packages/bruno-app/src/themes/light/light.js
  • packages/bruno-app/src/themes/light/vscode.js
✅ Files skipped from review due to trivial changes (2)
  • packages/bruno-app/src/themes/light/catppuccin-latte.js
  • packages/bruno-app/src/themes/dark/vscode.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/bruno-app/src/components/RequestPane/WsBody/SingleWSMessage/StyledWrapper.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js

Walkthrough

WebSocket message creation now initializes empty content, and WS schema/theme data add ws.activeMessage.label for active-message styling. The WS message UI uses that token, updates header behavior, and adds test coverage for the empty-body default.

Changes

WebSocket Default Body and Message Styling

Layer / File(s) Summary
Default WS body and test coverage
packages/bruno-app/src/components/RequestPane/WSRequestPane/index.js, packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js, tests/websockets/fixtures/collection/ws-default-body-request.bru, tests/websockets/message-body-default.spec.ts
New WS message templates use an empty content string, and the fixture plus Playwright test verify the default empty-body behavior.
WS schema and theme label values
packages/bruno-app/src/themes/schema/oss.js, packages/bruno-app/src/themes/dark/*.js, packages/bruno-app/src/themes/light/*.js
Adds request.ws.activeMessage.label to the schema and defines ws.activeMessage.label values across dark and light theme variants.
WS message label and wrapper styling
packages/bruno-app/src/components/RequestPane/WsBody/BodyMode/StyledWrapper.js, packages/bruno-app/src/components/RequestPane/WsBody/SingleWSMessage/StyledWrapper.js, packages/bruno-app/src/components/RequestPane/WsBody/StyledWrapper.js
WS message label color now comes from theme.ws.activeMessage.label, the accordion header is sticky for enabled messages, the last row drops its divider, and the messages container uses isolation: isolate.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • usebruno/bruno#6184: Both modify the newWsRequest default WebSocket request template in packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js.
  • usebruno/bruno#7719: Both touch the WS multi-message accordion styling in SingleWSMessage/StyledWrapper.js.
  • usebruno/bruno#8115: Both change default WS message content handling and related WS message UI styling.

Suggested reviewers: helloanoop, bijin-bruno, lohit-bruno, naman-bruno

Poem

A curly brace drifted away,
Leaving quiet space to stay.
WS labels glow in theme-lit air,
Headers stick with steady care.
Tests hum softly: all is okay ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the websocket message panel UX improvements in this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
tests/websockets/message-body-default.spec.ts (1)

11-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Wrap steps in test.step for clearer reports.

The test performs distinct phases (open request, add message, assert placeholder) but doesn't use test.step, making failure reports less granular.

♻️ Proposed refactor
   test('a newly added message defaults to an empty body showing the placeholder', async ({
     pageWithUserData: page
   }) => {
-    // Open the preloaded websocket request
-    await page.getByTestId('sidebar-collection-row').click();
-    await page.getByTitle(REQ_NAME).click();
-
-    const headers = page.getByTestId(/^ws-message-header-/);
-    const beforeCount = await headers.count();
-
-    await page.getByTestId('ws-add-message').click();
-    await expect(headers).toHaveCount(beforeCount + 1);
-
-    // The newly added message is the last one and auto-expands.
-    const newBody = page.getByTestId(`ws-message-body-${beforeCount}`);
-    await expect(newBody).toBeVisible();
-
-    const editor = newBody.locator('.CodeMirror');
-    // Body should be empty (previously defaulted to '{}'); the editor should
-    // surface the '...' placeholder instead of any '{}' content.
-    await expect(editor.locator('.CodeMirror-placeholder')).toHaveText('...');
-    await expect(editor.locator('.CodeMirror-code')).not.toContainText('{}');
+    const headers = page.getByTestId(/^ws-message-header-/);
+    let beforeCount = 0;
+
+    await test.step('Open the preloaded websocket request', async () => {
+      await page.getByTestId('sidebar-collection-row').click();
+      await page.getByTitle(REQ_NAME).click();
+      beforeCount = await headers.count();
+    });
+
+    await test.step('Add a new message', async () => {
+      await page.getByTestId('ws-add-message').click();
+      await expect(headers).toHaveCount(beforeCount + 1);
+    });
+
+    await test.step('Assert new message defaults to empty body placeholder', async () => {
+      const newBody = page.getByTestId(`ws-message-body-${beforeCount}`);
+      await expect(newBody).toBeVisible();
+
+      const editor = newBody.locator('.CodeMirror');
+      await expect(editor.locator('.CodeMirror-placeholder')).toHaveText('...');
+      await expect(editor.locator('.CodeMirror-code')).not.toContainText('{}');
+    });
   });

As per path instructions, "Promote the use of test.step as much as possible so the generated reports are easier to read."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/websockets/message-body-default.spec.ts` around lines 11 - 33, Wrap the
distinct phases in the websocket test in `test.step` blocks to make reporting
more granular: separate the request-opening flow, the message-add action, and
the placeholder/body assertions in `message-body-default.spec.ts`. Keep the
existing logic the same, but structure the test around the `test` callback and
its `pageWithUserData` flow so failures are easier to pinpoint in reports.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/websockets/message-body-default.spec.ts`:
- Around line 11-33: Wrap the distinct phases in the websocket test in
`test.step` blocks to make reporting more granular: separate the request-opening
flow, the message-add action, and the placeholder/body assertions in
`message-body-default.spec.ts`. Keep the existing logic the same, but structure
the test around the `test` callback and its `pageWithUserData` flow so failures
are easier to pinpoint in reports.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8385841f-33bb-4eab-bf6b-b9d2137e477c

📥 Commits

Reviewing files that changed from the base of the PR and between 408aef9 and 90cb493.

📒 Files selected for processing (9)
  • packages/bruno-app/src/components/RequestPane/WSRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/WsBody/BodyMode/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/WsBody/SingleWSMessage/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/WsBody/StyledWrapper.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
  • packages/bruno-app/src/themes/dark/dark-monochrome.js
  • packages/bruno-app/src/themes/schema/oss.js
  • tests/websockets/fixtures/collection/ws-default-body-request.bru
  • tests/websockets/message-body-default.spec.ts

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jul 6, 2026
@sid-bruno
sid-bruno merged commit 0148ba6 into usebruno:main Jul 6, 2026
16 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants