Repository navigation
feat(theme): add gruvbox dark/light (+variants) - #8153
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. WalkthroughAdds Gruvbox light and dark theme modules with soft, medium, and hard variants. Each module defines palette and theme factories, exports three theme instances, and uses the medium variant as the default. The theme index registers all six variants with mode metadata. ChangesGruvbox Theme Family
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The Gruvbox variants are registered with matching mode metadata, and no remaining merge-blocking risk is established. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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. Gruvbox shades now line the view Comment |
4ac762f to
b56a6fe
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/bruno-app/src/themes/light/gruvbox.js (1)
90-93: 💤 Low valueConsider adding variant parameter validation.
The
createPalettefunction doesn't validate thatvariantis one of'hard','medium', or'soft'. While the current exports are controlled, adding a guard would prevent potential issues if this factory is used elsewhere in the future.🛡️ Optional defensive check
const createPalette = (variant) => { + if (!['hard', 'medium', 'soft'].includes(variant)) { + throw new Error(`Invalid Gruvbox variant: ${variant}. Must be 'hard', 'medium', or 'soft'.`); + } const palette = { ...sharedPalette, background: backgroundsByVariant[variant] };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/bruno-app/src/themes/light/gruvbox.js` around lines 90 - 93, The createPalette function should validate the variant argument is one of the allowed values ('hard', 'medium', 'soft') before using backgroundsByVariant[variant]; add a guard in createPalette that checks variant against this set and either throws a clear error or falls back to a default (e.g., 'medium') and logs/warns, referencing the createPalette function and the backgroundsByVariant lookup to locate the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/bruno-app/src/themes/light/gruvbox.js`:
- Around line 90-93: The createPalette function should validate the variant
argument is one of the allowed values ('hard', 'medium', 'soft') before using
backgroundsByVariant[variant]; add a guard in createPalette that checks variant
against this set and either throws a clear error or falls back to a default
(e.g., 'medium') and logs/warns, referencing the createPalette function and the
backgroundsByVariant lookup to locate the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7eb6b689-8498-4c51-a212-bc99655651fe
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
packages/bruno-app/src/themes/dark/gruvbox.jspackages/bruno-app/src/themes/index.jspackages/bruno-app/src/themes/light/gruvbox.js
this commit adds support for both gruvbox light and dark, in all 3 variants of each aligned with the vscode gruvbox theme
b56a6fe to
0fa7dbb
Compare
|
sorry about the force pushes - I had some other npm/JS changes hanging out locally that were updating |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/bruno-app/src/themes/light/gruvbox.js (1)
103-124: ⚡ Quick winDerive
syntaxfrom the shared palette instead of repeating hex values.These literals already exist in
sharedPalette, so keeping them duplicated here makes palette edits easy to drift out of sync. Reusing the existing tokens keeps the factory consistent across variants.♻️ Suggested cleanup
palette.syntax = { // Core language structure - KEYWORD: '`#9d0006`', // red dark - TAG: '`#9d0006`', + KEYWORD: palette.hues.RED_BRIGHT, + TAG: palette.hues.RED_BRIGHT, // Identifiers & properties - VARIABLE: '`#3c3836`', // fg - PROPERTY: '`#076678`', // blue dark - DEFINITION: '`#b57614`', // yellow dark + VARIABLE: palette.text.BASE, + PROPERTY: palette.hues.BLUE_BRIGHT, + DEFINITION: palette.primary.TEXT, // Literals - STRING: '`#79740e`', // green dark - NUMBER: '`#8f3f71`', // purple dark - ATOM: '`#8f3f71`', + STRING: palette.hues.GREEN_BRIGHT, + NUMBER: palette.hues.PURPLE, + ATOM: palette.hues.PURPLE, // Operators & punctuation - OPERATOR: '`#af3a03`', // orange dark - TAG_BRACKET: '`#7c6f64`', // fg3 + OPERATOR: palette.hues.ORANGE, + TAG_BRACKET: palette.text.SUBTEXT0, // Comments - COMMENT: '`#928374`' // gray dark + COMMENT: palette.overlay.OVERLAY1 };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/bruno-app/src/themes/light/gruvbox.js` around lines 103 - 124, palette.syntax currently duplicates hard-coded hexes; replace those literals by referencing the existing sharedPalette tokens so variants stay in sync. Update the assignment to palette.syntax to map each key (KEYWORD, TAG, VARIABLE, PROPERTY, DEFINITION, STRING, NUMBER, ATOM, OPERATOR, TAG_BRACKET, COMMENT) to the corresponding property from sharedPalette (e.g., KEYWORD: sharedPalette.KEYWORD, COMMENT: sharedPalette.COMMENT, etc.) or derive via a selective spread, and ensure sharedPalette is in scope/imported in gruvbox.js before using it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/bruno-app/src/themes/light/gruvbox.js`:
- Around line 383-388: The close button theme entry uses an empty string for
hoverBorder which can produce invalid CSS; update the close object (the close
property in the gruvbox theme in packages/bruno-app/src/themes/light/gruvbox.js)
to use an explicit value such as 'transparent' for hoverBorder instead of '' so
the consuming styled rules get a valid token.
---
Nitpick comments:
In `@packages/bruno-app/src/themes/light/gruvbox.js`:
- Around line 103-124: palette.syntax currently duplicates hard-coded hexes;
replace those literals by referencing the existing sharedPalette tokens so
variants stay in sync. Update the assignment to palette.syntax to map each key
(KEYWORD, TAG, VARIABLE, PROPERTY, DEFINITION, STRING, NUMBER, ATOM, OPERATOR,
TAG_BRACKET, COMMENT) to the corresponding property from sharedPalette (e.g.,
KEYWORD: sharedPalette.KEYWORD, COMMENT: sharedPalette.COMMENT, etc.) or derive
via a selective spread, and ensure sharedPalette is in scope/imported in
gruvbox.js before using it.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 79fc26e3-ecfc-4a9b-9534-021f948ebefa
📒 Files selected for processing (3)
packages/bruno-app/src/themes/dark/gruvbox.jspackages/bruno-app/src/themes/index.jspackages/bruno-app/src/themes/light/gruvbox.js
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/bruno-app/src/themes/index.js
- packages/bruno-app/src/themes/dark/gruvbox.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Just circling back - I did address the easy win comment from coderabbit - if the nitpick aligns with the maintainers' POV I am happy to address this as well. Just wanted to make sure this is not waiting on me, let me know if this needs any other changes! |
REF - BRU-4385
Description
I noticed that #6711 had been closed without a new PR, and #5692 has stalled - I love using Bruno daily and wanted to help contribute the gruvbox theme!
This PR adds support for both gruvbox light and dark, in all 3 variants of each aligned with the vscode gruvbox theme. I did use some AI review while working locally as I am not a JavaScript developer, but I do not consider that a "significant" use case.
I have incorporated all the variants within the gruvbox dark/light JS files via shared factories - if these need to be split out I am happy to do so, I was just trying to keep the file count and duplication of code down.
Here's some quick screenshot previews of each flavor:
Gruvbox Dark - Hard

Gruvbox Dark - Medium

Gruvbox Dark - Soft

Gruvbox Light - Hard

Gruvbox Light - Medium

Gruvbox Light - Soft

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
Summary by CodeRabbit