Skip to content

feat(variables): adds variable scope selector with option to add as a secret - #8863

Merged
sachin-thakur-bruno merged 20 commits into
feature/variable-scope-selector-8665-internalfrom
feature/variable-scope-selector-8665-internal-create-env-secret
Aug 12, 2026
Merged

sachin-thakur-bruno merged 20 commits into
feature/variable-scope-selector-8665-internalfrom
feature/variable-scope-selector-8665-internal-create-env-secret

Conversation

@sachin-thakur-bruno

@sachin-thakur-bruno sachin-thakur-bruno commented Aug 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Closes #7382
Adopted from - #8665

BRU-3763

  • Add support for undefined variable addition to a Environment(Golbal/Collection), Request, Collection var, Parent Folder.
  • Provide support for adding var as a secret.
  • For defined variable user can click on var name and go to the defined scope.

Problem

When a user types an undefined variable placeholder like {{currency_id}} in the request editor, there is no way to create that variable in the correct scope without leaving the editor. Users must manually navigate to environment or collection settings to define the variable before it resolves. This breaks flow, especially for users migrating from Postman who expect inline variable creation.

Fix

  • Extended updateVariableInScope in providers/ReduxStore/slices/collections/actions.js to support creating new variables in Environment and Global scopes.

  • Added getAvailableAddToScopes in utils/collections/index.js to determine which scopes are currently available when adding a new variable:

    • Request — available when inside a request
    • Collection — always available
    • Environment / Global — available when an active environment exists
    • Folder — intentionally excluded for now
  • Added addToScopeSwitcher.js, for scope selector with a toggle and dropdown. For Environment and Global scopes, it also provides a Secret checkbox and an inline Create One flow for creating a new Environment/Global Environment when active environment is not present without leaving the variable tooltip.

  • Integrated the scope switcher into brunoVarInfo.js. The initially guessed scope is shown as the default badge. Changing the scope only changes where the variable will be saved next.

  • Added secret handling: checking Secret immediately masks the variable value and shows the eye toggle, even before the variable is saved.

  • Newly created variables are saved through an outside-click or immediately after creating the required scope.

  • When a variable already has a definition, its name itself becomes an underlined link. Clicking it takes the user directly to the scope where that variable is defined.

Screenshots

Before After
image image

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.
  • I've run the claude code review skill locally.

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.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • release/*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9621f60d-372e-4d60-9a84-7407d0a163c5

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@sachin-thakur-bruno
sachin-thakur-bruno marked this pull request as draft August 4, 2026 05:26
@sachin-thakur-bruno sachin-thakur-bruno changed the title Feature/variable scope selector 8665 internal create env secret feat(variables)/adds variable scope selector with option to add as a secret Aug 4, 2026
@sachin-thakur-bruno
sachin-thakur-bruno marked this pull request as ready for review August 12, 2026 11:28
@sachin-thakur-bruno
sachin-thakur-bruno merged commit 4e2fa9c into feature/variable-scope-selector-8665-internal Aug 12, 2026
@sachin-thakur-bruno sachin-thakur-bruno changed the title feat(variables)/adds variable scope selector with option to add as a secret feat(variables): adds variable scope selector with option to add as a secret Aug 12, 2026
sachin-thakur-bruno added a commit that referenced this pull request Aug 28, 2026
* feat(variables): add scope-aware variable creation (#8665)

* feat(variables): scope-aware secret creation, review fixes (#8863, #8974, #8981)

---------

Co-authored-by: Delta X <[email protected]>
Co-authored-by: sachin-thakur-bruno <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant