Skip to content

fix: keep variable tooltips above the New Request modal - #9196

Merged
lohit-bruno merged 2 commits into
usebruno:mainfrom
y0geshpatil:y0geshpatil-bugfix/7927-new-request-variable-tooltip
Oct 23, 2026
Merged

lohit-bruno merged 2 commits into
usebruno:mainfrom
y0geshpatil:y0geshpatil-bugfix/7927-new-request-variable-tooltip

Conversation

@y0geshpatil

@y0geshpatil y0geshpatil commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

REF - BRU-3302

Description

Keep URL-variable hover information readable and interactive in the New Request dialog, including where the popup extends beyond the dialog edge. The production change is limited to the variable popup's stacking layer; the other changes add behavioral regression coverage and two shared locators.

Outstanding contribution items: native screenshot upload is blocked, and the exact parallel review workflow has not been completed. The local review method and remaining checklist items are disclosed below.

Problem

Fixes #7927.

The variable information popup is appended directly to document.body with position: fixed and z-index: 10. The modal's stacking context is at z-index: 20, so both the dialog card and its backdrop cover the popup. A visibility-only assertion still passes despite the occlusion.

Reproduced against upstream main 5afc5c78f7044711352724d5617b2290e37b0f24 before changing production code:

  1. Create a temporary collection and select an environment containing apiKey = example-api-key.
  2. Open New Request and enter a request name.
  3. Enter {{apiKey}}, or https://example.com/?key={{apiKey}} to place the popup across the dialog's right edge.
  4. Hover {{apiKey}}. The popup is behind the modal and its value/copy control are obscured.

This is distinct from #5367 / #5459: that fix raised the autocomplete hints container, not the variable-information hover popup.

Fix

Raise .CodeMirror-brunoVarInfo to z-index: 30: above the existing modal layer (20) and below autocomplete hints (50). Keep the body mount, viewport positioning, modal styles, and popup lifecycle unchanged. No dependencies or unrelated styling changes.

The new Electron/Playwright cases exercise both URL positions using isolated user data and temporary collections. They select the exact apiKey autocomplete suggestion with overlapping apiKeyBackup present, check the popup's viewport bounds and center/corner hit targets with document.elementFromPoint, copy the value without closing the dialog, dismiss the popup, create the request, and open/edit its variable popup outside the dialog. Clipboard assertions use the existing isolated fake-clipboard fixture, not the system clipboard.

Validation

Run locally on macOS 26.3.1 (Apple Silicon), Node 22.12.0, Electron 37.6.1. The original report is on Windows; Windows/Linux runtime validation was not performed locally.

  • Baseline: both new cases fail specifically at the popup hit-testing assertion while the visibility/content assertions pass.
  • Fixed: both new cases pass twice with two workers (4/4).
  • Review follow-up (547c2b95d): the old substring locator fails with a strict-mode error when both apiKey and apiKeyBackup are offered. Scoping to visible CodeMirror hint lists and matching the option name exactly fixes that ambiguity without using .first(). Both updated cases pass twice with two workers (4/4).
  • Existing popup editing, references, navigation and focus cases: 4/4 pass.
  • Popup, autocomplete, modal and single-line editor unit suites: 139/139 tests, 4/4 suites pass.
  • Focused lint: 0 errors; three existing warnings in tests/utils/page/locators.ts (unused import and two use-before-definition warnings) remain unchanged.

Commands below show the actual test selectors; local reporter/output-directory flags and log redirections are omitted:

npx playwright test tests/variable-tooltip/new-request-tooltip.spec.ts --project=default --workers=1
# Baseline: 2 expected failures at the occlusion assertion.

npx playwright test tests/variable-tooltip/new-request-tooltip.spec.ts --project=default --workers=2 --repeat-each=2

npx playwright test tests/variable-tooltip/variable-tooltip.spec.ts --project=default --workers=2 --grep 'should test tooltip with variable references|should keep tooltip open while editing|should go to definition into Environment Settings|should not steal focus'

npm test --workspace=packages/bruno-app -- --runInBand src/utils/codemirror/brunoVarInfo.spec.js src/utils/codemirror/autocomplete.spec.js src/components/Modal/Modal.spec.jsx src/components/SingleLineEditor/index.spec.js

npm run lint -- packages/bruno-app/src/globalStyles.js tests/utils/page/locators.ts tests/variable-tooltip/new-request-tooltip.spec.ts

Local review and AI disclosure

GitHub Copilot significantly assisted with investigation, implementation, regression tests and this description. The repository's .claude/skills/code-review/SKILL.md was invoked through Copilot. All eight applicable review lenses were applied in one consolidated local Copilot-hosted review using Claude Sonnet 5: correctness, architecture, conventions, React, cross-platform, security, DSL changes and E2E tests. No findings remained; the final screenshot fade-in wait was also reviewed.

The Claude Code CLI was unavailable and was not executed. The prescribed parallel reviewer fan-out was not performed. The exact review-workflow checklist item remains unchecked rather than implying either of those steps ran.

Screenshots

Authentic before/after screenshots of the same isolated 1000 x 720 Electron scenario were captured after the popup's fade-in completed and retained locally. They contain only example data. They are not attached yet: the documented native POST https://uploads.github.com/user-attachments/assets flow returned HTTP 404 with the upstream repository ID and existing authorized GitHub credentials. No attachment URL was returned. No screenshots, traces or generated artifacts are committed.

Before After
Captured locally; native attachment upload pending. Captured locally; native attachment upload pending.

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.

The existing issue #7927 is linked above; no duplicate issue was created. See the explicit local review-method disclosure and outstanding workflow step above.

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

  • Bug Fixes
    • Improved variable information popups so they appear above request dialogs without covering autocomplete suggestions.
    • Ensured variable popups remain usable when positioned near or across the edge of the request dialog, including copying variable values and reopening them after saving a request.
    • Improved autocomplete selection when multiple variables have similar names by showing and targeting the correct visible suggestions.

Place body-mounted variable information above modals while keeping autocomplete hints above it. Add isolated Electron regressions for popup occlusion and interactions under the URL and across the dialog edge.

Co-authored-by: Copilot App <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: efcd3c94-9938-4396-9038-58855c1211cc

📥 Commits

Reviewing files that changed from the base of the PR and between 0b23f59 and 547c2b9.

📒 Files selected for processing (2)
  • tests/utils/page/locators.ts
  • tests/variable-tooltip/new-request-tooltip.spec.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


Walkthrough

The change raises the variable popup above the New Request modal while keeping it below autocomplete hints. New Playwright coverage checks popup visibility, copying, request creation, and reopening in two URL positions.

Changes

New Request variable popup

Layer / File(s) Summary
Variable popup stacking order
packages/bruno-app/src/globalStyles.js
The .CodeMirror-brunoVarInfo popup now uses z-index 30, above modals at 20 and below autocomplete hints at 50.
Tooltip interaction coverage
tests/utils/page/locators.ts, tests/variable-tooltip/new-request-tooltip.spec.ts
The locator uses visible autocomplete containers and exact option names. Playwright coverage validates variable selection, popup visibility, copy behavior, request creation, and reopening across two URL positions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 547c2

Variable-information popups in the New Request dialog now remain visible and usable above the modal while autocomplete continues to take precedence. The change includes regression coverage for edge placement and popup interactions, with no active merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue [#7927] by increasing the variable tooltip z-index above the modal and adding regression coverage for visibility and interaction near modal edges.
Out of Scope Changes check ✅ Passed All changes support the linked issue [#7927]. The styling change, locator updates, and regression tests are directly related to the tooltip layering bug.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: keeping variable tooltips above the New Request modal.
✨ 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

A popup rises above the frame
Hints remain ahead in rank
URL tokens reveal their value
Copy works while dialogs stay
Tests confirm the tooltip path

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

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.

🟢 Approval recommended

The production change is minimal and targeted, and the added Playwright coverage meaningfully guards against regressions (with only a small locator-hardening suggestion).

Pull request overview

This PR fixes the variable-info hover popup being occluded by the New Request modal by adjusting its stacking order, and adds Playwright regression coverage to ensure the popup remains readable and interactive even when it extends beyond the dialog’s edge.

Changes:

  • Raise .CodeMirror-brunoVarInfo z-index so the body-mounted variable tooltip renders above modals.
  • Add a new Playwright spec covering tooltip usability inside the New Request dialog (including occlusion/hit-testing and clipboard copy).
  • Add shared locators for the New Request URL variable token and CodeMirror autocomplete hint items.
File summaries
File Description
tests/variable-tooltip/new-request-tooltip.spec.ts Adds regression tests verifying the tooltip is not occluded in the New Request modal and remains interactive.
tests/utils/page/locators.ts Introduces shared locators used by the new tests (New Request variable token + CodeMirror hint item).
packages/bruno-app/src/globalStyles.js Updates the variable tooltip z-index to render above modals while staying below autocomplete hints.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/utils/page/locators.ts Resolved
Scope hint lookup to visible CodeMirror hint lists and match option names exactly. Exercise apiKey alongside apiKeyBackup so substring ambiguity fails the existing New Request regression.

Co-authored-by: Copilot App <[email protected]>
@y0geshpatil

Copy link
Copy Markdown
Contributor Author

Could a maintainer approve the fork workflow runs for commit 547c2b9? Windows Tests, Linux Tests, and Lint Checks are all action_required before any jobs run. The locator review feedback is addressed and its regression passes locally.

Snyk is separately blocked with You have used your limit of private tests; that appears to need action on the upstream Snyk account rather than a code change.

@aditya-bruno

Copy link
Copy Markdown
Collaborator

Hi @y0geshpatil, thanks for the PR, and sorry for the long wait. We reviewed it and it fixes #7927, so we're moving it forward to the engineering team for review. I'll keep you posted here.

@lohit-bruno
lohit-bruno merged commit faef248 into usebruno:main Oct 23, 2026
1 of 2 checks passed
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.

UI/UX Bug: Modal overlaps popover/tooltip in "New Request" window

4 participants