Skip to content

feat: add label field to SelectedFacet for CMS identification#1609

Open
dan-liberato wants to merge 2 commits into
deco-cx:mainfrom
dan-liberato:feat/selected-facet-label
Open

feat: add label field to SelectedFacet for CMS identification#1609
dan-liberato wants to merge 2 commits into
deco-cx:mainfrom
dan-liberato:feat/selected-facet-label

Conversation

@dan-liberato

@dan-liberato dan-liberato commented Jun 15, 2026

Copy link
Copy Markdown

What is this contribution about?

This PR adds an optional label field to the SelectedFacet interface to improve the configuration experience in the Deco CMS Admin.

Currently, SelectedFacet entries only expose key and value, which can make it difficult for editors to identify what each facet represents in a list.

The new label field provides a human-readable description, such as category-1 > Collection or productClusterIds > 123, that appears in the Admin UI without affecting the search query behavior.

Impact

  • No search query behavior changes
  • No runtime logic changes
  • Existing configurations remain compatible because the field is optional

Summary by cubic

Add an optional label to SelectedFacet to show a human-readable name in Deco CMS Admin (e.g., "category-1 > Collection" or "productClusterIds > 123"). No search or runtime changes; fully backward compatible.

Written for commit 96db425. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Facets now support optional labels for improved identification and management in the admin interface.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4bb69ada-87b6-485e-b9f4-99f807553325

📥 Commits

Reviewing files that changed from the base of the PR and between ba432e2 and 96db425.

📒 Files selected for processing (1)
  • vtex/utils/types.ts

📝 Walkthrough

Walkthrough

The SelectedFacet interface in vtex/utils/types.ts gains an optional label?: string field accompanied by a JSDoc comment describing its use as a facet label in VTEX CMS Admin.

Changes

SelectedFacet label extension

Layer / File(s) Summary
SelectedFacet optional label field
vtex/utils/types.ts
Adds label?: string property with JSDoc to the SelectedFacet interface.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • deco-cx/apps#1390: Adds JSDoc descriptions for existing SelectedFacet fields in the same interface that this PR extends.

Suggested reviewers

  • aka-sacci-ccr

Poem

🐇 A label, a label, so small yet so bright,
Tucked into SelectedFacet with optional might.
The CMS Admin will know what you mean,
With label?: string now part of the scene.
Hop hop, one field, and the interface grows! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding a label field to SelectedFacet for CMS identification purposes.
Description check ✅ Passed The description covers the purpose and impact, but is missing the required Issue Link and Loom Video sections from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.157.1 update
  • 🎉 for Minor 0.158.0 update
  • 🚀 for Major 1.0.0 update

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

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