Repository navigation
fix: improve environment variable comparison by stripping UIDs - #7100
Conversation
There was a problem hiding this comment.
Pull request overview
This PR targets BRU-2647 by improving how the Environment Variables editor detects changes and maintains UI focus, specifically by avoiding UID-driven false diffs and adding an end-to-end regression test around focus retention during save.
Changes:
- Added a Playwright regression test to ensure the environment variable name input keeps focus after the save hotkey.
- Introduced
stripEnvVarUidand updated EnvironmentVariablesTable’s “modified/has changes” comparisons to ignore UIDs. - Changed the virtualized table row keying strategy (
computeItemKey) to avoid UID-based remounts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/environments/focus-retention/environment-focus.spec.ts | Adds an E2E test verifying focus retention after Ctrl+S save. |
| packages/bruno-app/src/utils/environments.js | Adds a helper to remove UID (and currently other fields) for comparisons. |
| packages/bruno-app/src/components/EnvironmentVariablesTable/index.js | Uses UID-stripped comparisons for modified/draft/save detection and changes row key computation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Found another issue with search that is not tied for v3.1.0 so moving the fix to another PR |
WalkthroughThis PR refactors environment variable comparison logic by introducing UID stripping to prevent false change detection, updates auto-save validation thresholds from 100ms to 500ms, and adds a test for environment variable focus retention during saves. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
Description
JIRA
indexas it's a more stable id compared to theuidsince it changes on each saveContribution 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
Bug Fixes
Chores