feat: add search functionality to environment variables. (#6659)#6966
feat: add search functionality to environment variables. (#6659)#6966
Conversation
WalkthroughAdds a debounced client-side search UI in EnvironmentDetails, forwards a new Changes
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
searchQueryprop down toEnvironmentVariablesand 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.
...onments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js
Outdated
Show resolved
Hide resolved
...ents/WorkspaceHome/WorkspaceEnvironments/EnvironmentList/EnvironmentDetails/StyledWrapper.js
Outdated
Show resolved
Hide resolved
...eHome/WorkspaceEnvironments/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js
Outdated
Show resolved
Hide resolved
feat: add search functionality to environment variables. (#6659)
There was a problem hiding this comment.
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 sincenameMatchandvalueMatchare already booleans.🔧 Suggested simplification
- return !!(nameMatch || valueMatch); + return nameMatch || valueMatch;
| import React, { useCallback, useRef, useMemo } from 'react'; | ||
| import { TableVirtuoso } from 'react-virtuoso'; |
There was a problem hiding this comment.
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.
| 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.
Description
Extends #6659
Contribution Checklist:
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
✏️ Tip: You can customize this high-level summary in your review settings.