Skip to content

feat: implement temporary workspace creation and confirmation flow - #7462

Merged
bijin-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:fix/workspace-create-flow
Mar 13, 2026
Merged

bijin-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:fix/workspace-create-flow

Conversation

@naman-bruno

@naman-bruno naman-bruno commented Mar 12, 2026 •

Copy link
Copy Markdown
Collaborator

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.

Summary by CodeRabbit

  • New Features

    • Temporary workspace creation flow with explicit Confirm/Cancel and an advanced creation modal (custom locations) plus a settings cog during creation.
  • Bug Fixes

    • Prevented runtime errors in workspace name validation and improved duplicate-name checks; removed automatic success toast after creating a workspace.
  • Style

    • Improved workspace title/input styling and focus behavior.
  • Tests

    • Comprehensive end-to-end tests covering creation flows and filesystem persistence.

@coderabbitai

coderabbitai Bot commented Mar 12, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Implements a transient workspace creation flow: new in-memory "temp" workspaces (isCreating) are created and editable in UI, with explicit confirm or cancel actions to persist or discard. Removes automatic success toasts, tightens name-uniqueness checks to ignore creating/unnamed workspaces, and adds modal-driven advanced creation UI.

Changes

Cohort / File(s) Summary
Temporary Workspace Lifecycle
packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js
Add transient workspace creation (isCreating, temp UID), confirmWorkspaceCreation to persist final workspace, and cancelWorkspaceCreation to discard temp state and clean up.
CollectionHeader UI & Flow
packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js, packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js
Extend rename flow to support creation vs rename with cog/modal trigger, refs for save/outside-click handling, conditional "Create"/"Save" button; update input styling and add cog button.
CreateWorkspace Validation
packages/bruno-app/src/components/WorkspaceSidebar/CreateWorkspace/index.js
Alter uniqueness validation to ignore workspaces that are isCreating or missing name, preventing false-positive conflicts with temp or unnamed workspaces.
ManageWorkspace & Rename Safety
packages/bruno-app/src/components/ManageWorkspace/index.js, packages/bruno-app/src/components/ManageWorkspace/RenameWorkspace/index.js
Filter out isCreating workspaces before sorting/display; add guard check for w.name before uniqueness comparisons to avoid runtime errors.
Toast Removal
packages/bruno-app/src/components/AppTitleBar/index.js, packages/bruno-app/src/components/ManageWorkspace/index.js
Remove automatic success toasts after workspace creation flows; error handling unchanged.
E2E Tests & Fixtures
tests/workspace/create-workspace/create-workspace.spec.ts, tests/workspace/create-workspace/init-user-data/preferences.json
Add comprehensive Playwright tests covering inline and modal creation, confirm/cancel flows, filesystem assertions, and a test preferences fixture for workspace locations.

Sequence Diagram

sequenceDiagram
    participant User
    participant CollectionHeader as CollectionHeader<br/>(UI)
    participant CreateWorkspace as CreateWorkspace<br/>(Modal)
    participant Redux as Redux<br/>(State)
    participant Filesystem as Filesystem

    User->>CollectionHeader: Start create/edit (inline)
    CollectionHeader->>Redux: dispatch createWorkspaceWithUniqueName()
    Redux->>Redux: Create temp workspace (isCreating=true, tempUID)
    Redux-->>CollectionHeader: state includes temp workspace
    CollectionHeader->>CollectionHeader: render inline input + cog

    alt Advanced modal flow
        User->>CollectionHeader: Click cog
        CollectionHeader->>CreateWorkspace: open modal
        User->>CreateWorkspace: Enter details & submit
        CreateWorkspace->>Redux: dispatch confirmWorkspaceCreation(tempUID, name)
        Redux->>Filesystem: persist workspace folder & workspace.yml
        Filesystem-->>Redux: persistence complete
        Redux->>Redux: replace temp with real workspace
        Redux-->>CollectionHeader: update state (isCreating=false)
    else Inline confirm
        User->>CollectionHeader: Press Enter / outside-click
        CollectionHeader->>Redux: dispatch confirmWorkspaceCreation(tempUID, name)
        Redux->>Filesystem: persist workspace
        Filesystem-->>Redux: done
        Redux-->>CollectionHeader: switch to real workspace
    else Cancel
        User->>CollectionHeader: Press Escape / click X
        CollectionHeader->>Redux: dispatch cancelWorkspaceCreation(tempUID)
        Redux->>Redux: remove temp workspace and cleanup
        Redux-->>CollectionHeader: revert UI state
    end
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly Related PRs

Suggested Reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

✨ A temp name springs to life in RAM so bright,
Edit, cog, confirm — then make it right.
Silent success, no toast in sight,
Save or cancel, tidy the flight,
Workspaces bloom when logic’s light. 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main feature being implemented: a temporary workspace creation flow with confirmation mechanics, which is the core change across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js (1)

269-278: ⚠️ Potential issue | 🟠 Major

Inline create still bypasses the duplicate-name rule.

This path only checks required/length. CreateWorkspace and ManageWorkspace/RenameWorkspace both reject duplicate workspace names, so the same name can still be confirmed through the inline flow here.

Also applies to: 308-318

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`
around lines 269 - 278, validateWorkspaceName currently only checks
required/length and therefore allows duplicates; update it to also reject names
that already exist by comparing the trimmed name against the current workspace
list used by CreateWorkspace and ManageWorkspace/RenameWorkspace. Modify
validateWorkspaceName (and the similar validator at 308-318) to accept or access
the existing workspace names (e.g., a workspaceNames array or Set) and return an
error like 'Name already in use' when trimmed.toLowerCase() matches an existing
name (use a case-insensitive comparison and ignore the current workspace ID when
renaming). Ensure callers of validateWorkspaceName pass the current workspace
list or current workspace id for the rename path so inline create/rename follows
the same duplicate-name rule as CreateWorkspace and
ManageWorkspace/RenameWorkspace.
🧹 Nitpick comments (2)
packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js (1)

403-424: Add stable test IDs to the new inline-create controls.

The new Playwright suite has to target .workspace-name-input, .cog-btn, and .inline-action-btn.* here. Please expose data-testids on these elements and switch the spec over so CSS-only refactors don't break the flow.

Based on learnings, Applies to **/*.{jsx,tsx} : Add \data-testid` to testable elements for Playwright`.

Also applies to: 427-442

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`
around lines 403 - 424, Add stable data-testid attributes to the new
inline-create controls so Playwright tests don't break on CSS refactors: add
data-testid="workspace-name-input" on the input referenced by
workspaceNameInputRef (the element using value workspaceNameInput and onChange
handleWorkspaceNameChange), add data-testid="workspace-advanced-cog" on the cog
button that renders when currentWorkspace?.isCreating and triggers
handleOpenAdvancedCreate, and add matching data-testid values for the other
inline action buttons rendered in the nearby block (the elements with class
inline-action-btn.* referenced around the code after line 427) so the test suite
can target them reliably.
tests/workspace/create-workspace/create-workspace.spec.ts (1)

242-247: Replace these fixed sleeps with locator-driven waits.

These waitForTimeout() calls make the suite timing-sensitive on slower CI. The folder-name section, the location field value, and the validation state already give you observable wait points here.

As per coding guidelines, Try to reduce usage of \page.waitForTimeout();` in code unless absolutely necessary and the locator cannot be found using existing `expect()` playwright calls`.

Also applies to: 309-314, 696-699

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/workspace/create-workspace/create-workspace.spec.ts` around lines 242 -
247, Replace fixed sleeps (page.waitForTimeout calls around the workspace
name/folder creation) with locator-driven waits: after filling via
modal.locator('#workspace-name').fill('Advanced Workspace') wait for the
folder-name section locator to be visible/attached (use the same selector used
to identify the section) and then wait for the specific location field value or
its validation state (e.g., the location input locator and its validation/error
element) to reach the expected text/state using
expect(...).toBeVisible()/toHaveValue()/toHaveText() before proceeding; apply
the same change to the other occurrences mentioned (the blocks around lines
~309-314 and ~696-699) replacing waitForTimeout with locator-based expects
targeting the folder-name section, location field, or validation element.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`:
- Around line 280-331: handleSaveWorkspaceRename is vulnerable to duplicate
submits; add an in-flight guard (e.g. a local ref or state named
isSavingWorkspaceRef / isSavingWorkspace) at the top of the function and return
immediately if it’s already true, then set it true before dispatching
confirmWorkspaceCreation or renameWorkspaceAction and always reset it to false
in both .then and .catch branches (and any early returns where a dispatch would
have occurred). Ensure the guard is checked before touching currentWorkspace.uid
so Enter/click-outside can't trigger a second dispatch while the first is
pending, and preserve existing behavior for openingAdvancedRef and
cancelWorkspaceCreation cases.
- Line 354: The hook tempWorkspaceUidRef = useRef(null) is declared after the
early return (if (!collection) return null) which breaks the Rules of Hooks;
move the tempWorkspaceUidRef declaration up with the other refs (the same block
that declares other useRef hooks) so that tempWorkspaceUidRef is called on every
render before the conditional return and maintains consistent hook order.

In `@tests/workspace/create-workspace/create-workspace.spec.ts`:
- Around line 677-710: The test "should not show temp workspace in manage
workspaces list" does not actually open or assert anything in the Manage
Workspace UI; update it to either (A) rename the test to reflect that it only
validates duplicate-name validation in the Create Workspace modal (change the
test title string), or (B) extend the test to cover the ManageWorkspace
behavior: after creating/opening the app and triggering the create-workspace
flow (selectors used: '.workspace-name-container', '.dropdown-item', '.cog-btn',
'.bruno-modal-card'), open the Manage Workspace view (invoke the same UX path
your app uses to show ManageWorkspace), query the ManageWorkspace list component
(the component under ManageWorkspace/index.js) and assert that the temporary
"Untitled Workspace" entry is not present in the DOM; ensure the test uses
visible/waitFor checks and fails if the temp workspace text appears.

In `@tests/workspace/create-workspace/init-user-data/preferences.json`:
- Around line 7-8: The JSON fixture inserts raw filesystem paths into the quoted
value "defaultLocation": "{{wsLocation}}", which breaks JSON on Windows due to
unescaped backslashes; update either the fixture or the replacement logic:
change the fixture to use an unquoted placeholder (e.g. "defaultLocation":
{{wsLocation}}) and have the test/spec call JSON.stringify(wsLocation) before
replacing {{wsLocation}}, or keep the quoted placeholder and modify
playwright/index.ts to escape backslashes in wsLocation before doing the
plain-text replacement; touch the "{{wsLocation}}" placeholder and the
replacement logic in playwright/index.ts to ensure cross-platform safe JSON
output.

---

Outside diff comments:
In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`:
- Around line 269-278: validateWorkspaceName currently only checks
required/length and therefore allows duplicates; update it to also reject names
that already exist by comparing the trimmed name against the current workspace
list used by CreateWorkspace and ManageWorkspace/RenameWorkspace. Modify
validateWorkspaceName (and the similar validator at 308-318) to accept or access
the existing workspace names (e.g., a workspaceNames array or Set) and return an
error like 'Name already in use' when trimmed.toLowerCase() matches an existing
name (use a case-insensitive comparison and ignore the current workspace ID when
renaming). Ensure callers of validateWorkspaceName pass the current workspace
list or current workspace id for the rename path so inline create/rename follows
the same duplicate-name rule as CreateWorkspace and
ManageWorkspace/RenameWorkspace.

---

Nitpick comments:
In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`:
- Around line 403-424: Add stable data-testid attributes to the new
inline-create controls so Playwright tests don't break on CSS refactors: add
data-testid="workspace-name-input" on the input referenced by
workspaceNameInputRef (the element using value workspaceNameInput and onChange
handleWorkspaceNameChange), add data-testid="workspace-advanced-cog" on the cog
button that renders when currentWorkspace?.isCreating and triggers
handleOpenAdvancedCreate, and add matching data-testid values for the other
inline action buttons rendered in the nearby block (the elements with class
inline-action-btn.* referenced around the code after line 427) so the test suite
can target them reliably.

In `@tests/workspace/create-workspace/create-workspace.spec.ts`:
- Around line 242-247: Replace fixed sleeps (page.waitForTimeout calls around
the workspace name/folder creation) with locator-driven waits: after filling via
modal.locator('#workspace-name').fill('Advanced Workspace') wait for the
folder-name section locator to be visible/attached (use the same selector used
to identify the section) and then wait for the specific location field value or
its validation state (e.g., the location input locator and its validation/error
element) to reach the expected text/state using
expect(...).toBeVisible()/toHaveValue()/toHaveText() before proceeding; apply
the same change to the other occurrences mentioned (the blocks around lines
~309-314 and ~696-699) replacing waitForTimeout with locator-based expects
targeting the folder-name section, location field, or validation element.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c9b56e8-eb77-4a23-bdd1-f830317033eb

📥 Commits

Reviewing files that changed from the base of the PR and between b25b6f3 and ee1e56b.

📒 Files selected for processing (9)
  • packages/bruno-app/src/components/AppTitleBar/index.js
  • packages/bruno-app/src/components/ManageWorkspace/RenameWorkspace/index.js
  • packages/bruno-app/src/components/ManageWorkspace/index.js
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js
  • packages/bruno-app/src/components/WorkspaceSidebar/CreateWorkspace/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/workspaces/actions.js
  • tests/workspace/create-workspace/create-workspace.spec.ts
  • tests/workspace/create-workspace/init-user-data/preferences.json
💤 Files with no reviewable changes (1)
  • packages/bruno-app/src/components/AppTitleBar/index.js

Comment on lines +7 to +8
"general": {
"defaultLocation": "{{wsLocation}}"

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.

⚠️ Potential issue | 🟠 Major

Don't inject raw filesystem paths into a quoted JSON value.

playwright/index.ts does plain-text {{...}} replacement. On Windows, a value like C:\Users\... will make this file invalid JSON because the backslashes are not escaped. Escape the interpolated path before writing, or switch this fixture to an unquoted placeholder and pass JSON.stringify(wsLocation) from the spec.

As per coding guidelines, Bruno is a cross-platform Electron desktop app that runs on macOS, Windows, and Linux. Ensure that all code is OS-agnostic.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/workspace/create-workspace/init-user-data/preferences.json` around
lines 7 - 8, The JSON fixture inserts raw filesystem paths into the quoted value
"defaultLocation": "{{wsLocation}}", which breaks JSON on Windows due to
unescaped backslashes; update either the fixture or the replacement logic:
change the fixture to use an unquoted placeholder (e.g. "defaultLocation":
{{wsLocation}}) and have the test/spec call JSON.stringify(wsLocation) before
replacing {{wsLocation}}, or keep the quoted placeholder and modify
playwright/index.ts to escape backslashes in wsLocation before doing the
plain-text replacement; touch the "{{wsLocation}}" placeholder and the
replacement logic in playwright/index.ts to ensure cross-platform safe JSON
output.

@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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js (1)

271-280: ⚠️ Potential issue | 🟠 Major

Apply the duplicate-name check to the inline create path too.

validateWorkspaceName() only checks empty/length, so the quick-create flow can persist a workspace name that CreateWorkspace would reject. packages/bruno-app/src/components/WorkspaceSidebar/CreateWorkspace/index.js:39-43 already excludes isCreating workspaces from the uniqueness check; the inline confirm path should reuse that rule.

Suggested fix
   const validateWorkspaceName = (name) => {
     const trimmed = name?.trim();
     if (!trimmed) {
       return 'Name is required';
     }
     if (trimmed.length > 255) {
       return 'Must be 255 characters or less';
     }
+    if (
+      currentWorkspace?.isCreating &&
+      workspaces.some((w) =>
+        !w.isCreating &&
+        w.name &&
+        w.name.toLowerCase() === trimmed.toLowerCase()
+      )
+    ) {
+      return 'A workspace with this name already exists';
+    }
     return null;
   };

Also applies to: 313-315

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`
around lines 271 - 280, validateWorkspaceName currently only checks
empty/length, so the inline quick-create confirm path can save a duplicate name
that CreateWorkspace would reject; update validateWorkspaceName (used by the
inline path) to also enforce uniqueness by checking existing workspaces
excluding those with isCreating true (same rule used in CreateWorkspace at
CreateWorkspace/index.js lines referenced), i.e., accept a list of current
workspaces or access the same uniqueness helper, and return an error like "Name
already in use" when a trimmed name matches an existing non-isCreating
workspace; ensure both the main validateWorkspaceName and any calls in the
inline confirm path use this updated validation.
🧹 Nitpick comments (3)
tests/workspace/create-workspace/create-workspace.spec.ts (3)

125-126: Fixed-position clicks may be fragile across viewports.

Using { position: { x: 500, y: 10 } } assumes a specific window size. This could fail on smaller screens or different OS configurations.

♻️ Consider clicking a stable element outside the input
       await test.step('Click outside the rename container to confirm', async () => {
-        await page.locator('.app-titlebar').click({ position: { x: 500, y: 10 } });
+        // Click a stable element outside the rename input to trigger blur
+        await page.locator('.sidebar, .main-content').first().click();
       });

Alternatively, use renameInput.blur() to reliably remove focus without relying on coordinates.

Also applies to: 207-208

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/workspace/create-workspace/create-workspace.spec.ts` around lines 125 -
126, The test uses a fixed-position click via
page.locator('.app-titlebar').click({ position: { x: 500, y: 10 } }) which is
brittle across viewports; replace that fixed-position click with a stable
interaction such as clicking a reliably-located element (e.g. a specific button
or header locator) or, better, call renameInput.blur() after editing to remove
focus; update all occurrences (including the similar use around the other click)
to use the stable click or blur approach so the test doesn't depend on window
size.

701-706: Weak assertion pattern with silent catch.

The .catch(() => false) swallows potential errors, and the conditional check makes the test pass even when the error element doesn't exist. This doesn't fail usefully if behavior changes.

♻️ Proposed explicit assertion
-        const errorText = modal.locator('.text-red-500');
-        const hasError = await errorText.isVisible().catch(() => false);
-        if (hasError) {
-          const errorContent = await errorText.textContent();
-          expect(errorContent).not.toContain('already exists');
-        }
+        // Explicitly verify no "already exists" error appears
+        const errorText = modal.locator('.text-red-500');
+        // Either no error is visible, or if visible, it shouldn't mention "already exists"
+        await expect(errorText.filter({ hasText: 'already exists' })).not.toBeVisible({ timeout: 1000 });

This approach directly asserts the expected behavior without conditional logic.

Based on learnings: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Aim for tests that fail usefully. When a test fails, it should clearly indicate what behaviour broke and why.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/workspace/create-workspace/create-workspace.spec.ts` around lines 701 -
706, Replace the weak pattern using hasError and .catch by asserting the
locator's visibility explicitly: remove the try/catch and conditional and
instead use Playwright's expect on the locator (errorText) to assert it's not
visible (e.g., await expect(errorText).not.toBeVisible() or an equivalent
toHaveCount(0)/toBeHidden) so failures surface clearly; update any references to
hasError and errorContent accordingly and keep the locator symbol errorText as
the target of the assertion.

246-246: Avoid page.waitForTimeout() where possible.

These arbitrary timeouts at lines 246, 313, and 699 can cause flakiness. Per guidelines, prefer locator-based waits or expect() assertions that auto-retry.

♻️ Suggested approach

Instead of waiting a fixed duration for the folder name section or form state, wait for a specific element to appear or stabilize:

-        // Wait for folder name section to appear
-        await page.waitForTimeout(300);
+        // Wait for folder name field to be ready
+        await expect(modal.locator('#workspace-folder-name, `#workspace-location`')).toBeVisible();

For line 699, consider waiting for the validation to complete:

-        await page.waitForTimeout(500);
+        // Allow Formik validation to run
+        await modal.locator('#workspace-name').blur();
+        await expect(modal.getByRole('button', { name: 'Create Workspace' })).toBeEnabled();

Also applies to: 313-313, 699-699

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/workspace/create-workspace/create-workspace.spec.ts` at line 246,
Replace the brittle fixed waits (await page.waitForTimeout(300) at the three
occurrences) with locator-based waits: instead of sleeping, wait for the
specific element/state to be ready (e.g., await
expect(folderNameLocator).toBeVisible(), await
expect(submitButtonLocator).toBeEnabled() or await locator.waitFor({ state:
'visible' }) for the folder name section and form inputs, and await
expect(validationMessageLocator).toHaveText(...) or waitFor({ state: 'hidden' })
for the validation at the third spot); update the test in
create-workspace.spec.ts to use those locator/assertion calls in place of
page.waitForTimeout so Playwright's auto-retry makes the test stable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`:
- Around line 78-87: The cancel branch in handleCancelWorkspaceRename leaves the
component in rename mode when
dispatch(cancelWorkspaceCreation(currentWorkspace.uid)) returns early; move or
duplicate the state resets (setIsRenamingWorkspace(false),
setWorkspaceNameInput(''), setWorkspaceNameError('')) to run before calling
dispatch(cancelWorkspaceCreation(...)) so the inline rename state is cleared
even if the thunk switches workspaces, and apply the same change to the
analogous cancel handler referenced in the comment (the other rename-cancel
function handling lines ~289-304) so both paths always clear rename state prior
to invoking the cancelWorkspaceCreation thunk.
- Around line 425-431: The icon-only advanced-options button (class "cog-btn",
click handler handleOpenAdvancedCreate) lacks an accessible name; add an
explicit accessible label such as aria-label="Advanced options" (or
aria-labelledby referencing a visible label) to the button and ensure the
decorative IconSettings has aria-hidden="true" so screen readers use the
button's accessible name rather than the icon; update the JSX for the button
element accordingly.

---

Outside diff comments:
In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`:
- Around line 271-280: validateWorkspaceName currently only checks empty/length,
so the inline quick-create confirm path can save a duplicate name that
CreateWorkspace would reject; update validateWorkspaceName (used by the inline
path) to also enforce uniqueness by checking existing workspaces excluding those
with isCreating true (same rule used in CreateWorkspace at
CreateWorkspace/index.js lines referenced), i.e., accept a list of current
workspaces or access the same uniqueness helper, and return an error like "Name
already in use" when a trimmed name matches an existing non-isCreating
workspace; ensure both the main validateWorkspaceName and any calls in the
inline confirm path use this updated validation.

---

Nitpick comments:
In `@tests/workspace/create-workspace/create-workspace.spec.ts`:
- Around line 125-126: The test uses a fixed-position click via
page.locator('.app-titlebar').click({ position: { x: 500, y: 10 } }) which is
brittle across viewports; replace that fixed-position click with a stable
interaction such as clicking a reliably-located element (e.g. a specific button
or header locator) or, better, call renameInput.blur() after editing to remove
focus; update all occurrences (including the similar use around the other click)
to use the stable click or blur approach so the test doesn't depend on window
size.
- Around line 701-706: Replace the weak pattern using hasError and .catch by
asserting the locator's visibility explicitly: remove the try/catch and
conditional and instead use Playwright's expect on the locator (errorText) to
assert it's not visible (e.g., await expect(errorText).not.toBeVisible() or an
equivalent toHaveCount(0)/toBeHidden) so failures surface clearly; update any
references to hasError and errorContent accordingly and keep the locator symbol
errorText as the target of the assertion.
- Line 246: Replace the brittle fixed waits (await page.waitForTimeout(300) at
the three occurrences) with locator-based waits: instead of sleeping, wait for
the specific element/state to be ready (e.g., await
expect(folderNameLocator).toBeVisible(), await
expect(submitButtonLocator).toBeEnabled() or await locator.waitFor({ state:
'visible' }) for the folder name section and form inputs, and await
expect(validationMessageLocator).toHaveText(...) or waitFor({ state: 'hidden' })
for the validation at the third spot); update the test in
create-workspace.spec.ts to use those locator/assertion calls in place of
page.waitForTimeout so Playwright's auto-retry makes the test stable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4941bae5-50ac-43fc-b44f-5a9102112e3e

📥 Commits

Reviewing files that changed from the base of the PR and between ee1e56b and d2416be.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js
  • tests/workspace/create-workspace/create-workspace.spec.ts

Comment on lines 78 to +87
const handleCancelWorkspaceRename = useCallback(() => {
if (openingAdvancedRef.current) return;
if (currentWorkspace?.isCreating) {
dispatch(cancelWorkspaceCreation(currentWorkspace.uid));
return;
}
setIsRenamingWorkspace(false);
setWorkspaceNameInput('');
setWorkspaceNameError('');
}, []);
}, [currentWorkspace?.isCreating, currentWorkspace?.uid, dispatch]);

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.

⚠️ Potential issue | 🟠 Major

Reset inline rename state before canceling the temp workspace.

These branches call cancelWorkspaceCreation() and return without clearing isRenamingWorkspace, workspaceNameInput, or workspaceNameError. Because the thunk can switch the active workspace, this component can rerender still in rename mode against the next workspace.

Suggested fix
+  const resetWorkspaceRenameState = () => {
+    setIsRenamingWorkspace(false);
+    setWorkspaceNameInput('');
+    setWorkspaceNameError('');
+  };
+
   const handleCancelWorkspaceRename = useCallback(() => {
     if (openingAdvancedRef.current) return;
     if (currentWorkspace?.isCreating) {
+      resetWorkspaceRenameState();
       dispatch(cancelWorkspaceCreation(currentWorkspace.uid));
       return;
     }
-    setIsRenamingWorkspace(false);
-    setWorkspaceNameInput('');
-    setWorkspaceNameError('');
+    resetWorkspaceRenameState();
   }, [currentWorkspace?.isCreating, currentWorkspace?.uid, dispatch]);
     if (!trimmedName) {
       if (fromOutside && currentWorkspace?.isCreating) {
+        resetWorkspaceRenameState();
         dispatch(cancelWorkspaceCreation(currentWorkspace.uid));
         return;
       }
       setWorkspaceNameError('Name is required');
       return;
@@
     if (error) {
       setWorkspaceNameError(error);
       if (fromOutside && currentWorkspace?.isCreating) {
+        resetWorkspaceRenameState();
         dispatch(cancelWorkspaceCreation(currentWorkspace.uid));
       }
       return;
     }

Also applies to: 289-304

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`
around lines 78 - 87, The cancel branch in handleCancelWorkspaceRename leaves
the component in rename mode when
dispatch(cancelWorkspaceCreation(currentWorkspace.uid)) returns early; move or
duplicate the state resets (setIsRenamingWorkspace(false),
setWorkspaceNameInput(''), setWorkspaceNameError('')) to run before calling
dispatch(cancelWorkspaceCreation(...)) so the inline rename state is cleared
even if the thunk switches workspaces, and apply the same change to the
analogous cancel handler referenced in the comment (the other rename-cancel
function handling lines ~289-304) so both paths always clear rename state prior
to invoking the cancelWorkspaceCreation thunk.

Comment on lines +425 to +431
<button
className="cog-btn"
onMouseDown={(e) => e.preventDefault()}
onClick={handleOpenAdvancedCreate}
title="Advanced options"
>
<IconSettings size={13} strokeWidth={1.5} />

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.

⚠️ Potential issue | 🟡 Minor

Add an accessible name to the advanced-options button.

This is an icon-only control. title is not a reliable screen-reader label, so the advanced create path is easy to miss without an explicit accessible name.

Suggested fix
                 {currentWorkspace?.isCreating && (
                   <button
                     className="cog-btn"
+                    aria-label="Advanced options"
                     onMouseDown={(e) => e.preventDefault()}
                     onClick={handleOpenAdvancedCreate}
                     title="Advanced options"
                   >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<button
className="cog-btn"
onMouseDown={(e) => e.preventDefault()}
onClick={handleOpenAdvancedCreate}
title="Advanced options"
>
<IconSettings size={13} strokeWidth={1.5} />
<button
className="cog-btn"
aria-label="Advanced options"
onMouseDown={(e) => e.preventDefault()}
onClick={handleOpenAdvancedCreate}
title="Advanced options"
>
<IconSettings size={13} strokeWidth={1.5} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`
around lines 425 - 431, The icon-only advanced-options button (class "cog-btn",
click handler handleOpenAdvancedCreate) lacks an accessible name; add an
explicit accessible label such as aria-label="Advanced options" (or
aria-labelledby referencing a visible label) to the button and ensure the
decorative IconSettings has aria-hidden="true" so screen readers use the
button's accessible name rather than the icon; update the JSX for the button
element accordingly.

@bijin-bruno
bijin-bruno merged commit ab8a730 into usebruno:main Mar 13, 2026
7 of 8 checks passed
lohit-bruno pushed a commit to lohit-bruno/bruno that referenced this pull request Mar 18, 2026
…sebruno#7462)

* feat: implement temporary workspace creation and confirmation flow

* fixes
AustralianRaven added a commit to AustralianRaven/rest-wolf that referenced this pull request May 13, 2026
…y fixes (#19)

* fix: import ndjson-curl handling binary data check with type file or not (#7210)

* fix: import ndjson-curl handling binary data check with type file

* chore: handle ansi escaping manually

* chore: avoid duplicate replacements

---------

Co-authored-by: shubh-bruno <[email protected]>

* fix: env var edit (#7066)

* Fix: incorrect translations (#7214)

* feat: update req.setHeader translation to use pm.request.headers.add with object argument

empty commit

* refactor: update req.setHeader translation to use pm.request.headers.upsert

* fix: consistent button size on save requests modal (#7197)

* Prevent cursor state loss on empty nextValue (#7180)

* fix(cli): preserve request item type during import and fail on unsupported types (#7207)

* fix(cli): preserve request type when importing collections

* fix(cli): fail fast on unsupported imported item types

* fix(cli): force BRU format when writing imported files

* chore: apply code rabbit fixes

* chore: adress review comment - keep changes minimal

* add additional test to test bru folder format

* agree with coderabbit, error handling is required

---------

Co-authored-by: Ramesh Sunkara <[email protected]>

* fix: `oauth2 credential` management improvements (#7220)

* fix: oauth2 credential management improvements

Add bru.resetOauth2Credential() API for programmatic credential invalidation
from scripts, fix credential clearing to match on credentialsId, expose
oauth2 credential variables in test runtime, and add input validation
with deduplication to prevent redundant IPC messages. Remove unused
collectionGetOauth2CredentialsByUrlAndCredentialsId reducer.

* fix: handle invalid URLs in oauth2 callback redirect handler

Wrap new URL() calls in try-catch within onWindowRedirect to prevent
uncaught TypeError when redirect or callback URLs are invalid.

* Update packages/bruno-app/src/utils/codemirror/autocomplete.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: load shell environment variables on app startup (#7223)

Add shell-env integration to fetch environment variables from the user's
shell config files (.zshrc, .zshenv, etc.) so that proxy settings and
other exports are available in process.env for both Electron and CLI.

* feat: add reveal in file manager option to workspace collections menu (#6944)

* fix: call initializeShellEnv directly in app ready handler (#7228)

Move the shell environment initialization from module-level into the
app ready callback, avoiding a dangling promise at import time.

* fix: updated error message for renaming requests (#7010)

Co-authored-by: shubh-bruno <[email protected]>

* fix: collection reorder not persisting after restart (#7093)

* feat: implement workspace collection reordering functionality

feat: add tests and improve collection reordering functionality

fix: handle IPC errors during collection reordering and update tests for persistence validation

refactor: enhance collection reordering logic and update related tests for path consistency

fix: prevent unnecessary promise resolution in collection reordering when no collections are present

* fix: ensure consistent path normalization for workspace collections during reordering

* fix: window normlize path comparison (#7240)

* feat(CI): refactor github workflow for tests (#7252)

* feat: interface zoom control settings (#7255)

* feat: interface zoom control settings

* fix: allow zoom controls using shortcuts

* fix: maintain consitency in zoom shortcuts and ui interface

* fix: added min max to 50% and 150% for zoom

* fix: moved percentageToZoomLevel function in bruno-common

* chore: abstractions

---------

Co-authored-by: shubh-bruno <[email protected]>

* fix: openapi cli import (#7028)

* fix: openapi cli import

* chore: seperate bru and opencollection by a flag

* fix: pass down format correctly

* fix: pass format option correctly in collection tests

* Add opencollection version for YAML format

Set opencollection version for YAML format.

---------

Co-authored-by: Sid <[email protected]>

* chore: fix tab selection (#7260)

* fix: response viewer not updating when focused (read-only editors) (#7218)

* fix: update cursor state handling in CodeEditor for read-only mode

* tests: add response pane update test for re-sent requests

* refactor: add data-testid attributes for improved testing in RequestBody and RequestBodyMode components; update locators and tests accordingly

* test: verify response status code is 200

* test: enhance response pane update tests to verify body editor content after request re-sent

* test: add data-testid for method selector and update locators for improved testability

* fix: handle special characters in collection path for dotenv watcher (#7190)

* fix: handle special characters in collection path for dotenv watcher

* fix

* fix: normalize collection pathnames in EnvironmentSecretsStore (#7283)

* fix: normalize collection pathnames in EnvironmentSecretsStore

* fix

* fix

* fix: phone number faker function (#7046)

* fix: skip null query parameters in Postman to Bruno conversion (#7193)

* fix: skip null query parameters in Postman to Bruno conversion

Updated the importPostmanV2CollectionItem function to skip query parameters where both key and value are null. Added a test case to ensure that such parameters are not included in the converted Bruno collection, while preserving other valid parameters.

* fix: skip null parameters in Postman to Bruno conversion

Updated the importPostmanV2CollectionItem function to skip headers, URL-encoded parameters, and form data where both key and value are null. Added corresponding test cases to ensure proper handling of these scenarios in the conversion process.

* perf: Improve search performance in code editor (#6920)

* perf: Improve search performance in code editor

Added cache key to reduce duplicate searches over the complete text.
Added incremental update logic, to not update every marked entry when
clicking "next" or "previous".

Fixes: https://github.com/usebruno/bruno/issues/6913

* Update delimeter to unicode symbol

* feat: add options to skip request and response bodies in reporter output (#7114)

* feat: add options to skip request and response bodies in reporter output

- Introduced `--reporter-skip-request-body` and `--reporter-skip-response-body` flags to omit respective bodies from the reporter output.
- Updated examples in the CLI documentation to reflect new options.
- Refactored result sanitization to handle new flags.

* feat: add shorthand option to skip both request and response bodies in reporter output

- Introduced `--reporter-skip-body` as a shorthand for omitting both request and response bodies from the reporter output.
- Updated CLI documentation examples to include the new shorthand option.
- Adjusted result sanitization to accommodate the new option.

* refactor: simplify documentation and tests for reporter-skip-body option

- Updated the description of the `--reporter-skip-body` option to remove redundancy.
- Removed outdated shorthand references from the test suite for clarity.
- Cleaned up examples in the CLI documentation to focus on the current functionality.

* fix: handle optional chaining for request and response properties in result sanitization

- Updated the `sanitizeResultsForReporter` function to use optional chaining when accessing request and response headers and data.
- This change prevents potential errors when these properties are undefined.

* test: enhance reporter-skip-body tests for JSON and HTML outputs

- Added comprehensive tests for the `--reporter-skip-request-body` and `--reporter-skip-response-body` options in both JSON and HTML report formats.
- Verified that the appropriate request and response bodies are included or excluded based on the specified flags.
- Improved test coverage for scenarios where both flags are used simultaneously.

* fix: remove optional chaining for request and response headers in result sanitization

- Updated the `sanitizeResultsForReporter` function to directly assign empty objects to request and response headers, ensuring consistent behavior regardless of their initial state.
- This change simplifies the code and maintains functionality for skipping headers.

* fix: default normalizeProxyUrl to http protocol for all proxy URLs (#7285)

* Performance/file parse and mount (#6975)

* Refactor: optimize collection updates with batch processing

- Introduced BatchAggregator to handle IPC events in batches, reducing Redux dispatch overhead during collection mounting.
- Updated collection watcher to utilize batch processing for adding files and directories, improving UI performance.
- Implemented ParsedFileCacheStore using LMDB for efficient caching of parsed file content, enhancing loading speed and reducing redundant parsing.
- Adjusted collection slice to support batch addition of items, minimizing re-renders and improving state management.
- Updated relevant components to reflect changes in loading states and collection data handling.

* feat: add cache management to preferences

- Introduced a new Cache component in the Preferences section to display cache statistics and allow users to purge the cache.
- Implemented IPC handlers for fetching cache stats and purging the cache in the Electron main process.
- Added styled components for better UI presentation of cache information.
- Updated Preferences component to include a new tab for cache management.

* fix: update package-lock.json to change 'devOptional' to 'dev' for several Babel dependencies

* refactor: update batch aggregation parameters for improved performance

- Increased DISPATCH_INTERVAL_MS from 150ms to 200ms for better timing control.
- Adjusted MAX_BATCH_SIZE from 200 to 300 items to enhance batch processing efficiency.

* feat: enhance collection loading state and improve batch aggregator functionality

- Added isLoading property to collections slice to manage loading state during collection operations.
- Updated getAggregator function calls in collection-watcher to include collectionUid for better context in batch processing.
- Normalized directory path handling in parsed-file-cache to ensure consistent prefix creation for cache keys.

* fix: update loading state and transient file handling in collections slice

- Changed isLoading property to false during collection initialization for accurate loading state representation.
- Introduced isTransient flag for directories and files to differentiate between transient and non-transient items.
- Enhanced logic for handling transient directories and files during collection processing to improve state management.

* feat: add batch processing support for file additions in task middleware

- Implemented a new listener for collectionBatchAddItems to handle batch file additions.
- Enhanced task management by checking for pending OPEN_REQUEST tasks that match added files.
- Improved tab management by dispatching addTab actions for matching files and removing corresponding tasks from the queue.

* feat: enable ASAR packaging and unpacking for LMDB binaries in Electron build configuration

- Added ASAR support to the Electron build configuration for the Bruno application.
- Specified unpacking rules for LMDB native binaries to ensure proper loading during runtime.

* feat: implement parsed file cache using IndexedDB for improved performance

- Introduced a new `parsedFileCacheStore` utilizing IndexedDB for caching parsed file data.
- Replaced the previous LMDB-based cache implementation to enhance performance and reliability.
- Updated IPC handlers to manage cache operations such as get, set, invalidate, and clear.
- Integrated the new cache store into various components, ensuring efficient data retrieval and storage.
- Added pruning functionality to remove outdated cache entries on startup.

* refactor: update collection root and item handling to preserve UIDs

- Modified the way collection roots and folder items are assigned by using `mergeRootWithPreservedUids` and `mergeRequestWithPreservedUids` to ensure UIDs are maintained during updates.
- This change enhances data integrity when managing collections and their associated files.

* refactor: pass mainWindow reference to parsedFileCacheStore initialization

- Updated the `initialize` method in `ParsedFileCacheStore` to accept a `mainWindow` parameter, allowing for direct access to the main window instance in IPC handlers.
- This change improves the handling of IPC requests by ensuring the correct window context is used for sending messages.

* refactor: optimize getStats method in parsedFileCacheStore for performance

- Replaced manual counting of total files with a direct count() call for O(1) performance.
- Updated the collection counting logic to utilize openKeyCursor with 'nextunique' for improved efficiency in counting unique collection paths.
- These changes enhance the performance of the getStats method by reducing the complexity of file and collection counting.

* fix: update key generation in parsedFileCache to use newline separator

- Changed the key generation logic in `generateKey` from a null character to a newline character for improved readability and consistency in cache keys.

* refactor: rename batch-aggregator to collection-tree-batcher and add tests

- Rename BatchAggregator class to CollectionTreeBatcher
- Rename getAggregator/removeAggregator to getBatcher/removeBatcher
- Update imports and variable names in collection-watcher.js
- Add backward-compatible aliases for old names
- Add 22 unit tests covering all functionality

* refactor: update key generation in parsedFileCache to use custom separator

- Changed the key generation logic in `generateKey` to use a custom separator (↝) instead of a newline character for improved readability and consistency in cache keys.

* fix: add missing reject handler and fix directory prefix collision

- Add reject to Promise and pendingRequests in parsed-file-cache-idb.js
- Normalize dirPath with trailing separator in invalidateDirectory to
  prevent false matches (e.g., /foo/bar matching /foo/barley)
- Use platform-specific path.sep for cross-platform compatibility

* fix: add error handling in parsedFileCache and update window close event

- Added a catch block to handle errors in the database promise in parsedFileCache.
- Updated the window close event listener in collection-tree-batcher to use `once` for better resource management.

* fix: add LRU eviction when IndexedDB quota is exceeded

Handle QuotaExceededError in setEntry by automatically evicting
the oldest 20% of cache entries and retrying the write operation.

* fix: use once instead of on in mock window for batcher tests

---------

Co-authored-by: Chirag Chandrashekhar <[email protected]>

* feature: added support for unix sockets and named pipes(windows) for grpc local IPC support (#7021)

* Fix Environment Search Behavior, UI Updates, and Result Handling (#7287)

* feat: change default collection location to default location (#7291)

* feat: change default collection location to default location

* refactor: migrate defaultCollectionLocation to defaultLocation in preference.json

* refactor: resolveDefaultLocation function

* fix: rename variables in default-location

* fix: storing status in example for yml file (#6876)

* fix: storing status in example for yml file

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: temporary check for tests

* fix: test cases for status and statusText

* chore: removed logs

* fix: test cases for response status and text

* fix: test cases for response status and text

* fix: resolved comments

* fix: openapi test import test cases

* chore: removed console logs

* fix: status type in response example while import/export of collection

* fix: postman to bruno import

---------

Co-authored-by: shubh-bruno <[email protected]>

* Feat: Support `multipart/mixed` (#7155)

* feat(): support multipart mixed

fix: support vars interpolation on mixed multi-part

Update packages/bruno-electron/src/ipc/network/interpolate-vars.js

Co-authored-by: Timon <[email protected]>

refactor: use startsWith

feat: best effort for other multipart/* contentypes

* feat: enhance variable interpolation for multipart requests

- Updated `interpolateVars` function to support interpolation in multipart/form-data and multipart/mixed requests.
- Added handling for empty multipart arrays and parts with missing or undefined values.
- Improved type checks for content types to ensure proper interpolation behavior.

Includes new tests to validate the interpolation functionality for multipart requests.

* fix: normalize error handling in sendRequest and improve test reliability

---------

Co-authored-by: Alfonso Presa <[email protected]>

* fix(graphql): handle invalid schemas gracefully in query editor (#7269)

Prevent app crashes when loading GraphQL schemas with validation errors
(e.g., object types with no fields). The fix:

- Validates schemas using validateSchema() and shows warnings for issues
- Still loads the schema so autocomplete continues to work
- Wraps the CodeMirror GraphQL linter with error handling to catch
  any validation errors during linting

Fixes #4529

Co-authored-by: Chirag Chandrashekhar <[email protected]>

* fix(schema): support all Unicode letters in tag validation (#7311)

* allow international characters in tag regex for UI and schema
  validation
* update validation messages to match this

Co-authored-by: Miro Metsänheimo <[email protected]>

* fix#6247: Interpolate dynamic variables in path param (#6251)

* fix: prevent triggering rename action with modifier keys (#7322)

* fix(batch-events): fix order of directory file and folder events (#7300)

* fix: order of events

* fix: update constants handling in CollectionTreeBatcher and related tests

* fix: tags validation error for openapi import for BRU and YAML compatibility (#7294)

* fix: tags schema updatd to array of string

* tests: added test cases for sanitizing tags, openapi-tags

* fix: enhance tag sanitization to support object input and UTF characters

---------

Co-authored-by: shubh-bruno <[email protected]>

* Force text/plain mimetype when copying request code (#7321)

* Force text/plain mimetype when copying requests

* chore: lint

---------

Co-authored-by: Austen Adler <[email protected]>

* fix: wrong workspace request shown after closing tab (#7259)

* feat: add ensureActiveTabInCurrentWorkspace action and improve tab management

* refactor: enhance tab focus logic for current workspace and improve tab management

* tests: implement test for getTabToFocusForCurrentWorkspace logic and added a playwright

* refactor: improve comments for tab management logic and enhance workspace tab focus handling in tests

* refactor: ensure active tab in current workspace after collection removal and enhance tests for tab focus logic

* trigger build

* Enable encodeUrl setting to control URL encoding in generated snippets (#7187)

* feat(snippet-generator): implement encodeUrl setting to control URL encoding in generated snippets

* refactor(snippet-generator): rename and enhance URL encoding logic for better clarity and functionality

* feat(snippet-generator): enhance raw URL handling to preserve user encoding choices and improve snippet generation

* test(snippet-generator): add tests for URL fragment handling based on encodeUrl setting

* test(snippet-generator): improve comments on URL fragment handling to clarify RFC compliance

* feat(url): enhance interpolateUrlPathParams to support raw URL handling, preserving user encoding choices for snippet generation

* fix(url): ensure URLs are prefixed with http:// if missing in interpolateUrlPathParams function

* refactor(snippet-generator): streamline URL handling logic to improve snippet generation and ensure proper encoding based on settings

* feat(url): add stripOrigin utility to simplify URL processing in snippet generation

* test(snippet-generator): add test for double-encoding of pre-encoded URLs when encodeUrl is true

* feat(encoding): implement URL encoding settings and add tests for encoding behavior

* fix: address PR review comments (#7187)

- Remove unnecessary no-op jest.mock for @usebruno/common/utils
- Add length guard to prevent catastrophic replaceAll('/') on root-path URLs

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* empty commit

* fix(tests): update interpolateUrlPathParams tests to use correct parameter structure

* empty commit

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

* feat: implement onboarding preferences and welcome modal for new users (#7319)

* feat: implement onboarding preferences and welcome modal for new users

* fixes

* adding: defaultPreferences

* fixes

* fix: tests

* fixes

* fix: test

* fix: test

* fixes

* fixes

* Update copyright year to 2026 (#7302)

* Update copyright year to 2026

* Update footer year to current year dynamically

* fix: Postman import compatibility for multipart form-data file params (#7325)

* fix: multipart form-data file param export/import for Postman

* fix: Postman import compatibility for multipart form-data file params

This commit fixes two issues that caused Postman to fail importing
Bruno-exported collections with multipart form-data file parameters:

1. Changed `src` field format to match Postman's export format:
   - Single file: export as string (e.g., "/path/to/file")
   - Multiple files: export as array (e.g., ["/path/a", "/path/b"])
   - Empty/null: export as null

   Previously, Bruno always exported `src` as an array, but Postman's
   importer expects a string for single files and fails to recognize
   the file type and path when given an array.

2. Added `protocolProfileBehavior.disableBodyPruning` for GET/HEAD/OPTIONS
   requests that have a body:

   By default, Postman discards request bodies for HTTP methods that
   typically don't have bodies (GET, HEAD, OPTIONS). Without this flag,
   importing a GET request with a form-data body would result in the
   body being silently dropped, making Postman unable to identify that
   the request has a formdata body at all.

Both changes align Bruno's Postman export format with Postman's own
export format, ensuring full import compatibility.

---------

Co-authored-by: Chirag Chandrashekhar <[email protected]>

* fix(`oauth2`): prevent false callback matches on `root path URLs` (#7315)

* fix(oauth2): prevent false callback matches on root path URLs and handle errors first

Move error check before callback URL matching in onWindowRedirect so
OAuth error responses are rejected immediately. Remove redundant error
param check from matchesCallbackUrl and require a code param or hash
fragment to match, preventing false positives on intermediate pages
when the callback URL is a root path like https://hostname/.

* fix(oauth2): clarify error handling comment

Remove "on the callback URL" from comment since error checking
now happens before callback URL matching.

* feat: add `tokenType` support for OAuth2 (#7314)

* feat: add tokenType support for OAuth2

* refactor: rename tokenType to source in OpenCollection OAuth2 mapping

* refactor: rename tokenType to source in OAuth2 configuration

* chore: bump @opencollection/types to ~0.8.0

* fix: correct OAuth2 token type label in token viewer

* refactor: replace Dropdown with MenuDropdown in OAuth2 components

Migrate all 12 dropdown instances across 5 OAuth2 auth components to use
the MenuDropdown component, removing manual tippy ref management and
forwardRef icon patterns in favor of a declarative items-based API.

* feat: improve stack traces for script and test failures (#7181)

* chore: update package-lock.json to include yaml dependency

* feat: add script-aware stack traces and source context for script/test failures

* chore: sync package-lock.json with yaml dependency in bruno-js

* fix: handle null check in getErrorTypeName and align JSDoc style

* refactor: derive script path from request.pathname and use SCRIPT_TYPES constant

* fix: avoid showing source context for collection/folder script errors

* feat: map collection/folder script errors to source file and line

* fix: update error formatting and avoid undefined message

* fix: resolve script block location in collection/folder yml files

* refactor: use script wrapper utils and rename wrapper offsets

* refactor: move script wrapper to utils, add wrapScriptInClosure fn

* fix: resolved zoom ui remarks (#7326)

* fix: resolved zoom ui remarks

* fix: resolved comments

* fix: resolved comments

---------

Co-authored-by: shubh-bruno <[email protected]>

* fix: ensure system proxy is initialized before use in network calls (#7264)

getCachedSystemProxy now awaits the initialization promise, preventing a race
condition where API calls made early in startup would bypass the system proxy.

* fix: allow user to delete default bruno headers in pre-request (#7331)

* fix: allow user to delete default bruno headers

* fix: resolved comments

---------

Co-authored-by: shubh-bruno <[email protected]>

* feat: add functionality to create new HTTP requests from the welcome modal and collections section (#7350)

* feat(sidebar): show "Add request" cta when collection or folder is empty (#7273)

* feat(sidebar): show "Add request" cta when collection or folder is empty

* fix: add connector lines and keyboard accessibility to empty-state CTA

* fix: debounce empty collection state to prevent flicker

Add 300ms delay before showing "Add request" button for empty collections.
This fixes a race condition where isLoading becomes false before the
items batch arrives from IPC, causing a brief flicker of the empty state.

Made-with: Cursor

---------

Co-authored-by: naman-bruno <[email protected]>

* refactor: streamline onboarding process and preferences handling (#7349)

* refactor: streamline onboarding process and preferences handling

* fixes

* fixes

* feat(phase-1): allow user to customize keybindings (#7163)

* feat(phase-1): allow user to customize keybindings

* fix: necessary changes for customizied keybindings to work

* fix: updated hotkeys provider

* fix: test cases for edit keybindings in preferences

* fix: removed old keyboard shortcuts test cases

* fix: resolved coderabbit coments

* fix: fixed move tabs test cases

* feat: provided customized keybindings shorcut for codemirror instacnces

* fix: handle closetabs/closeAllTabs in RequestTab/index.js for better consitency

* fix: resolved comments

* fix: resolved zoom issues

* fix: revert codemirror instacnces

* fix: handle codemirror instances shortcut in .Pass

* feat: integrate shorcut keys with codemirror instacneces

* fix: ui updates

* fix: updated shortcuts

* fix: test cases

* chore: revert `alt-enter` keybind

* chore: allow jest to replace esm spec in store

* chore: lint whitespace fix

---------

Co-authored-by: shubh-bruno <[email protected]>

* fix: file extension for clone and rename request (#7278)

* fix: file extension for clone and rename request

* fix

* feat: add collection creation flow in SaveTransientRequest modal (#7328)

* feat: enhance API spec export with environment variables support (#7170)

* feat: enhance API spec export with environment variables support

- Updated `exportApiSpec` function to accept and process environment variables for multi-server exports.
- Added logic to convert environment variables into a structured format for OpenAPI server entries.
- Enhanced the `CreateApiSpec` component to include environments in the exported YAML content.
- Introduced unit tests to validate the handling of server variables and their integration into the exported API specifications.

* refactor: streamline API spec export logic and improve variable handling

- Simplified variable extraction in `exportApiSpec` by directly assigning capture groups.
- Updated URL interpolation to use request variables instead of global variables for better accuracy.
- Enhanced handling of request body types by replacing early returns with breaks for clearer flow control.
- Adjusted tests to ensure backward compatibility with OpenAPI specifications and server variable handling.

* refactor: improve variable handling and URL processing in OpenAPI exporters

- Streamlined server variable assignment in `exportApiSpec` to handle undefined values more gracefully.
- Enhanced URL path extraction to ensure leading slashes are preserved in `getDefaultUrl` and `extractServerVars`.
- Updated string replacement logic to use `replaceAll` for consistent variable substitution in URLs.

* Fix persistence of additional parameters using open-collection format (#7296)

Co-authored-by: TaylorJerry <[email protected]>
Co-authored-by: MrcBoo <[email protected]>

* feat: inline create collection and workspace editor (#7324)

* feat: inline create collection and workspace editor

* refactor: use inline collection creation from workspace overview

* fix: improve inline collection creation UX from workspace overview

* fix: update E2E tests for inline collection creation flow

* fix: update default location test for inline collection creation flow

* fix: derive inline workspace/collection names from filesystem

* feat: inline workspace create form manage workspace

* feat: prefill create modal with name

* fix: minor code style fixes

---------

Co-authored-by: naman-bruno <[email protected]>

* chore: update coderabbit instructions to make sure the code is os agnostic (#7355)

* refactor: comment out unused APIs (#7323)

* refactor: comment out unused API hints in autocomplete.js

* refactor: comment out unused API translations in postman and bruno translators

Temporarily disable certain API translations due to UI update issues affecting their functionality. A note has been added to restore these translations once the UI fixes are implemented.

* refactor: temporarily skip tests for collection variable translations due to UI update issues

Commented out tests related to `setCollectionVar`, `deleteCollectionVar`, and related functionalities until the necessary UI updates are implemented. A note has been added to restore these tests once the fixes are live.

* refactor: comment out variable deletion and retrieval methods due to UI sync issues

* revert: ping.bru

* refactor: update postman translation tests to enable previously skipped cases

* Revert "Performance/file parse and mount (#6975)" (#7360)

* Revert "Performance/file parse and mount (#6975)"

This reverts commit f76f487211d3859edf2d14f0b11812811df3a758.

* fix: import duplication

* Revert "fix(batch-events): fix order of directory file and folder events (#7300)"

This reverts commit bf4af42a25522d10f44e1fec17af63b3f0db0077.

---------

Co-authored-by: Chirag Chandrashekhar <[email protected]>
Co-authored-by: Sid <[email protected]>

* fix: show '+ Add request' when only transient items exist (#7361)

* fix: focus and text selection in workspace creation flow (#7363)

* fix: workspace creation rename focus

* refactor: remove duplicate focus/select timer from rename handler

* feat/openapi sync (#7279)

* feat: implement OpenAPI Sync

* feat: enhance focus styles and error handling across components

- Added focus-visible styles for buttons and tags in Swagger and Modal components to improve accessibility.
- Updated ConnectSpecForm to ensure source URL is set only if the file path is valid.
- Enhanced clipboard copy functionality in SpecInfoCard with error handling and success notifications.
- Improved ExpandableEndpointRow to handle loading state more robustly.
- Refined SyncReviewPage to ensure correct filtering of updated endpoints.
- Updated file handling in OpenAPI Sync IPC to support both .yml and .yaml extensions.

* fix: improve filename sanitization in OpenAPI Sync IPC

- Updated filename sanitization logic to ensure proper handling of both `name` and `filename` properties, enhancing compatibility with various file formats.
- Adjusted the logic to derive the base name from the filename when necessary, ensuring consistent output for generated files.

* feat: enhance OpenAPI Sync tab with new overview and header components

- Introduced OverviewSection to display summary of collection and spec status, including total endpoints, in-sync counts, and pending updates.
- Added OpenAPISyncHeader for improved navigation and actions related to the OpenAPI spec.
- Updated CollectionStatusSection to better handle and display collection drift information.
- Refined styling for status banners and added new visual elements for better user experience.
- Enhanced tooltip functionality in Help component for improved accessibility.

* refactor: remove VisualDiffViewer components and add diff package

- Deleted VisualDiffViewer components including VisualDiffMeta, VisualDiffDocs, VisualDiffVars, and others to streamline the codebase.
- Introduced the 'diff' package in package-lock.json to enhance diff functionality.
- Updated utility functions to improve diff status handling and maintainability.

* feat: enhance OpenAPI Sync tab with sync status indicators and improved styling (#7371)

- Added sync status logic to determine if the collection is in sync with the spec, displaying appropriate indicators in the UI.
- Updated OpenAPISyncHeader to include linked collection information and sync status icons.
- Refined styling in StyledWrapper for better layout and visual feedback on sync status.
- Removed unused styles and components to streamline the codebase.

* fix: enable `SSL session caching` and `HTTP agent reuse` for faster consecutive requests (#6987)

* fix: enable SSL session caching for faster consecutive requests (#6929)

* fix: enable SSL session caching for faster consecutive requests

Previously, Bruno created a new HTTPS agent for every request, which meant
SSL/TLS sessions couldn't be reused. This caused the full TLS handshake
(~450ms) to run on every request, even to the same endpoint.

Changes:
- Add agent caching based on TLS configuration (certs, proxy, SSL options)
- Reuse cached agents for requests with matching configuration
- SSL sessions are now cached and reused, significantly reducing
  response time for consecutive requests to the same host

The fix maintains backward compatibility:
- Timeline logging moved to setup phase (before agent creation)
- Proxy and SSL validation behavior unchanged
- Added clearAgentCache() for testing and configuration changes

Fixes #5574

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix: address review feedback for SSL session caching

- Add passphrase to cache key to prevent incorrect agent reuse
- Add MAX_AGENT_CACHE_SIZE (100) with LRU-style eviction
- Use consistent node: prefix for crypto import

Co-Authored-By: Claude Opus 4.5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.5 <[email protected]>
Co-authored-by: lohit <[email protected]>

* feat(bruno-requests): add timeline agent for TLS event logging

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat(bruno-requests): add agent cache for SSL session reuse

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* test(bruno-requests): add tests for agent cache

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat(bruno-requests): integrate agent cache into http-https-agents

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* refactor(bruno-electron): use shared agent cache from bruno-requests

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat(bruno-cli): use agent cache for SSL session reuse

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat(bruno-requests): add HTTP agent timeline support

Add createTimelineHttpAgentClass for logging HTTP connection events
including proxy usage, DNS lookups, and connection establishment.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* refactor(bruno-requests): extract shared agent caching logic

Add getOrCreateAgentInternal helper to reduce code duplication
between getOrCreateAgent and getOrCreateHttpAgent functions.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat(bruno-requests): use HTTP agent cache for connection reuse

Export getOrCreateHttpAgent and use it in http-https-agents for
HTTP requests to enable connection pooling.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix(bruno-cli): improve HTTP agent handling and error logging

- Use { keepAlive: true } instead of tlsOptions for HTTP agents
- Add warning log for system proxy configuration errors
- Fix brace style consistency

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix(bruno-electron): improve HTTP agent handling

- Use { keepAlive: true } instead of tlsOptions for HTTP agents
- Fix brace style consistency
- Add missing newline at EOF

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix(bruno-requests): address code review findings for agent caching

- Fix Buffer hashing bug: properly handle Buffer values in hashValue()
- Add CA array support: new hashCaValue() handles string[] | Buffer[]
- Fix timeline race condition: capture timeline reference in closure
  at createConnection start to isolate concurrent requests
- Fix SSL verify message: check socket.authorized for accurate status
- Fix HTTP/HTTPS agent logic: only set httpsAgent for HTTPS requests
- Add tests for concurrent requests timeline isolation

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat(bruno-requests): log when reusing cached agent

- HTTPS agents: "Reusing cached agent (SSL session reuse enabled)"
- HTTP agents: "Reusing cached agent (connection reuse enabled)"

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat(preferences): add cache.httpHttpsAgents.enabled preference

* feat(agent-cache): add disableCache option to getOrCreateAgent

* feat(proxy-util): respect httpHttpsAgents cache preference

* refactor(agent-cache): use named props for getOrCreateAgent and getOrCreateHttpAgent

* feat(ipc): add renderer:clear-http-https-agent-cache handler

* feat(redux): add cache.httpHttpsAgents preferences to initial state

* feat(ui): add Cache tab to Preferences

* feat(cli): add --disable-http-https-agents-cache flag

* refactor(cache): replace window.ipcRenderer calls with redux actions

Add getCacheStats, purgeCache, and clearHttpHttpsAgentCache thunks to
the app slice. Update the Cache preferences component to dispatch these
actions instead of calling window.ipcRenderer directly.

Also move handleSave and handleSaveRef above useFormik to fix declaration
order — onSubmit closes over handleSaveRef, so the ref must be initialized
before useFormik is called.

* fix: tests

* fix(cache): thread disableCache and hostname through all agent-creation paths

- Forward disableHttpHttpsAgentsCache through getHttpHttpsAgents → createAgents
  so OAuth2 token requests and bru.sendRequest honour the CLI flag
- Add hostname to agent cache keys (getAgentCacheKey, getHttpAgentCacheKey)
  for per-host TLS session reuse; extract hostname at every call site in
  run-single-request.js, proxy-util.js, and http-https-agents.ts
- Add extractHostname helper in http-https-agents.ts to safely parse hostnames
- Add test coverage for cert, key, pfx, passphrase, and hostname cache-key
  differentiation in agent-cache.spec.ts

* refactor(cache): rename getOrCreateAgent to getOrCreateHttpsAgent

* refactor: simplify UI labels, optimize agent timeline wrapping, silence proxy errors

* fix: tests

* fix(proxy): fix proxy agent construction and CA cert handling

Three fixes:

1. Proxy agents (HttpsProxyAgent, HttpProxyAgent, SocksProxyAgent) expect
   (proxyUri, options) constructor signature, but the agent cache was packing
   proxyUri into options as a single argument. Fixed the non-timeline code
   path in getOrCreateAgentInternal.

2. HTTP requests through an HTTPS proxy need TLS options (ca certs) to
   validate the proxy's certificate. All getOrCreateHttpAgent call sites
   now pass TLS options when the proxy protocol is HTTPS.

3. Setting the `ca` option on any Node.js TLS connection replaces the
   default OpenSSL trust store entirely. CAs only in the OpenSSL default
   trust store (e.g. /etc/ssl/cert.pem) but not in tls.rootCertificates
   were lost. Fixed by converting `ca` to a secureContext via addCACert(),
   which appends custom CAs on top of the OpenSSL defaults instead of
   replacing them.

Also simplified PatchedHttpsProxyAgent to selectively forward only the
relevant TLS options (cert, key, pfx, passphrase, rejectUnauthorized,
secureContext) to the target TLS upgrade instead of blindly merging all
constructor options.

* fix(tls): load client certs into secureContext to prevent silent drop

Add Cache tab to Preferences UI

* fix(proxy): align proxy auth check to use auth.disabled field consistently

* refactor(cache): rename CLI flag to --cache-ssl-session and disable caching by default

- Rename --disable-http-https-agents-cache to --cache-ssl-session (opt-in)
- Rename disableHttpHttpsAgentsCache to cacheSslSession across CLI and bruno-requests
- Default caching to disabled in both bruno-electron and bruno-cli
- Add cacheSslSession to buildCertsAndProxyConfig for bru.sendRequest
- Update Preferences UI labels to "Cache SSL Session"

* refactor(cache): rename httpHttpsAgents to sslSession across preferences and UI

* refactor(cache): remove unused getCacheStats and purgeCache IPC actions

---------

Co-authored-by: karthik <[email protected]>
Co-authored-by: Claude Opus 4.5 <[email protected]>

* Feat/opeanpi sync updates (#7374)

* fix: update button colors and streamline props in OpenAPISyncTab and CollectionHeader

- Changed button color from 'warning' to 'primary' in OpenAPISyncTab for better visual consistency.
- Simplified prop usage for OpenAPISyncIcon in CollectionHeader by removing unnecessary function wrapper.

* fix: update StatusBadge variant in OpenAPISyncHeader for improved styling

- Changed StatusBadge in OpenAPISyncHeader to use 'outline' variant for better visual distinction of version information.

* refactor: simplify OpenAPISyncTab and related components by removing unused state and styles (#7378)

- Removed the `viewMode` state and associated logic from OpenAPISyncTab and useSyncFlow, streamlining the component's functionality.
- Eliminated the `review-active` class from StyledWrapper, cleaning up the styling.
- Updated Redux state management by removing `viewMode` from the tab UI state structure, reducing complexity.

* chore: UI Polish for Zoom and Keybindings panel (#7376)

* chore: ui polishing for zoom panel

* fix: replace IconRefresh with IconReload in Zoom and Keybindings components

* chore: resolved ui issues

* test: check test cases

* fix: adjust width properties in StyledWrapper component

* fix: update keybindings UI layout and tooltip removal

* chore: semantics

---------

Co-authored-by: Sid <[email protected]>
Co-authored-by: shubh-bruno <[email protected]>

* fix: use Title Case for default "Untitled Collection" and "Untitled Workspace" (#7389)

* fix: preserve existing process.env values in initializeShellEnv (#7390)

* refactor: enhance OpenAPISyncTab functionality and clean up unused code (#7392)

- Updated OpenAPISyncTab to utilize Redux state for active tab management, improving state consistency.
- Removed unnecessary loading state checks from OverviewSection and SpecStatusSection for cleaner logic.
- Streamlined prop usage in OverviewSection by eliminating the isLoading prop.
- Cleaned up useOpenAPISync hook by removing unused state clearing logic on unmount.
- Improved file handling in openapi-sync IPC by ensuring new files are created in the appropriate folder based on tags.

* fix: update collection path handling to use path.join for consistency across components (#7394)

* Fix: resolve default location missing path (#7391)

* fix: refocus collection name input on error and resolve missing default location folder

* revert: remove focus refocus logic from InlineCollectionCreator

Reverts the setTimeout focus change that was causing test failures.
Keeps the preferences.js fix for default location validation.

Made-with: Cursor

* fix: update default-collection-location test to use project path

Use {{projectRoot}} template variable for defaultLocation so the path
exists when the app validates it with fs.existsSync.

Made-with: Cursor

* fix: improve save test to use alternate path and verify persistence

Made-with: Cursor

---------

Co-authored-by: naman-bruno <[email protected]>

* fix: allow edit keybinding shortcuts (#7404)

Co-authored-by: shubh-bruno <[email protected]>

* fix:  app crash error (Rendered fewer hooks than expected) (#7407)

* fix:  app crash error (Rendered fewer hooks than expected)

* empty commit

* enhance OpenAPI sync with validation, enum support, and bug fixes (#7408)

* Enhance OpenAPISyncTab functionality with error handling and UI improvements

- Updated ConnectSpecForm to include error handling for invalid OpenAPI specifications when uploading files.
- Added a sync info notice in CollectionStatusSection to inform users about tracked changes.
- Improved styling in StyledWrapper for better visual feedback and layout consistency.
- Adjusted button colors and properties in ConfirmSyncModal and ConnectionSettingsModal for better UX.
- Refactored useOpenAPISync hook to validate URLs before syncing, ensuring only valid OpenAPI specs are processed.
- Enhanced parameter handling in openapi-to-bruno.js to support enum and default values more effectively.

* Refactor OpenAPISyncTab components for improved URL validation and error handling

- Updated ConnectSpecForm to streamline file upload error handling for OpenAPI specifications.
- Enhanced OpenAPISyncHeader to utilize isHttpUrl for better URL validation.
- Refactored useOpenAPISync hook to replace isValidUrl with isHttpUrl for consistency in URL checks.
- Improved file parsing logic in file-reader.js to handle case-insensitive JSON file extensions.
- Added isHttpUrl utility function to validate HTTP/HTTPS URLs effectively.

* Enhance file parsing logic in file-reader.js to improve error handling for JSON and YAML files

- Updated parseFileAsJsonOrYaml function to handle case-insensitive JSON file extensions more robustly.
- Added error handling to ensure the document root is an object and not an array, improving data validation.

* Update StatusBadge component to include new 'xs' size preset and adjust documentation accordingly

- Added 'xs' size preset with specific font size and padding for minimal use cases.
- Updated documentation to reflect the new size options available for the StatusBadge component.

* feat(request-pane): restore body tab scroll position on tab switch (#7250)

* feat(request-pane): restore body tab scroll position on tab switch

When editing large request bodies (JSON/XML/text/sparql), switching to
another tab (params, headers, auth, etc.) and back would reset the
CodeMirror editor scroll position to the top.

Fix by persisting the scroll position to Redux on editor unmount (via
CodeEditor's onScroll prop) and restoring it on mount (via initialScroll),
mirroring the existing scroll restoration pattern in QueryResultPreview.

* test: add playwright tests for body scroll restoration

---------

Co-authored-by: naman-bruno <[email protected]>

* fix: normalize paths when comparing workspace and redux collection paths on Windows (#7436)

Without path normalization, collections appear stuck in "mounting" state on Windows
because workspace YAML uses forward slashes while Redux uses backslashes.

Co-authored-by: Chirag Chandrashekhar <[email protected]>

* fix: multipart header check (#7444)

* fix: multipart header check

* fix

* refactor: update path imports to use utils/common/path (#7440)

* workspace renaming with path update (#7437)

* workspace renaming with path update

* fixes

* update: test

* fix: test

* fix: cookie wrapper callback mode returns never-resolving Promise (#7442)

* fix: cookie wrapper callback mode returns never-resolving Promise

tough-cookie's createPromiseCallback() intentionally never resolves the
returned Promise when a callback is provided — only the callback fires.
The cookie jar wrapper was propagating this never-resolving Promise via
`return cookieJar.getCookies(url, cb)` in callback-mode paths. When user
scripts did `await jar.getCookie(url, name, callback)` in the Node VM
(developer sandbox), the await hung forever, blocking the CLI runner.

Fix: drop the return value in all callback-mode paths so the wrapper
returns void (undefined). `await undefined` resolves immediately.

Affected methods: getCookie, getCookies, hasCookie, clear, deleteCookies.

* fix: validation-error callback paths also return void instead of callback result

The validation guards (e.g. missing URL) did `return callback(error)` which
leaks whatever the user's callback returns. Apply the same pattern used for
the main callback paths: call the callback, then return void.

Also makes deleteCookie's `return executeDelete(callback)` consistent
(executeDelete already returns void, but the explicit pattern is clearer).

* removed button changed possition to make more acessibility (#7341)

* Revert "workspace renaming with path update (#7437)" (#7455)

This reverts commit e7c2c7c8722169407d98b8152ed55b3d13f85376.

* revert: feat(phase-1): allow user to customize keybindings#7163 (#7457)

* Revert "feat(phase-1): allow user to customize keybindings (#7163)"

This reverts commit 14532b48a6c55f8020f8b06646dfefaa6559aefa.

* Revert "chore: UI Polish for Zoom and Keybindings panel (#7376)"

This reverts commit 5151d29aac7c4e607115d0e5d56f31547b9a7a32.

* refactor: simplify environment list actions and improve styling (#7459)

* Feat/openapi sync beta tag (#7461)

* feat: introduce OpenAPI Sync beta feedback feature

- Added a feedback section in the OpenAPISyncTab and ConnectSpecForm to encourage user input during the beta phase.
- Styled the feedback message and button for better visibility.
- Updated the beta features list to include OpenAPI Sync and adjusted related components to reflect its beta status with appropriate badges.
- Enhanced the StatusBadge component to support a new 'xs' size for better integration in various UI elements.

* feat: integrate OpenAPI Sync beta feature toggle

- Updated the ImportCollectionLocation component to conditionally enable the "Check for Spec Updates" option based on the OpenAPI Sync beta feature status.
- Modified default preferences to disable OpenAPI Sync by default, ensuring users are not prompted for updates unless explicitly enabled.

* feat: enhance beta features integration in Preferences

- Updated the BETA_FEATURES array to use constants from utils/beta-features for better maintainability.
- Improved the handling of beta preferences by merging new preferences with existing ones, ensuring a smoother user experience when toggling features.

* feat: enhance OpenAPI Sync polling with beta feature toggle

- Integrated a beta feature toggle for OpenAPI Sync polling, allowing conditional activation based on user settings.
- Updated the pollingEnabled logic to incorporate the new beta feature status, ensuring better control over sync behavior.

* feat: implement temporary workspace creation and confirmation flow (#7462)

* feat: implement temporary workspace creation and confirmation flow

* fixes

* Replace SpaceX external API with local graphql-yoga mock server (#7471)

* chore: switch to locally hosted graphql server

* chore: additional graphql check

* chore: error handling

* feat: integrate deferred loading for saving state in DotEnvFileEditor (#7463)

* feat: remove .bru reference in error message (#7479)

Co-authored-by: Thomas Vackier <[email protected]>

* fix(collection-watcher): prevent crash when deleting collections (#7470)

* fix(collection-watcher): guard against events firing after collection deletion

When deleting an OpenAPI-synced collection, saveBrunoConfig() writes to
bruno.json which creates buffered chokidar events (80ms stabilityThreshold).
If the collection directory is removed before those events fire,
getCollectionFormat() throws "No collection configuration found" for each
.bru file in the collection.

Add fs.existsSync(collectionPath) guards in the change, unlink, and
unlinkDir handlers to bail out early when the collection root no longer exists.

* fix(workspaces): ensure collection watcher stops before deletion

Added logic to remove the collection from the watcher when deleting files, preventing chokidar from firing events on a directory that is being removed. This change enhances stability during collection deletions by ensuring the watcher is properly managed.

* refactor(workspaces): remove redundant collection watcher logic during deletion

Eliminated the logic for stopping the collection watcher before deletion, streamlining the action for removing collections from workspaces. This change simplifies the code and maintains functionality without unnecessary complexity.

* test(collection): add integration test for collection deletion functionality

Introduced a new test suite to verify the deletion of collections from the workspace overview. The test ensures that collections are properly removed from both the UI and the file system, confirming the absence of any uncaught errors during the deletion process. This addition enhances the test coverage for collection management features.

* feat(collection): implement deleteCollectionFromOverview utility function

Added a new utility function to delete a collection directly from the workspace overview page. This function encapsulates the steps required to navigate the UI, confirm deletion, and ensure the collection is removed from both the interface and the file system. Updated the corresponding test to utilize this new function, enhancing code reusability and test clarity.

* fix(collection-watcher): add guards for collection path existence and error handling

Enhanced the unlink and unlinkDir functions to check for the existence of the collection path before proceeding. Added error handling for the getCollectionFormat function to prevent crashes when the collection format cannot be retrieved. These changes improve stability and robustness during collection deletion operations.

* feat: improve OpenAPI Sync tab UX and fix sync flow bugs (#7467)

* fix: specify OpenAPI 3.x in error messages for file uploads and URL validation

Updated error messages in ConnectSpecForm and ConnectionSettingsModal to clarify that only OpenAPI 3.x specifications are valid. Enhanced useOpenAPISync hook to reflect the same specificity in error handling for invalid URLs.

* feat(OpenAPISpecTab): add pretty-printing for JSON content in API spec viewer

Implemented a new function to pretty-print JSON content for improved readability in the OpenAPISpecTab component. This enhancement ensures that JSON specifications are displayed in a more user-friendly format while leaving YAML content unchanged.

* feat(OpenAPISyncHeader): resolve and display absolute file paths for local sources

Added functionality to resolve relative file paths to absolute paths for better user experience in the OpenAPISyncHeader component. Implemented state management and side effects to handle path resolution based on the source URL, enhancing the display of local file paths.

* feat(OpenAPISyncTab): enhance collection status display and add endpoint counting utility

Refactored the CollectionStatusSection to streamline the display of collection drift status, integrating loading states and improved messaging for initial sync scenarios. Introduced a new utility function to count HTTP endpoints in OpenAPI specifications, enhancing the overall functionality of the OpenAPISyncTab. Additionally, updated the OpenAPISyncHeader and OverviewSection to utilize stored specification metadata for better user experience.

* refactor: improve OpenAPI Sync endpoint handling

- Enhanced the logic for adding new requests by ensuring existing files are verified before removal to prevent accidental deletions.
- Streamlined the process of adding new endpoints, including checks for existing files and merging requests to maintain user customizations.
- Added comments for clarity on the purpose of changes, particularly regarding filename collision prevention and file content verification.

* style(OpenAPISyncTab): update styles for improved visual feedback

- Changed background color for the 'type-spec-modified' class to a warning color for better distinction.
- Updated text color and background for the SyncReviewPage to enhance readability and visual hierarchy.
- Adjusted default expanded states for endpoint sections to improve user experience during sync reviews.

* chore: update .gitignore and enhance OpenAPISyncTab components

- Added new entries to .gitignore for agent-related files and skills-lock.json.
- Modified StyledWrapper to improve overflow handling and added sticky headers for better visibility.
- Introduced loading state in SpecDiffModal with a spinner for improved user feedback during rendering.

* feat(OpenAPISpecTab): integrate fast-json-format for improved JSON rendering

- Replaced the JSON parsing and stringifying logic with fast-json-format for better performance in pretty-printing API specifications.
- Updated StyledWrapper in OpenAPISyncTab to change background and text colors for enhanced visual consistency.
- Modified DisconnectSyncModal button to include a secondary color for improved visibility during user interactions.

* fix(OpenAPISyncTab): correct punctuation in status messages and subtitles

- Removed unnecessary trailing periods in messages related to syncing and restoring specifications across CollectionStatusSection and OverviewSection components.
- Updated SyncReviewPage to correct grammatical error in the description of spec updates.

* fix(OpenAPISyncTab): update URL validation to use isHttpUrl

- Replaced isValidUrl with isHttpUrl in ConnectSpecForm and ConnectionSettingsModal components to ensure only valid HTTP URLs are accepted.
- Updated the logic for enabling the save button based on the new URL validation method.

* fix(OpenAPISyncTab): normalize source URL before validation

- Trimmed the source URL in ConnectionSettingsModal to ensure consistent validation with isHttpUrl.
- Updated state initialization for URL and filePath to use the normalized source URL, improving handling of user input.

* add missing color to scrollbar-color property (#7481)

* refactor(OpenAPISyncTab): streamline component logic and enhance user feedback (#7483)

- Removed unused props and improved error handling in OpenAPISyncTab components.
- Updated messaging in CollectionStatusSection and OverviewSection for clarity.
- Enhanced the SpecDiffModal to provide better visual feedback on changes.
- Refactored sync flow logic to ensure accurate endpoint categorization and improved performance.
- Added new utility functions for better handling of spec changes and endpoint comparisons.

* fix: convert non-string variable values to strings during postman import (#7476)

* refactor: optimize debounced save functionality (#7495)

* fix(RequestTabPanel): update loading message for better user feedback (#7492)

Co-authored-by: Chirag Chandrashekhar <[email protected]>

* fix(openapi-sync): simplify IPC calls, fix state priorities, and improve stored spec missing UX (#7489)

* refactor(OpenAPISyncTab): remove unused props and streamline IPC calls

- Eliminated unnecessary sourceUrl prop from various components and hooks in the OpenAPISyncTab.
- Improved pretty-printing logic in OpenAPISpecTab to handle non-JSON content gracefully.
- Updated IPC calls to remove redundant parameters, enhancing code clarity and maintainability.

* feat(OpenAPISyncTab): enhance user interaction and visual feedback

- Added onTabSelect prop to OpenAPISyncTab for improved tab navigation.
- Updated color properties in StyledWrapper for better consistency with theme.
- Replaced IconClock with IconAlertTriangle in CollectionStatusSection for clearer status indication.
- Enhanced messaging in OverviewSection and SpecStatusSection to provide clearer user guidance.
- Introduced handleRestoreSpec function in useSyncFlow for better spec restoration handling.

* fix(OpenAPISyncTab): update button labels for clarity in OverviewSection

- Changed button label from 'restore' to 'spec-details' for better context.
- Updated the button text from 'View Details' to 'Go to Spec Updates' to enhance user understanding of navigation options.

* refactor(OpenAPISyncTab): remove unused props and streamline component logic

- Eliminated unnecessary props from OpenAPISyncTab, CollectionStatusSection, and SpecStatusSection for cleaner code.
- Removed commented-out code in OverviewSection and SpecStatusSection to enhance readability.
- Introduced posixifyPath utility function in filesystem.js to standardize path formatting.

* fix(OpenAPISyncTab): update openapi config handling to support array format

- Modified the logic in loadBrunoConfig to handle openapi as an array, ensuring consistent resolution of source URLs for all entries. This change improves the configuration handling for OpenAPI specifications.

* fix(OpenAPISyncTab): improve openapi config handling and merge logic

- Updated loadBrunoConfig to ensure openapi is treated as an array, enhancing source URL resolution.
- Modified mergeWithUserValues to handle cases where specItems may be undefined, improving robustness in merging user values with specifications.

* feat(bruno-js): add hasCookie function to cookie jar shim for improved cookie management (#7501)

* refactor: optimize formik value handling and improve save conditions (#7507)

* refactor: optimize formik value handling and improve save conditions

* fix

* fix: clear draft on save and update dependencies in useEffect (#7512)

* feat: include pinned data in filtering for more accurate results in env variables search (#7513)

* feat: enhance ScriptError with source context and remove auto-commenting of untranslated pm commands (#7449)

* feat: enhance ScriptError with source context, code snippets, and navigation

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* feat: remove auto-commenting of untranslated pm commands during import

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* feat: update CodeSnippet styles to use theme colors for error and warning highlights

* fix: remove unused SCRIPT_TYPES import from network IPC module

* refactor: remove unused functions and clean up source-context utility

- Removed `getUnifiedScriptContext`, `getWarningSourceGroups`, and related helper functions from `source-context.js` to streamline the utility.
- Updated tests in `source-context.spec.js` to reflect the removal of unused functions, ensuring only relevant tests for `findLineInSource` and `getScriptContext` remain.

* refactor: simplify ScriptError component and update styles

* refactor: streamline tab management in Script components

* refactor: enhance tab management in ScriptError and add testsMetadata handling in prepare-request

* refactor: improve error source identification in ScriptError component

- Enhanced the logic for determining error source types by introducing separate checks for folder and collection files.
- Updated the handling of folder file names to ensure accurate UID retrieval and labeling.
- Streamlined the overall structure of the getErrorSourceInfo function for better readability and maintainability.

* refactor: improve ScriptError component and enhance styling

- Simplified the conditions for displaying the ScriptError component in ResponsePane.
- Updated navigation logic in ScriptErrorCard to ensure proper handling of source information.
- Adjusted styles in StyledWrapper to allow for visible overflow.
- Enhanced ScriptErrorIcon to accept additional class names for better styling flexibility.
- Minor layout adjustments in RunnerResults ResponsePane for improved UI consistency.

* refactor: simplify test description for untranslated pm commands and consolidate error formatter imports

* fixes

* refactor: update focusedTab logic in Script components to use collection and folder UIDthe respective collection and folder UID instead of the activeTabUid.

* feat: add buildErrorContext utility for enhanced error handling in network IPC

- Introduced a new utility function `buildErrorContext` to construct detailed error context from script errors.
- This function parses error locations, adjusts line numbers, and retrieves relevant sou…
maxenceleblanc pushed a commit to maxenceleblanc/curly_cats2 that referenced this pull request Jul 20, 2026
…sebruno#7462)

* feat: implement temporary workspace creation and confirmation flow

* fixes
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.

2 participants