fix(speakers): restore activitiesCountAccurate conditional and totalActivities display#990
Conversation
…ctivities display
The merge of feature/speakers-submitters-activities-count into master dropped
the second hunk of the summit-speakers-list-page conflict: the activitiesCountAccurate
flag and the conditional T.translate block that passes {activitiesQty} to the
items_qty string. This left master with an en.json expecting {activitiesQty} but
page code that never passed it, so the count was always silently missing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughIn the speakers/submitters list page ChangesConditional Activities Count Display
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/pages/summit_speakers/summit-speakers-list-page.js (1)
718-718: ⚡ Quick winConsider adding a defensive guard for
excludedItems.While this code restores previously working functionality, adding a defensive check would prevent potential runtime errors if
excludedItemsis unexpectedly undefined:🛡️ Suggested defensive guard
-const activitiesCountAccurate = selectedAll && excludedItems.length === 0; +const activitiesCountAccurate = selectedAll && excludedItems?.length === 0;Or, if optional chaining isn't available:
-const activitiesCountAccurate = selectedAll && excludedItems.length === 0; +const activitiesCountAccurate = selectedAll && excludedItems && excludedItems.length === 0;🤖 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 `@src/pages/summit_speakers/summit-speakers-list-page.js` at line 718, The line where activitiesCountAccurate is assigned accesses the length property of excludedItems without checking if it exists first, which could cause a runtime error if excludedItems is unexpectedly undefined. Add a defensive guard to safely access the length property of excludedItems by using optional chaining syntax (excludedItems?.length) or by explicitly checking that excludedItems exists before accessing its length property in the condition that checks selectedAll && excludedItems.length === 0.
🤖 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 `@src/pages/summit_speakers/summit-speakers-list-page.js`:
- Line 718: The line where activitiesCountAccurate is assigned accesses the
length property of excludedItems without checking if it exists first, which
could cause a runtime error if excludedItems is unexpectedly undefined. Add a
defensive guard to safely access the length property of excludedItems by using
optional chaining syntax (excludedItems?.length) or by explicitly checking that
excludedItems exists before accessing its length property in the condition that
checks selectedAll && excludedItems.length === 0.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4e937b52-787b-47b6-9069-9d644924e944
📒 Files selected for processing (1)
src/pages/summit_speakers/summit-speakers-list-page.js
ref: https://app.clickup.com/t/9014802374/86b9b1qrk
Summary
feature/speakers-submitters-activities-count(PR feat(speakers): display unique activities count on speakers/submitters list #933) into master dropped the second hunk of thesummit-speakers-list-page.jsconflict resolution: theactivitiesCountAccurateflag computation and the conditionalT.translateblock that passes{activitiesQty}to theitems_qtystring.en.jsondefinesitems_qtyexpecting an{activitiesQty}interpolation argument, but the page code never computes or passes it — so the activities count was silently missing from the rendered string.excludedItemsfromgetSubjectProps(), computingactivitiesCountAccurate = selectedAll && excludedItems.length === 0, and switching to the conditional translate that passesactivitiesQtywhen all items are selected with no exclusions.Summary by CodeRabbit