Skip to content

feat: add search functionality to environment variables. (#6659)#6966

Merged
sid-bruno merged 4 commits intomainfrom
feat/add-env-var-search-extended
Jan 30, 2026
Merged

feat: add search functionality to environment variables. (#6659)#6966
sid-bruno merged 4 commits intomainfrom
feat/add-env-var-search-extended

Conversation

@sid-bruno
Copy link
Collaborator

@sid-bruno sid-bruno commented Jan 29, 2026

Description

Extends #6659

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
    • Added searchable/filterable environment variables by name or value (case-insensitive) across Environment Settings and Workspace Environments.
    • New expandable search UI with icon, debounced input, and clear button for smoother searching.
    • Filtered results preserve existing behaviors (trailing empty row) and save/reset/draft workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

Walkthrough

Adds a debounced client-side search UI in EnvironmentDetails, forwards a new searchQuery prop into EnvironmentVariables, and implements client-side filtering and rekeyed virtualized rows (items { variable, index }, keyed by variable.uid) with adjusted form field indexing.

Changes

Cohort / File(s) Summary
EnvironmentVariables — search prop & virtualization
packages/bruno-app/src/components/Environments/.../EnvironmentVariables/index.js, packages/bruno-app/src/components/WorkspaceHome/.../EnvironmentVariables/index.js, packages/bruno-app/src/components/EnvironmentVariablesTable/index.js
Adds searchQuery prop, computes filteredVariables (case-insensitive name/value filter), switches virtualization items to { variable, index } keyed by variable.uid, and updates all form field names/handlers to use the actual index. Also adds renderExtraValueContent prop usage.
EnvironmentDetails — search UI & debouncing
packages/bruno-app/src/components/Environments/.../EnvironmentDetails/index.js, packages/bruno-app/src/components/WorkspaceHome/.../EnvironmentDetails/index.js
Introduces search UI state, useDebounce for a debounced query, handlers to open/clear/blur the input, toggles search in header actions, and passes debounced searchQuery to EnvironmentVariables.
StyledWrapper — search input styling
packages/bruno-app/src/components/Environments/.../StyledWrapper.js, packages/bruno-app/src/components/WorkspaceHome/.../StyledWrapper.js
Adds .actions { align-items: center } and a .search-input-wrapper with icon, input, and clear button styles integrated into header actions.

Sequence Diagram(s)

sequenceDiagram
    participant User as "User"
    participant ED as "EnvironmentDetails\n(header UI)"
    participant DB as "useDebounce"
    participant EV as "EnvironmentVariables"
    participant MEM as "useMemo (filter)"
    participant TV as "TableVirtuoso"

    User->>ED: type in search input
    ED->>DB: update raw query
    DB-->>ED: debouncedSearchQuery
    ED->>EV: pass searchQuery prop
    EV->>MEM: compute filteredVariables (name/value, case-insensitive)
    MEM-->>EV: filteredVariables
    EV->>TV: render rows (items `{ variable, index }`) keyed by `variable.uid`
    TV-->>User: display filtered rows
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • PR #6330: Touches EnvironmentVariables/EnvironmentVariablesTable and introduces similar search/propagation changes.
  • PR #6407: Modifies EnvironmentVariablesTable to accept and handle a searchQuery—overlaps on filtering logic.
  • PR #6659: Adds search plumbing into EnvironmentVariables flow and filtered rendering patterns similar to this change.

Suggested reviewers

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

Poem

🔎 A whisper typed, then gently slowed,
Rows shrink and surface as queries go,
UIDs anchor each tidy line,
Memo hums and indices align —
A little search that helps devs glow. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main feature added: search functionality for environment variables. It directly matches the changeset's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-env-var-search-extended

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.

@github-actions
Copy link

github-actions bot commented Jan 29, 2026

CLI Test Results

  1 files  ±0  145 suites  ±0   43s ⏱️ -16s
242 tests ±0  242 ✅ ±0  0 💤 ±0  0 ❌ ±0 
310 runs  ±0  309 ✅ ±0  1 💤 ±0  0 ❌ ±0 

Results for commit 20be382. ± Comparison against base commit e1c01eb.

♻️ This comment has been updated with latest results.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds debounced search/filtering for environment variables in both Workspace and Environment Settings “Environment Details” views.

Changes:

  • Adds a search input (with clear button) to the Environment Details header in both Workspace and Settings.
  • Threads a debounced searchQuery prop down to EnvironmentVariables and filters rows by variable name/value.
  • Adds/updates styled-components rules for the new search UI controls.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/EnvironmentDetails/index.js Adds search input state + debounced query and passes it into EnvironmentVariables.
packages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/EnvironmentDetails/StyledWrapper.js Styles the new search controls in the header actions area.
packages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js Implements filtering via searchQuery and adapts the virtualized table data shape to preserve Formik indices.
packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/index.js Mirrors the Environment Details search input behavior for Environment Settings.
packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/StyledWrapper.js Styles the new search controls in the Environment Settings details header.
packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js Implements filtering via searchQuery and adapts the virtualized table data shape to preserve Formik indices.

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@packages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js`:
- Around line 1-2: Remove the unused imports from the EnvironmentVariables
component: delete useRef and useMemo from the React import and remove the unused
TableVirtuoso import; update the import line to only import React (and any
actually used hooks) so the file no longer imports useRef, useMemo, or
TableVirtuoso.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/EnvironmentVariablesTable/index.js (1)

397-417: Filtering logic is sound; minor simplification possible.

The filtering correctly preserves the last empty row and uses case-insensitive matching. The !! on line 415 is unnecessary since nameMatch and valueMatch are already booleans.

🔧 Suggested simplification
-      return !!(nameMatch || valueMatch);
+      return nameMatch || valueMatch;

Comment on lines +1 to +2
import React, { useCallback, useRef, useMemo } from 'react';
import { TableVirtuoso } from 'react-virtuoso';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove unused imports.

useRef, useMemo, and TableVirtuoso are imported but never used in this file. These appear to be leftover artifacts.

🧹 Proposed fix
-import React, { useCallback, useRef, useMemo } from 'react';
-import { TableVirtuoso } from 'react-virtuoso';
+import React, { useCallback } from 'react';
📝 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
import React, { useCallback, useRef, useMemo } from 'react';
import { TableVirtuoso } from 'react-virtuoso';
import React, { useCallback } from 'react';
🤖 Prompt for AI Agents
In
`@packages/bruno-app/src/components/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js`
around lines 1 - 2, Remove the unused imports from the EnvironmentVariables
component: delete useRef and useMemo from the React import and remove the unused
TableVirtuoso import; update the import line to only import React (and any
actually used hooks) so the file no longer imports useRef, useMemo, or
TableVirtuoso.

@sid-bruno sid-bruno merged commit 559946b into main Jan 30, 2026
8 of 9 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.

4 participants