Skip to content

refactor(ai): moved AI Assist from floating overlay into request pane and collection/folder settings tab bars#8693

Open
ravindra-bruno wants to merge 2 commits into
usebruno:mainfrom
ravindra-bruno:fix/bru-3883
Open

refactor(ai): moved AI Assist from floating overlay into request pane and collection/folder settings tab bars#8693
ravindra-bruno wants to merge 2 commits into
usebruno:mainfrom
ravindra-bruno:fix/bru-3883

Conversation

@ravindra-bruno

@ravindra-bruno ravindra-bruno commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

[JIRA- BRU-3883]

Description

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.

Alignments for AiAssist

Request Level
Screenshot 2026-07-21 at 3 06 49 PM
Folder Level
Screenshot 2026-07-21 at 3 07 05 PM
Collection Level
Screenshot 2026-07-21 at 3 07 22 PM

Summary by CodeRabbit

  • New Features
    • Added AI Assist controls to request and settings tab headers/toolbars for scripts, tests, documentation, and supported app code.
    • AI-generated updates can be applied to the currently selected content.
  • Improvements
    • Moved AI Assist UI out of the editor bodies and into header/toolbar placement for a cleaner editing experience.
    • Improved script-tab selection based on whether pre-request content is present.
    • Updated settings layout styling for better flexibility.
  • Bug Fixes
    • Improved AI Assist trigger targeting reliability for automated testing.
  • Tests
    • Added Playwright coverage for AI Assist placement across request, collection, and folder views.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

AI Assist is moved from editor bodies into collection, folder, and request-pane tab areas. New orchestration components resolve editable targets and dispatch updates, while editor-level integrations are removed and placement behavior is covered by Playwright tests.

Changes

AI Assist relocation

Layer / File(s) Summary
AI Assist orchestration
packages/bruno-app/src/components/SettingsAiAssist/index.js, packages/bruno-app/src/components/RequestPane/TabBarAiAssist/index.js, packages/bruno-app/src/utils/tabs/index.js
Tab-level assistants build context, resolve script/docs/test targets, and dispatch generated-content updates.
Collection and folder settings integration
packages/bruno-app/src/components/CollectionSettings/*, packages/bruno-app/src/components/FolderSettings/*, packages/bruno-app/src/components/Documentation/index.js
Settings headers mount SettingsAiAssist, while embedded documentation, script, and test assistants are removed.
Request-pane tab integration
packages/bruno-app/src/components/RequestPane/*
HTTP, GraphQL, gRPC, and WebSocket tab headers render TabBarAiAssist; editor-level AI Assist rendering is removed.
Toolbar and wrapper layout
packages/bruno-app/src/components/CollectionApp/index.js, packages/bruno-app/src/components/AIAssist/*, packages/bruno-app/src/components/FolderSettings/StyledWrapper.js
Collection toolbar placement and AI Assist wrapper styling are updated for inline tab-area rendering.
Placement validation
tests/ai-assist/*
Playwright tests verify AI Assist placement and docs editing visibility across request, collection, and folder settings surfaces.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SettingsAiAssist
  participant TabBarAiAssist
  participant AIAssist
  participant Redux
  User->>SettingsAiAssist: select supported settings tab
  SettingsAiAssist->>Redux: read focused tab and editable content
  SettingsAiAssist->>AIAssist: render context and apply handler
  User->>TabBarAiAssist: select supported request tab
  TabBarAiAssist->>Redux: read request content and tab state
  TabBarAiAssist->>AIAssist: render context and apply handler
  AIAssist->>Redux: dispatch generated content update
Loading

Possibly related PRs

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

Poem

AI leaves the editor’s page,
Finds a tab-side staging place;
Scripts and docs now share the beam,
Redux carries every dream.
✨ One assist, many tabs.

🚥 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 accurately summarizes the main refactor: moving AI Assist from the floating overlay into request pane and settings tab bars.
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
tests/ai-assist/init-user-data/preferences.json

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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)
packages/bruno-app/src/components/CollectionSettings/Script/index.js (1)

29-34: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the new shared getActiveScriptTab helper instead of the local duplicate.

This file still computes the active script tab inline, duplicating the exact logic this PR extracted into getActiveScriptTab.js and already adopted in RequestPane/Script/index.js, TabBarAiAssist, and SettingsAiAssist. Consolidating avoids the two copies silently diverging later.

♻️ Proposed refactor
-  const getDefaultTab = () => {
-    const hasPreRequestScript = requestScript && requestScript.trim().length > 0;
-    return hasPreRequestScript ? 'pre-request' : 'post-response';
-  };
-
-  const activeTab = scriptPaneTab || getDefaultTab();
+  const activeTab = getActiveScriptTab(scriptPaneTab, requestScript);

And import it at the top:

+import getActiveScriptTab from '../../RequestPane/Script/getActiveScriptTab';
🤖 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 `@packages/bruno-app/src/components/CollectionSettings/Script/index.js` around
lines 29 - 34, Replace the local getDefaultTab logic and activeTab calculation
in the script settings component with the shared getActiveScriptTab helper,
importing it from its existing module. Pass the same requestScript and
scriptPaneTab values so the current tab-selection behavior remains unchanged.
🤖 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 `@packages/bruno-app/src/components/CollectionSettings/Script/index.js`:
- Around line 29-34: Replace the local getDefaultTab logic and activeTab
calculation in the script settings component with the shared getActiveScriptTab
helper, importing it from its existing module. Pass the same requestScript and
scriptPaneTab values so the current tab-selection behavior remains unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d6ddb0a7-ad0f-47d1-8d5c-ee2cf1b8db44

📥 Commits

Reviewing files that changed from the base of the PR and between 8ed8b1b and 3c65051.

📒 Files selected for processing (22)
  • packages/bruno-app/src/components/AIAssist/StyledWrapper.js
  • packages/bruno-app/src/components/CollectionApp/index.js
  • packages/bruno-app/src/components/CollectionSettings/Docs/index.js
  • packages/bruno-app/src/components/CollectionSettings/Script/index.js
  • packages/bruno-app/src/components/CollectionSettings/Tests/index.js
  • packages/bruno-app/src/components/CollectionSettings/index.js
  • packages/bruno-app/src/components/Documentation/index.js
  • packages/bruno-app/src/components/FolderSettings/Documentation/index.js
  • packages/bruno-app/src/components/FolderSettings/Script/index.js
  • packages/bruno-app/src/components/FolderSettings/StyledWrapper.js
  • packages/bruno-app/src/components/FolderSettings/Tests/index.js
  • packages/bruno-app/src/components/FolderSettings/index.js
  • packages/bruno-app/src/components/RequestPane/AppCodeEditor/index.js
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/Script/getActiveScriptTab.js
  • packages/bruno-app/src/components/RequestPane/Script/index.js
  • packages/bruno-app/src/components/RequestPane/TabBarAiAssist/index.js
  • packages/bruno-app/src/components/RequestPane/Tests/index.js
  • packages/bruno-app/src/components/RequestPane/WSRequestPane/index.js
  • packages/bruno-app/src/components/SettingsAiAssist/index.js
💤 Files with no reviewable changes (1)
  • packages/bruno-app/src/components/FolderSettings/StyledWrapper.js

@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)
packages/bruno-app/src/utils/tabs/index.js (1)

22-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add focused coverage for the fallback selection.

Please test explicit tab precedence, whitespace-only scripts selecting post-response, and non-empty scripts selecting pre-request.

🤖 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 `@packages/bruno-app/src/utils/tabs/index.js` around lines 22 - 26, Add focused
tests for getActiveScriptTab covering explicit scriptPaneTab precedence,
whitespace-only requestScript falling back to post-response, and non-empty
requestScript selecting pre-request. Keep the tests limited to these
fallback-selection behaviors.
🤖 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 `@packages/bruno-app/src/utils/tabs/index.js`:
- Around line 22-26: Add focused tests for getActiveScriptTab covering explicit
scriptPaneTab precedence, whitespace-only requestScript falling back to
post-response, and non-empty requestScript selecting pre-request. Keep the tests
limited to these fallback-selection behaviors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3938e077-3396-4ecc-9d42-82835da18bd0

📥 Commits

Reviewing files that changed from the base of the PR and between 3c65051 and 948bd60.

📒 Files selected for processing (23)
  • packages/bruno-app/src/components/AIAssist/StyledWrapper.js
  • packages/bruno-app/src/components/AIAssist/index.js
  • packages/bruno-app/src/components/CollectionApp/index.js
  • packages/bruno-app/src/components/CollectionSettings/Docs/index.js
  • packages/bruno-app/src/components/CollectionSettings/Script/index.js
  • packages/bruno-app/src/components/CollectionSettings/Tests/index.js
  • packages/bruno-app/src/components/CollectionSettings/index.js
  • packages/bruno-app/src/components/Documentation/index.js
  • packages/bruno-app/src/components/FolderSettings/Documentation/index.js
  • packages/bruno-app/src/components/FolderSettings/Script/index.js
  • packages/bruno-app/src/components/FolderSettings/StyledWrapper.js
  • packages/bruno-app/src/components/FolderSettings/Tests/index.js
  • packages/bruno-app/src/components/FolderSettings/index.js
  • packages/bruno-app/src/components/RequestPane/AppCodeEditor/index.js
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/Script/index.js
  • packages/bruno-app/src/components/RequestPane/TabBarAiAssist/index.js
  • packages/bruno-app/src/components/RequestPane/Tests/index.js
  • packages/bruno-app/src/components/RequestPane/WSRequestPane/index.js
  • packages/bruno-app/src/components/SettingsAiAssist/index.js
  • packages/bruno-app/src/utils/tabs/index.js
💤 Files with no reviewable changes (1)
  • packages/bruno-app/src/components/FolderSettings/StyledWrapper.js
🚧 Files skipped from review as they are similar to previous changes (19)
  • packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js
  • packages/bruno-app/src/components/FolderSettings/index.js
  • packages/bruno-app/src/components/RequestPane/WSRequestPane/index.js
  • packages/bruno-app/src/components/FolderSettings/Documentation/index.js
  • packages/bruno-app/src/components/RequestPane/GrpcRequestPane/index.js
  • packages/bruno-app/src/components/RequestPane/TabBarAiAssist/index.js
  • packages/bruno-app/src/components/SettingsAiAssist/index.js
  • packages/bruno-app/src/components/CollectionSettings/Tests/index.js
  • packages/bruno-app/src/components/RequestPane/Script/index.js
  • packages/bruno-app/src/components/CollectionSettings/index.js
  • packages/bruno-app/src/components/CollectionSettings/Script/index.js
  • packages/bruno-app/src/components/AIAssist/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js
  • packages/bruno-app/src/components/FolderSettings/Tests/index.js
  • packages/bruno-app/src/components/RequestPane/AppCodeEditor/index.js
  • packages/bruno-app/src/components/RequestPane/Tests/index.js
  • packages/bruno-app/src/components/CollectionApp/index.js
  • packages/bruno-app/src/components/Documentation/index.js
  • packages/bruno-app/src/components/FolderSettings/Script/index.js

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

Actionable comments posted: 1

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

Inline comments:
In `@tests/ai-assist/ai-assist-placement.spec.ts`:
- Line 24: Centralize all inline Playwright locators and actions from
tests/ai-assist/ai-assist-placement.spec.ts: replace the loaded-state waits at
lines 24, 59, and 89 with a shared utility under tests/utils/page/*; move the AI
Assist trigger locators at lines 38-51, 67-81, and 99-113 into centralized
locators; and replace the .editing-mode interactions at lines 53-54, 83-84, and
115-116 with centralized semantic, user-facing locators.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 627afe6c-7581-49de-8867-f80e53cce996

📥 Commits

Reviewing files that changed from the base of the PR and between 948bd60 and cf8036a.

📒 Files selected for processing (2)
  • tests/ai-assist/ai-assist-placement.spec.ts
  • tests/ai-assist/init-user-data/preferences.json

});

test('request pane: AI Assist sits in the tab bar, docs only in edit mode', async ({ pageWithUserData: page, createTmpDir }) => {
await page.locator('[data-app-state="loaded"]').waitFor();

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Centralize locators and avoid inline raw selectors.

Raw selectors like page.locator() and page.getByTestId() are inlined throughout the spec. As per path instructions and the Playwright testing guide, locators and actions must be centralized under tests/utils/page/* (e.g., in tests/utils/page/locators.ts). Additionally, avoid using brittle CSS class selectors like .editing-mode in favor of semantic, user-facing locators.

  • tests/ai-assist/ai-assist-placement.spec.ts#L24-L24: Extract the [data-app-state="loaded"] wait into a centralized page utility.
  • tests/ai-assist/ai-assist-placement.spec.ts#L38-L51: Move the AI Assist trigger getByTestId locators into centralized locators.
  • tests/ai-assist/ai-assist-placement.spec.ts#L53-L54: Centralize the .editing-mode interaction and prefer a semantic selector instead of a CSS class.
  • tests/ai-assist/ai-assist-placement.spec.ts#L59-L59: Extract the [data-app-state="loaded"] wait into a centralized page utility.
  • tests/ai-assist/ai-assist-placement.spec.ts#L67-L81: Move the AI Assist trigger getByTestId locators into centralized locators.
  • tests/ai-assist/ai-assist-placement.spec.ts#L83-L84: Centralize the .editing-mode interaction and prefer a semantic selector instead of a CSS class.
  • tests/ai-assist/ai-assist-placement.spec.ts#L89-L89: Extract the [data-app-state="loaded"] wait into a centralized page utility.
  • tests/ai-assist/ai-assist-placement.spec.ts#L99-L113: Move the AI Assist trigger getByTestId locators into centralized locators.
  • tests/ai-assist/ai-assist-placement.spec.ts#L115-L116: Centralize the .editing-mode interaction and prefer a semantic selector instead of a CSS class.
📍 Affects 1 file
  • tests/ai-assist/ai-assist-placement.spec.ts#L24-L24 (this comment)
  • tests/ai-assist/ai-assist-placement.spec.ts#L38-L51
  • tests/ai-assist/ai-assist-placement.spec.ts#L53-L54
  • tests/ai-assist/ai-assist-placement.spec.ts#L59-L59
  • tests/ai-assist/ai-assist-placement.spec.ts#L67-L81
  • tests/ai-assist/ai-assist-placement.spec.ts#L83-L84
  • tests/ai-assist/ai-assist-placement.spec.ts#L89-L89
  • tests/ai-assist/ai-assist-placement.spec.ts#L99-L113
  • tests/ai-assist/ai-assist-placement.spec.ts#L115-L116
🤖 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/ai-assist/ai-assist-placement.spec.ts` at line 24, Centralize all
inline Playwright locators and actions from
tests/ai-assist/ai-assist-placement.spec.ts: replace the loaded-state waits at
lines 24, 59, and 89 with a shared utility under tests/utils/page/*; move the AI
Assist trigger locators at lines 38-51, 67-81, and 99-113 into centralized
locators; and replace the .editing-mode interactions at lines 53-54, 83-84, and
115-116 with centralized semantic, user-facing locators.

Source: Path instructions

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.

1 participant