Skip to content

Introduce selective Folder Runs#8346

Open
timolex wants to merge 7 commits into
usebruno:mainfrom
timolex:feature/selective-folder-runs
Open

Introduce selective Folder Runs#8346
timolex wants to merge 7 commits into
usebruno:mainfrom
timolex:feature/selective-folder-runs

Conversation

@timolex

@timolex timolex commented Jun 23, 2026

Copy link
Copy Markdown

Description

This pull request introduces selective Folder Runs, which enhances the existing Folder Run modal with a second section to the right, giving users the same freedoms of request checkboxes & rearrangement on the Folder running level, too:

Screenshot 2026-06-23 at 15 52 58

The added functionality comprises:

  • Folder Run modals always open with a request picker in a second section on the right of existing options
  • Folders' requests can be (de-)selected (using checkboxes) and rearranged (using drag-and-drop) individually
  • The Folder Run request picker lists all requests from the Folder including sub-Folders (recursively) in a flattened fashion
  • Per default, all requests listed in the Folder Run request picker are checked, i.e., selected to be run (☑️ )
  • The new Run button for selective Folder Runs indicates the number of selected requests to be run (e.g. Run N Requests, while N is the number of checked requests)
  • The existing Run as well as Recursive Run now indicate the number of requests to be run (i.e. Recursive Run (9), Run (3))
  • At the top of the Folder Run request picker is a counter, tracking the number of selected requests (N) in relation to the number of recursively flattened requests part of the folder and its sub-folders (M), i.e. 6 of 9 selected

The following Playwright E2E-tests covering the new feature have been implemented (in tests/runner/selective-folder-run.spec.ts):

  1. "shows request picker in folder run modal with all requests selected by default"
    • Validates the request picker UI appears with all 3 run modes (Run, Recursive Run, Run N Request(s))
    • Asserts all requests are auto-selected initially (N = M)
  2. "disables selective run when no requests are selected"
    • Verifies the "Run N Request(s)" button disables when all requests had been deselected
    • Asserts the counter shows N = 0, M > 0
  3. "runs only selected subset from folder request picker"
    • Deselects one request and executes
    • Validates only the selected requests are run (not the deselected one)
    • Asserts counter updates: N = M - 1 (one de-selected before running)
  4. "non-recursive run count is less than or equal to recursive run count"
    • Validates run mode labeling is correct
    • Asserts non-recursive count ≤ recursive count (folders with nested subfolders)

Helper Functions Added (in tests/utils/page/runner.ts)

  • getRunnerSelectionCounters() — parses the "N of M selected" indicator
  • openFolderRunModal() — navigates and opens the folder run modal
  • getRequestItemsInFolderModal() — retrieves request checkboxes
  • runSelectedRequestsInFolder() — executes selected requests

Contribution Checklist:

  • I've used AI significantly to create this pull request
    • Yes, the majority of this code was created using GitHub Copilot. However, I went through many iterations while always reading and critically analyzing synthesized code line-by-line. Running the unit test indicated in the contribution guide yielded the same result as when running them on the untouched main branch ✅
  • 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.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added selective request execution for folder runs, enabling you to run only chosen requests.
    • Introduced “Run N Requests” for recursive runs based on your current selection.
  • Improvements
    • Enhanced “Run Again” to re-run the correct subset of requests for the folder/runner context.
    • Runner configuration persistence is more reliable when selecting/reordering, controlled by a new persistence option.
    • Improved UI testability by adding identifiers to key request item elements.
  • Tests
    • Added Playwright coverage for selective folder runs, including selection/deselection behavior, counters, and result verification.

Copilot AI review requested due to automatic review settings June 23, 2026 14:34
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

This PR adds selectable folder runs in the runner modal, makes configuration persistence optional for that panel, updates "Run Again" request selection for folder results, and adds Playwright helpers and tests for folder modal selection, disabling, execution, and count behavior.

Changes

Selective folder run

Layer / File(s) Summary
Optional configuration persistence gate
packages/bruno-app/src/components/RunnerResults/RunConfigurationPanel/index.jsx
RunConfigurationPanel adds a persistConfiguration prop (default true) and a centralized persistRunnerConfiguration callback that gates all updateRunnerConfiguration dispatches, replacing prior direct dispatch calls in tag-change, drag-drop, selection, select-all, and reset handlers. Request checkbox and name elements receive data-testid attributes.
Folder run modal selection
packages/bruno-app/src/components/Sidebar/Collections/.../RunCollectionItem/index.js
The folder run modal now derives a folder-scoped request configuration, tracks selected request UIDs in state, renders RunConfigurationPanel in a two-panel modal, dispatches runCollectionFolder with selectedRequestUids/delay/tags, and includes a new "Run N Requests" button for recursive runs using the current selection.
Run again selection logic
packages/bruno-app/src/components/RunnerResults/index.jsx
"Run Again" now uses getSelectedRequestItemsForRunAgain helper that reruns current folder result items for folder runs and falls back to saved selected request items otherwise. Status equality checks tightened from loose to strict equality.
Playwright test utilities
tests/utils/page/runner.ts
New helpers open the folder run modal, parse selection counters ("N of M selected"), inspect request-item elements, and execute selected requests; runFolder refactored to delegate sidebar navigation to an internal helper.
Selective folder run test suite
tests/runner/selective-folder-run.spec.ts
New Playwright tests verify default selection (all requests), zero-selection disabling of the selective run button, selective execution excluding deselected requests, and recursive/non-recursive run count behavior with matching selection counters.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant RunCollectionItem
  participant RunConfigurationPanel
  participant runCollectionFolder
  participant RunnerResults

  User->>RunCollectionItem: Open folder Run modal
  RunCollectionItem->>RunConfigurationPanel: Render folder request list and selection state
  User->>RunConfigurationPanel: Select or deselect requests
  RunConfigurationPanel-->>RunCollectionItem: selectedRequestItems
  User->>RunCollectionItem: Click Run N Requests / Recursive Run
  RunCollectionItem->>runCollectionFolder: Dispatch selectedRequestUids, delay, tags
  RunnerResults->>runCollectionFolder: Run Again recomputes request UIDs via helper
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related issues

  • usebruno/bruno#8344 — The PR implements folder-scoped request selection, selection counters, and selective execution in the folder run modal.

Possibly related PRs

  • usebruno/bruno#6320 — Both PRs connect selective request execution to runCollectionFolder using selectedRequestUids.
  • usebruno/bruno#7505 — Both PRs update RunConfigurationPanel/index.jsx selection and persistence behavior.

Suggested reviewers

  • helloanoop
  • bijin-bruno
  • lohit-bruno
  • naman-bruno
  • sid-bruno

Poem

In folders deep, the runners choose,
Not every path they now must use.
A counted click, a slimmer run,
Then "Run Again" recalls the one.
🏃📁✨ Tests nod: "Yes, all is done."

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Introduce selective Folder Runs' directly describes the main feature addition across the changeset: enabling users to select and configure individual requests when running folders.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

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

Inline comments:
In `@tests/runner/selective-folder-run.spec.ts`:
- Line 15: Remove the `.serial` modifier from the test.describe.serial call in
the selective-folder-run.spec.ts file to ensure the test suite remains
parallel-safe. Change test.describe.serial('Selective Folder Run', () => { to
test.describe('Selective Folder Run', () => { so that tests can run concurrently
without ordering or shared-state dependencies, aligning with E2E testing
requirements.
- Around line 87-91: Replace the class-based selectors in the
selective-folder-run.spec.ts test with stable data-testid or role-based
locators. Specifically, update the locator calls that use `.request-name >
span:first-child` and `.checkbox-container` selectors to instead use data-testid
attributes or Playwright role selectors. This should be done in the innerText()
call and the checkbox click() action around lines 87-91, as well as any similar
class-based selectors mentioned in lines 107-108. These stable locators will
make the tests resilient to UI refactors and follow E2E testing best practices.
- Around line 29-32: The closeRunnerModal helper function is suppressing all
errors from the Escape key press and modal visibility wait operations, which
hides real cleanup failures and can cause state to leak between tests. Remove
the .catch(() => {}) error handlers from both the page.keyboard.press('Escape')
call and the page.locator('.bruno-modal-backdrop').first().waitFor() call in the
closeRunnerModal function to allow errors to propagate naturally and fail the
test when cleanup actually fails, making test failures more actionable and
maintaining deterministic behavior.

In `@tests/utils/page/runner.ts`:
- Around line 157-158: In the `openFolderRunMenu` function, the current approach
using `hasText(folderName).filter().first()` on line 157 and the re-querying
pattern around line 172 creates ambiguity when folder names repeat across
different hierarchy levels. Replace the `hasText` filter pattern with a
deterministic, level-scoped locator that performs exact matching within the
current hierarchy node. Use a locator approach that targets the folder at the
current level specifically rather than filtering by text content, ensuring
stable and unambiguous folder selection even when identical folder names exist
in different branches of the tree.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a05190b6-d745-46f8-b50a-6d7e21d74378

📥 Commits

Reviewing files that changed from the base of the PR and between 7adbc6b and 3c9674e.

📒 Files selected for processing (5)
  • packages/bruno-app/src/components/RunnerResults/RunConfigurationPanel/index.jsx
  • packages/bruno-app/src/components/RunnerResults/index.jsx
  • packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RunCollectionItem/index.js
  • tests/runner/selective-folder-run.spec.ts
  • tests/utils/page/runner.ts

Comment thread tests/runner/selective-folder-run.spec.ts Outdated
Comment thread tests/runner/selective-folder-run.spec.ts
Comment thread tests/runner/selective-folder-run.spec.ts Outdated
Comment thread tests/utils/page/runner.ts Outdated

Copilot AI 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.

Pull request overview

This PR introduces selective Folder Runs by extending the existing folder run modal to include a request-picker panel (checkbox selection + drag/drop ordering) so users can run only a chosen subset of requests within a folder (recursively).

Changes:

  • Adds a right-side RunConfigurationPanel to the folder run modal and wires selection into runCollectionFolder via selectedRequestUids.
  • Extends RunConfigurationPanel with a persistConfiguration flag so folder-level selection can be non-persistent.
  • Adds Playwright E2E coverage and new runner-page helpers for opening the folder run modal and interacting with the request picker.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/utils/page/runner.ts Adds runner helpers for parsing selection counters and opening/interacting with the folder-run modal UI.
tests/runner/selective-folder-run.spec.ts Adds E2E coverage validating default selection, disabling on empty selection, subset execution, and run-count labeling.
packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/RunCollectionItem/index.js Updates folder run modal layout and adds selective run button that passes selected request UIDs.
packages/bruno-app/src/components/RunnerResults/RunConfigurationPanel/index.jsx Adds persistConfiguration option and refactors persistence calls through a helper callback.
packages/bruno-app/src/components/RunnerResults/index.jsx Adjusts “Run Again” selection logic for folder vs collection runs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/utils/page/runner.ts
Comment thread tests/utils/page/runner.ts
As suggested by GitHub Copilot during AI PR review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@timolex

This comment was marked as outdated.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Fetch all review comments from CodeRabbit on this PR
gh pr view 8346 --repo usebruno/bruno --json reviews,comments

# Also get review thread comments
gh api repos/usebruno/bruno/pulls/8346/comments --jq '[.[] | select(.user.login == "coderabbitai") | {id: .id, path: .path, line: .line, body: .body, resolved: .resolved}]'

Length of output: 17725



@timolex No worries — happy to give reviewers a clear summary. All 4 of my comments are isolated to the new E2E test files and don't touch any app logic, so they should be straightforward for any contributor familiar with Playwright to address.


Summary of open review items

File: tests/runner/selective-folder-run.spec.ts

# Location Issue Fix
1 Line 15 test.describe.serial(...) forces sequential execution, which breaks parallel test runs and is unnecessary here since each test properly opens/closes its own modal. Change to test.describe(...).
2 Lines 87–91 & 107–108 Locators use fragile CSS class selectors: .request-name > span:first-child and .checkbox-container. These will break silently on any UI refactor. Replace with data-testid attributes or Playwright role/label selectors.
3 Lines 29–32 closeRunnerModal swallows all errors with .catch(() => {}) on both the Escape key press and the backdrop waitFor. Real cleanup failures are hidden, causing state leakage between tests. Remove the .catch(() => {}) handlers and let errors propagate.

File: tests/utils/page/runner.ts

# Location Issue Fix
4 Lines 157–158 openFolderRunMenu uses hasText(folderName).filter().first() which is ambiguous when the same folder name exists at multiple tree levels. Use a level-scoped, exact-match locator that targets only the folder at the current hierarchy node.

Items 1 and 3 are single-line changes. Item 2 requires adding data-testid attributes to the React components and updating the test locators. Item 4 is a locator refactor in the test utility.

Tagging suggested reviewers from the walkthrough: @helloanoop @lohit-bruno @naman-bruno @bijin-bruno @sid-bruno — any of you available to pick these up? 🙏

(∧ owo∧) 🐇

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

The PR description image shows the Collection Runner modal with a dark theme. The left panel lists Run (4 requests) and Recursive Run (5 requests) modes with delay/tag configuration fields. The right panel shows a request picker with "3 of 5 selected" and five items (POST Offers ✓, POST Preorder ✓, POST Order ✗, GET Get the weather ✓, POST Commit ✗). Footer buttons are Cancel, Recursive Run (5), Run (4), and Run 3 Requests.


@timolex No problem! All the details reviewers need are already in my summary above. To recap the quick wins:

Single-line fixes (no app knowledge needed):

  • Line 15 of tests/runner/selective-folder-run.spec.ts: test.describe.serial(test.describe(
  • Lines 29–32 of the same file: remove .catch(() => {}) on both the Escape key press and backdrop waitFor

Locator fixes (test-only, no React knowledge needed):

  • Lines 87–91 & 107–108: replace .request-name > span:first-child / .checkbox-container CSS class selectors with data-testid attributes (requires adding those attributes to the React components too) or Playwright role/label selectors
  • Lines 157–158 of tests/utils/page/runner.ts: tighten the folder locator to avoid ambiguity when the same folder name appears at multiple tree levels

Anyone comfortable with Playwright can handle items 1, 3, and 4 without touching app code at all. 🙏

(∧ owo∧) 🐇

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

The PR description image shows the Collection Runner modal: left panel has Run (4 requests) / Recursive Run (5 requests) modes with delay and tag fields; right panel has a request picker showing "3 of 5 selected" with POST Offers ✓, POST Preorder ✓, POST Order ✗, GET Get the weather ✓, POST Commit ✗. Footer buttons: Cancel, Recursive Run (5), Run (4), Run 3 Requests.


@timolex Totally understandable — here are the exact changes any reviewer can apply, no Bruno app knowledge required:


✅ Item 1 — tests/runner/selective-folder-run.spec.ts Line 15 (1-char change)

- test.describe.serial('Selective Folder Run', () => {
+ test.describe('Selective Folder Run', () => {

✅ Item 3 — Same file, Lines 29–32 (remove silent error swallowing)

- await page.keyboard.press('Escape').catch(() => {});
- await page.locator('.modal-backdrop').waitFor({ state: 'detached' }).catch(() => {});
+ await page.keyboard.press('Escape');
+ await page.locator('.modal-backdrop').waitFor({ state: 'detached' });

⚠️ Item 2 — Same file, Lines 87–91 & 107–108 (fragile CSS selectors)

These selectors need data-testid attributes added to the React components. This one does touch app code. If no one picks it up, I'd suggest tracking it as a follow-up issue — want me to open one?


⚠️ Item 4 — tests/utils/page/runner.ts Lines 157–158 (ambiguous folder locator)

The fix is to scope the locator to the specific tree level, but the exact approach depends on the sidebar's DOM structure. Also a good candidate for a follow-up issue if reviewers prefer.


Items 1 and 3 are truly trivial — any contributor can push those. Tagging again: @helloanoop @lohit-bruno @naman-bruno @bijin-bruno @sid-bruno 🙏

(∧ owo∧) 🐇

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