Skip to content

feat(variables): revamp the read-only Variables tab - #8784

Merged
sachin-thakur-bruno merged 26 commits into
usebruno:mainfrom
pooja-bruno:feat/variables-tab-revamp
Aug 14, 2026
Merged

sachin-thakur-bruno merged 26 commits into
usebruno:mainfrom
pooja-bruno:feat/variables-tab-revamp

Conversation

@pooja-bruno

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

Copy link
Copy Markdown
Collaborator

BRU-3956

Description

Rewrites the read-only Variables tab so it uses the same table as requests and environments, keeps object values foldable with that state remembered across tab switches, and adds a per-row copy button.

Problem

  • Expanding a large nested object did not survive a tab switch. react-inspector keeps its expand state in component state, so leaving the tab and returning collapsed everything and you expanded it again from scratch on every visit.

  • There was no way to copy a value. A collapsed object could not be copied at all, and an expanded one meant selecting text by hand across several lines.

  • The table also did not match the tables in requests and environments: different row height, borders, header styling, and hover behaviour.

Fix

  • Replaced the react-inspector tree with EditableTable, which requests and environments already use, so row height, borders, header, hover states, and column resizing all come from one place.

  • Object and array values now render in a CodeMirror editor inside the cell, with line numbers and a fold gutter. Folding writes the fold position to localStorage against the tab, so the cell comes back folded on the next visit. The cell is height-capped and scrolls internally, which stops a large value from stretching the row. A value can also be opened in a resizable drawer on the right.

  • Each row has a copy button that appears on hover.

  • Secrets are revealed one row at a time now. Previously a single toggle unmasked every secret in the tab at once.

  • Runtime and environment variables sit in separate collapsible sections with counts. Scroll position, collapsed sections, revealed secrets, the open drawer and its width, and column widths are all remembered per tab. Switching environment clears the state that belonged to the old environment's values.

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.
Screen.Recording.2026-08-07.at.7.17.55.PM.mov

Summary by CodeRabbit

  • New Features
    • Introduced a redesigned Variables tab with resizable sections, sorting, scrolling, secret reveal controls, and object details drawers.
    • Added read-only variable values with copying, masking, syntax highlighting, and object previews.
    • Added optional editor folding, persisted scroll positions, and restored editor view state.
  • Bug Fixes
    • Improved variable highlighting across editor modes.
    • Variable popups now close appropriately when scrolling.
  • Tests
    • Added comprehensive coverage for Variables tab interactions, persistence, folding, sorting, and empty states.

@coderabbitai

coderabbitai Bot commented Jul 27, 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

The PR replaces the Variables tab with a persisted, sectioned editor. It adds object inspection, secret controls, folding, scrolling, shared CodeMirror styling, scoped persistence, and Playwright coverage.

Changes

Variables editor

Layer / File(s) Summary
Shared editor styling and modes
packages/bruno-app/src/components/CodeEditor/..., packages/bruno-app/src/components/SingleLineEditor/..., packages/bruno-app/src/utils/codemirror/brunoVarInfo.js
Shared CodeMirror token styles are applied across editors. Variable overlays use the configured mode. Variable popups close on external scrolling.
Multiline editor view state and folding
packages/bruno-app/src/components/MultiLineEditor/..., packages/bruno-app/src/components/CodeEditor/index.js
Multiline editors persist and restore scroll and folding state. Folding, height, and overscroll behavior are configurable.
Sectioned Variables tab and details drawer
packages/bruno-app/src/components/RequestTabPanel/index.js, packages/bruno-app/src/components/VariablesEditor/...
The Variables tab now renders runtime and environment sections with sorting, persistence, secret controls, object values, a resizable details drawer, and empty states.
Variables tab test harness and coverage
tests/utils/page/..., tests/variables-tab/...
Playwright utilities, fixtures, and tests cover rendering, copying, masking, folding, drawers, sorting, environment changes, scrolling, persistence, and empty states.

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

Possibly related PRs

Suggested reviewers: sid-bruno

Poem

Variables gather, sections unfold,
CodeMirror paints each value in gold.
Drawers open, secrets hide,
Scrolls and folds remain inside.
Tests march on with steady stride.

🚥 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: revamping the read-only Variables tab.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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.

@pooja-bruno pooja-bruno reopened this Aug 3, 2026
@sachin-thakur-bruno
sachin-thakur-bruno merged commit ba97ddb into usebruno:main Aug 14, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants