Skip to content

feat: collapseNesting native/compact enum in the options panel - #37

Merged
matthew-dean merged 1 commit into
masterfrom
feat/collapse-nesting-enum
Sep 13, 2026
Merged

matthew-dean merged 1 commit into
masterfrom
feat/collapse-nesting-enum

Conversation

@matthew-dean

Copy link
Copy Markdown
Member

collapseNesting became an enum in Less 5.0.0-alpha — false | 'native' | 'compact' (true is a deprecated alias for 'native'). This surfaces it in the options panel as a select instead of a boolean switch.

  • false — keep authored nesting (the v5 default).
  • native — the CSS Nesting desugaring: parent wrapped in :is(), child selector lists distributed, so each branch keeps its own specificity (matches the browser and Less 4.x).
  • compact — like native but also folds same-combinator descendant runs into a single :is().

Only src/options.ts changes — the option table drives the UI, so App.vue/Select.vue are untouched. Select values are strings, so renderOptions normalizes 'false'/'true' back to booleans before they reach less.render (harmless for the other selects; no math/unitMode value is 'true'/'false'). Still gated to v5 (min: '5.0.0'); 4.x is unaffected.

Note: rendering native vs compact distinctly needs the Less wrapper's enum passthrough (less/less.js#4533 → 5.0.0-alpha.7); on alpha.6 the option coerces to a boolean. The playground loads the latest alpha dist-tag, so it lights up automatically once alpha.7 publishes.

collapseNesting became an enum in Less 5.0.0-alpha (false | 'native' |
'compact'), so expose it as a select instead of a boolean switch:

- false: keep authored nesting (default)
- native: CSS Nesting desugaring — parent :is(), child list distributed
  (specificity-faithful, matches the browser and Less 4.x)
- compact: also folds same-combinator descendant runs into one :is()

Select values are strings, so renderOptions normalizes 'false'/'true' back to
booleans before they reach less.render (harmless for the other selects). Still
gated to v5 (min 5.0.0); 4.x is unaffected.
@coderabbitai

coderabbitai Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 569a54ca-7f8e-4a6f-ad67-c0943b0a16f0

📥 Commits

Reviewing files that changed from the base of the PR and between 9f48b6e and 1d5c203.

📒 Files selected for processing (1)
  • src/options.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The collapseNesting option changes from a boolean to the string enum 'false' | 'native' | 'compact'. Its default changes to 'false', and its descriptor becomes a select with these values. renderOptions now converts string boolean values to booleans before passing options to less.render, while preserving other values.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 1d5c2

The option update has a consistent UI and version-gated rendering path, with no established merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: exposing the collapseNesting native and compact enum values in the options panel.
Description check ✅ Passed The description accurately explains the collapseNesting enum, select control, Less version gating, and string normalization behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@matthew-dean
matthew-dean merged commit b7425de into master Sep 13, 2026
1 of 2 checks passed
@matthew-dean
matthew-dean deleted the feat/collapse-nesting-enum branch September 13, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant