-
Notifications
You must be signed in to change notification settings - Fork 2k
Feature: Object Variable Interpolation #6317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature: Object Variable Interpolation #6317
Conversation
Added styling changes to accommodate objects
WalkthroughCSS styling updates to the CodeMirror variable info display, including increased max-width and adjusted text wrapping behavior, paired with refined value display logic that preserves falsy values like 0 and pretty-prints objects. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/bruno-app/src/globalStyles.js (1)
323-334: Updated wrapping/max-width works for pretty-printed values; consider aligning widths with editable viewThe switch to
overflow-wrap: break-word+white-space: pre-wrapand the widermax-widthis a good fit for multi-line JSON/object values and should avoid mid-word breaks.One minor polish to consider:
.var-value-displaynow usesmax-width: 17.1875rem, while.var-value-editable-displayand the editor internals still cap at13.1875rem. If the intent is to have read-only and editable views feel identical in width, it may be worth standardizing these values in a follow-up.packages/bruno-app/src/utils/codemirror/brunoVarInfo.js (1)
88-93: Display logic now correctly handles0and objects; consider a small follow-up for masked valuesThe new
updateValueDisplaylogic is a clear improvement:
- Preserves
0instead of treating it as empty.- Pretty-prints objects via
JSON.stringify(value, null, 2), which matches the newwhite-space: pre-wrapstyling.One follow-up you might consider (non-blocking):
getMaskedDisplaystill uses(value || '').length, so masked values that are0or plain objects (without alengthproperty) end up with an empty mask. If you expect secrets or masked vars to be numbers/objects as well, switching to something likeString(value ?? '').lengthwould make the masking consistent with this new display behavior.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/bruno-app/src/globalStyles.js(1 hunks)packages/bruno-app/src/utils/codemirror/brunoVarInfo.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation, never tabs
Use single quotes for strings instead of double quotes
Always add semicolons at the end of statements
No trailing commas in code
Always use parentheses around parameters in arrow functions, even for single parameters
For multiline constructs, put opening braces on the same line with a minimum of 2 elements for multiline formatting
No newlines inside function parentheses
Space before and after the arrow in arrow functions:() => {}
No space between function name and parentheses:func()notfunc ()
Semicolons should go at the end of the line, not on a new line
Function names should be concise and descriptive
Add JSDoc comments to provide details to abstractions
Avoid single-line abstractions where all that is being done is increasing the call stack with one additional function
Add meaningful comments to explain complex code flow instead of obvious comments
Files:
packages/bruno-app/src/globalStyles.jspackages/bruno-app/src/utils/codemirror/brunoVarInfo.js
🧬 Code graph analysis (1)
packages/bruno-app/src/utils/codemirror/brunoVarInfo.js (1)
packages/bruno-app/src/utils/common/codemirror.js (1)
value(8-8)
Description
Adds object interpolation to {{variables}} in a request body. Reduces time for consumers by not having to swap back and forth between the variables page and a request to see the data in a variable object.
Variable:


Problem:

Solution:

Now that the contents of the object are visible, dot notation can be used to grab any value from that object:

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
Bug Fixes
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.