Skip to content

Conversation

@asanehisa
Copy link
Contributor

Previously it was gated behind a feature flag. This removes it from the list of gated components, but leaves some of the base logic in case we need to gate another component in the future.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

Warning: Component files have been updated but no migrations have been added. See https://github.com/yext/visual-editor/blob/main/packages/visual-editor/src/components/migrations/README.md for more information.

@asanehisa asanehisa marked this pull request as ready for review December 1, 2025 16:10
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

This pull request removes the default feature flag gate on the CustomCodeSection component. The gatedLayoutComponents array in filterComponents.ts is cleared, making CustomCodeSection available without requiring the custom code feature flag. The filtering logic is updated to include components that are either explicitly allowed or not gated. Documentation references to the feature flag requirement are removed from the component JSDoc and components.md. Tests are updated to reflect that CustomCodeSection now appears in the registry when the custom code feature flag is enabled, removing previous negative assertions about its absence under default configuration.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: allow custom code component for all users' directly summarizes the main change: removing the custom code component from feature flag gating.
Description check ✅ Passed The description accurately explains that the custom code component was previously gated behind a feature flag and has been removed from the gated components list.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch allow-custom-code-section

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
packages/visual-editor/src/utils/filterComponents.test.ts (1)

32-58: Advanced core info flag test stays consistent with new custom code behavior

With coreInformation explicitly allowed, asserting that Grid/BodyText are present and that CustomCodeSection remains available (both in the registry and the other category) is consistent with the intended feature-flag behavior and the new ungated custom code default. Consider adding similar assertions when new gated components are introduced to keep this coverage pattern.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2c09fa1 and 48c25c7.

⛔ Files ignored due to path filters (1)
  • packages/visual-editor/src/components/testing/screenshots/StaticMapSection/[mobile] default props with coordinate - with api key.png is excluded by !**/*.png, !packages/visual-editor/src/components/testing/screenshots/**
📒 Files selected for processing (4)
  • packages/visual-editor/src/components/CustomCodeSection.tsx (0 hunks)
  • packages/visual-editor/src/docs/components.md (1 hunks)
  • packages/visual-editor/src/utils/filterComponents.test.ts (2 hunks)
  • packages/visual-editor/src/utils/filterComponents.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • packages/visual-editor/src/components/CustomCodeSection.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-29T22:00:03.843Z
Learnt from: mkouzel-yext
Repo: yext/visual-editor PR: 833
File: packages/visual-editor/src/components/Locator.tsx:1050-1057
Timestamp: 2025-10-29T22:00:03.843Z
Learning: In packages/visual-editor/src/components/Locator.tsx, the AppliedFilters component is intentionally rendered in two locations (inside the filter modal and outside it) as per the design requirements. This dual rendering should not be flagged as a duplicate issue.

Applied to files:

  • packages/visual-editor/src/utils/filterComponents.ts
🔇 Additional comments (4)
packages/visual-editor/src/docs/components.md (1)

116-133: CustomCodeSection docs now match ungated behavior

Removing the feature‑flag note keeps the description aligned with the new default availability of CustomCodeSection; no further doc changes needed here.

packages/visual-editor/src/utils/filterComponents.ts (2)

3-8: Component-level gating correctly disabled while keeping mechanism intact

Setting gatedLayoutComponents to an empty array removes default gating (including for CustomCodeSection) while preserving the hook for future gated components; this aligns with the PR goal.


40-51: Final component filter matches documented gating rules

The comment and implementation agree: a component must (a) belong to an allowed category and (b) either not be in gatedLayoutComponents or be explicitly allowed via additionalLayoutComponents. This preserves future flexibility without changing current behavior since gatedLayoutComponents is empty.

packages/visual-editor/src/utils/filterComponents.test.ts (1)

6-30: Baseline gating test correctly reflects ungated CustomCodeSection

Expecting CustomCodeSection in both the components registry and the other category, while still excluding Grid/BodyText and the coreInformation category, matches the updated gating logic.

@asanehisa asanehisa merged commit fb049bb into main Dec 1, 2025
15 checks passed
@asanehisa asanehisa deleted the allow-custom-code-section branch December 1, 2025 21:27
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.

5 participants