Skip to content

fix: honor empty agent suggestions - #2750

Merged
superdav42 merged 1 commit into
mainfrom
feature/auto-20260921-173010
Sep 21, 2026
Merged

superdav42 merged 1 commit into
mainfrom
feature/auto-20260921-173010

Conversation

@superdav42

@superdav42 superdav42 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • treat an explicitly empty agent suggestions array as an opt-out instead of falling back to generic suggestions
  • hide the suggestion heading and container when an agent opts out
  • retain the existing four defaults when no agent-specific suggestions array is available

Production evidence

A contained CEF checkout created a tenant whose Setup Assistant stored suggestions: [], but the floating widget still rendered the four generic defaults. The tenant, free non-renewing membership, pending payment record, customer, and synthetic user were removed after the observation.

Verification

  • wp-scripts test-unit-js src/components/chat-widget/__tests__/widget-empty.test.js --runInBand — 2 tests passed
  • wp-scripts test-unit-js --runInBand — 66 suites, 632 tests passed
  • wp-scripts lint-js src/components/chat-widget/widget-empty.js src/components/chat-widget/__tests__/widget-empty.test.js — clean
  • wp-scripts build — succeeded (existing webpack asset-size warnings only)
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Empty agent-provided suggestion lists no longer display suggestion labels or cards.
    • Default suggestions continue to appear when no suggestions are provided.
  • Tests
    • Added coverage for empty suggestion states and default suggestion rendering.

@superdav42 superdav42 added the origin:interactive Created by interactive user session label Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 65233685-a72c-4ce4-81ef-1cc52f11289f

📥 Commits

Reviewing files that changed from the base of the PR and between bb86e3e and 8275848.

📒 Files selected for processing (2)
  • src/components/chat-widget/__tests__/widget-empty.test.js
  • src/components/chat-widget/widget-empty.js

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


📝 Walkthrough

Walkthrough

WidgetEmpty now preserves explicit empty suggestion arrays and hides suggestion markup when no suggestions exist. New tests cover this behavior and the default suggestions used when no agent is selected.

Changes

Widget empty suggestions

Layer / File(s) Summary
Suggestion resolution and conditional rendering
src/components/chat-widget/widget-empty.js, src/components/chat-widget/__tests__/widget-empty.test.js
WidgetEmpty uses agent-provided arrays, including empty arrays, and falls back to defaults only when no array exists. Suggestion markup renders only for non-empty arrays. Tests verify both states.

Priority: ⬇️ Low

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

Change: Bug fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.
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 Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: honoring an explicitly empty agent suggestions array.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@github-actions github-actions Bot added the bug Auto-created from TODO.md tag label Sep 21, 2026
@superdav42
superdav42 marked this pull request as ready for review September 21, 2026 23:39
@superdav42 superdav42 changed the title Fix empty agent suggestion opt-out fix: honor empty agent suggestions Sep 21, 2026
@superdav42
superdav42 merged commit dc22bba into main Sep 21, 2026
34 checks passed
@superdav42 superdav42 added the review-feedback-scanned Merged PR already scanned for quality feedback label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag origin:interactive Created by interactive user session review-feedback-scanned Merged PR already scanned for quality feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant