Skip to content

fix: use display name for multiple linked entities warning#1217

Merged
jwartofsky-yext merged 10 commits into
mainfrom
createDevReleaseTest
May 18, 2026
Merged

fix: use display name for multiple linked entities warning#1217
jwartofsky-yext merged 10 commits into
mainfrom
createDevReleaseTest

Conversation

@jwartofsky-yext
Copy link
Copy Markdown
Contributor

@jwartofsky-yext jwartofsky-yext commented May 18, 2026

Updates the warning that is displayed when there are multiple linked entities for a field to use the display names instead of API names.

Shows the linked entities warning when a linked entity field is chosen by the embedded field picker.

@jwartofsky-yext jwartofsky-yext added the create-dev-release Triggers dev release workflow label May 18, 2026
@jwartofsky-yext jwartofsky-yext changed the title Empty for dev release chore: empty commit for create-dev-release May 18, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 18, 2026

commit: ca7513d

@jwartofsky-yext jwartofsky-yext changed the title chore: empty commit for create-dev-release fix: use display name for multiple linked entities warning May 18, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

Warning

Rate limit exceeded

@yext-bot has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 19 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bf5a7240-032b-4e87-b474-6a3e8aa48f68

📥 Commits

Reviewing files that changed from the base of the PR and between 44d9f84 and ca7513d.

📒 Files selected for processing (5)
  • packages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx
  • packages/visual-editor/src/editor/EmbeddedFieldStringInput.tsx
  • packages/visual-editor/src/editor/yextEntityFieldUtils.test.ts
  • packages/visual-editor/src/editor/yextEntityFieldUtils.ts
  • packages/visual-editor/src/utils/linkedEntityWarningUtils.ts

Walkthrough

This PR enhances the warning system for multi-value linked entity traversal by enabling human-readable field display names in toast messages. The warnOnMultiValueLinkedEntityTraversal function now accepts an optional entityFields parameter and resolves field paths to display names using getEntityFieldDisplayName, falling back to raw paths when names are unavailable. The call site in EntityFieldInput was reformatted to pass this new parameter, and comprehensive test coverage validates that warning messages correctly include the resolved display names.

Possibly related PRs

  • yext/visual-editor#1216: Modifies warnOnMultiValueLinkedEntityTraversal to change warning message interpolation fields; this PR further enhances those fields with human-readable entityFields display names.
  • yext/visual-editor#1196: Related changes to the entity-field selector's linked-entity multi-value traversal warning logic that this PR extends with display-name resolution.
  • yext/visual-editor#1167: Adds the initial multi-value linked entity warning emission and deduplication logic; this PR improves the warning message readability.

Suggested reviewers

  • briantstephan
  • asanehisa
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: updating warning messages to display field display names instead of API names for multiple linked entities.
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.
Description check ✅ Passed The pull request description accurately describes the changeset: updating the multiple linked entities warning to use display names instead of API names, and showing the warning when a linked entity field is chosen in the embedded field picker.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch createDevReleaseTest

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.

@jwartofsky-yext jwartofsky-yext self-assigned this May 18, 2026
@jwartofsky-yext jwartofsky-yext marked this pull request as ready for review May 18, 2026 17:11
benlife5
benlife5 previously approved these changes May 18, 2026
@jwartofsky-yext jwartofsky-yext marked this pull request as draft May 18, 2026 17:16
Comment thread packages/visual-editor/src/utils/linkedEntityWarningUtils.ts Outdated
Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
packages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx (1)

33-37: ⚡ Quick win

Reset mocked toast.warning between tests.

Please clear mocks per test to avoid cross-test leakage as this suite grows.

Proposed change
-import { describe, expect, it, vi } from "vitest";
+import { beforeEach, describe, expect, it, vi } from "vitest";
@@
 vi.mock("sonner", () => ({
   toast: {
     warning: vi.fn(),
   },
 }));
+
+beforeEach(() => {
+  vi.clearAllMocks();
+});
🤖 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/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx` around
lines 33 - 37, The test suite currently mocks toast.warning via vi.mock but does
not reset that mock between tests; add a per-test cleanup (e.g., a beforeEach or
afterEach) that calls vi.clearAllMocks() or explicitly clears toast.warning
(toast.warning.mockClear()) so the mocked toast.warning state doesn't leak
across tests in EmbeddedFieldStringInput.test.tsx; reference the existing
vi.mock and the toast.warning mock when adding the cleanup.
🤖 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/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx`:
- Around line 33-37: The test suite currently mocks toast.warning via vi.mock
but does not reset that mock between tests; add a per-test cleanup (e.g., a
beforeEach or afterEach) that calls vi.clearAllMocks() or explicitly clears
toast.warning (toast.warning.mockClear()) so the mocked toast.warning state
doesn't leak across tests in EmbeddedFieldStringInput.test.tsx; reference the
existing vi.mock and the toast.warning mock when adding the cleanup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e368633e-6a42-47dd-be52-d9d63a31c884

📥 Commits

Reviewing files that changed from the base of the PR and between 2024706 and 44d9f84.

📒 Files selected for processing (2)
  • packages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx
  • packages/visual-editor/src/editor/EmbeddedFieldStringInput.tsx

mkilpatrick
mkilpatrick previously approved these changes May 18, 2026
@jwartofsky-yext jwartofsky-yext marked this pull request as ready for review May 18, 2026 17:32
@jwartofsky-yext jwartofsky-yext requested a review from benlife5 May 18, 2026 17:33
@jwartofsky-yext jwartofsky-yext merged commit c253d9e into main May 18, 2026
18 checks passed
@jwartofsky-yext jwartofsky-yext deleted the createDevReleaseTest branch May 18, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-dev-release Triggers dev release workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants