Skip to content

feature: improve speaker list activity count on select#998

Merged
smarcet merged 2 commits into
masterfrom
feature/improve-speaker-list-event-count
Jun 26, 2026
Merged

feature: improve speaker list activity count on select#998
smarcet merged 2 commits into
masterfrom
feature/improve-speaker-list-event-count

Conversation

@santipalenque

@santipalenque santipalenque commented Jun 25, 2026

Copy link
Copy Markdown

https://app.clickup.com/t/9014802374/86bajeea2

Summary by CodeRabbit

  • New Features

    • Added live activity counts for selected speakers and submitters.
    • Counts refresh automatically as selections change, including “select all” and partial selections.
  • Bug Fixes

    • Improved the selected-items summary to display the correct activity totals while counts are being fetched.
    • Simplified the selected-items display so it consistently reflects activity counts without special-case “no activities” handling.
  • Documentation

    • Updated the selected-items text to include activity totals in the interface.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

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: 66adf9f0-7c47-4e22-9c21-af8ca3ff28b5

📥 Commits

Reviewing files that changed from the base of the PR and between 74a3049 and 38164ea.

📒 Files selected for processing (2)
  • src/actions/speaker-actions.js
  • src/reducers/summit_speakers/summit-speakers-list-reducer.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/reducers/summit_speakers/summit-speakers-list-reducer.js
  • src/actions/speaker-actions.js

📝 Walkthrough

Walkthrough

Adds selected-speaker and selected-submitter activity-count requests, stores the returned counts in list reducers, and updates the summit speakers list page to fetch and display the selected activity count with revised English strings.

Changes

Selected activity counts

Layer / File(s) Summary
Activity-count thunks
src/actions/speaker-actions.js, src/actions/submitter-actions.js
Adds request/receive action constants and thunks that derive selected-item filters, short-circuit empty/all-selected cases, and call the speakers or submitters count endpoint.
Reducer state and lifecycle
src/reducers/summit_speakers/summit-speakers-list-reducer.js, src/reducers/summit_submitters/summit-submitters-list-reducer.js
Adds selectedActivityCount and gettingSelectedActivityCount state and handles the matching request/receive actions in both list reducers.
List page display and labels
src/pages/summit_speakers/summit-speakers-list-page.js, src/i18n/en.json
Fetches selected activity counts when the selection changes and renders the combined selected count/activity label with the updated English strings.

Sequence Diagram(s)

sequenceDiagram
  participant SummitSpeakersListPage
  participant getSelectedSpeakersActivityCount
  participant getSelectedSubmittersActivityCount
  participant getRequest
  participant summit_speakers_list_reducer
  participant summit_submitters_list_reducer

  SummitSpeakersListPage->>SummitSpeakersListPage: componentDidUpdate detects selectedCount change
  alt speakers mode
    SummitSpeakersListPage->>getSelectedSpeakersActivityCount: dispatch
    getSelectedSpeakersActivityCount->>getRequest: GET /speakers/all/events/count with filter[]
    getRequest-->>getSelectedSpeakersActivityCount: response.count
    getSelectedSpeakersActivityCount->>summit_speakers_list_reducer: dispatch RECEIVE_SELECTED_SPEAKERS_ACTIVITY_COUNT
  else submitters mode
    SummitSpeakersListPage->>getSelectedSubmittersActivityCount: dispatch
    getSelectedSubmittersActivityCount->>getRequest: GET /submitters/all/events/count with filter[]
    getRequest-->>getSelectedSubmittersActivityCount: response.count
    getSelectedSubmittersActivityCount->>summit_submitters_list_reducer: dispatch RECEIVE_SELECTED_SUBMITTERS_ACTIVITY_COUNT
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • fntechgit/summit-admin#933: Introduces the earlier speakers/submitters activities-count flow that this PR extends to selected-item counts.
  • fntechgit/summit-admin#990: Also changes summit-speakers-list-page.js label computation and items_qty handling for the count display path.

Suggested reviewers

  • smarcet
  • caseylocker

Poem

I hopped through counts with twitching nose,
from selected ears to activities’ glows.
🐇 A label changed, the tally sings—
the list now jingles tiny springtime things.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clear and relevant to the main change: improving selected activity counts in the speaker list.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/improve-speaker-list-event-count

Comment @coderabbitai help to get the list of available commands.

const { selectedCount: currentCount } = this.props[subjectPropKey];
const { selectedCount: prevCount } = prevProps[subjectPropKey];

if (currentCount !== prevCount) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

componentDidUpdate only triggers getSelectedActivityCount() when selectedCount changes, but getSelectedSpeakersActivityCount (and the submitters variant) passes the active filters to the API. If the user has speakers selected and then changes a filter (track, selection plan, activity type, etc.), the list reloads and the filter context changes — but selectedCount stays the same, so no refresh fires. The displayed activity count will be stale until the next selection change.

Consider also diffing the active filter fields from prevProps[subjectPropKey] vs the current ones and triggering the count fetch when any of them changes.

@santipalenque

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is not true @smarcet . REQUEST_SPEAKERS_BY_SUMMIT called when filters change is resetting the selectedCount, so the selectedActivityCount will reset too

Comment thread src/actions/speaker-actions.js Outdated
const activityCount = selectedCount === 0 ? 0 : totalActivities;
dispatch(
createAction(RECEIVE_SELECTED_SPEAKERS_ACTIVITY_COUNT)({
response: { count: activityCount }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The short-circuit here dispatches RECEIVE_SELECTED_SPEAKERS_ACTIVITY_COUNT synchronously (without a preceding REQUEST_SELECTED_SPEAKERS_ACTIVITY_COUNT). If a previous API call — triggered by a partial selection a moment earlier — is still in-flight when this runs, that HTTP response will arrive later and dispatch RECEIVE_SELECTED_SPEAKERS_ACTIVITY_COUNT again, silently overwriting the correct totalActivities with the stale partial count.

Same pattern exists in getSelectedSubmittersActivityCount. A simple fix is a request generation counter in state: increment on each REQUEST dispatch and ignore RECEIVE payloads that carry a stale generation.

@santipalenque

)(params)(dispatch);
};

export const getSelectedSubmittersActivityCount =

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

getSelectedSubmittersActivityCount is a near-verbatim copy of getSelectedSpeakersActivityCount — same 70 lines, same logic, only the state key (currentSummitSubmittersListState vs currentSummitSpeakersListState) and the endpoint segment (submitters vs speakers) differ. Any fix applied to one (e.g. the filter-change staleness above) has to be manually mirrored in the other.

Consider extracting a shared action factory parameterized by state key and endpoint, and having both exports delegate to it.

@santipalenque

@santipalenque santipalenque Jun 26, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I agree , but this would be an improvement to the whole submitters vs speakers action file, imo out of scope for this task and rather work on it on a separate ticket

@smarcet smarcet requested a review from Copilot June 26, 2026 13:24

@smarcet smarcet 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.

@santipalenque please review

Copilot AI 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.

Pull request overview

This PR adds “live” activity totals for the currently selected speakers/submitters in the Summit Speakers/Submitters list UI, replacing the previous “no activities” summary path and introducing dedicated Redux state/actions to fetch and display selected-activity counts.

Changes:

  • Add Redux state + actions for fetching selected speakers/submitters activity counts.
  • Update Speakers/Submitters list UI to display selected activity totals (with a loading placeholder).
  • Remove the now-unused items_qty_no_activities i18n strings and standardize on the single summary string.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/reducers/summit_submitters/summit-submitters-list-reducer.js Adds state/actions handling for selected activity count (plus minor whitespace).
src/reducers/summit_speakers/summit-speakers-list-reducer.js Adds state/actions handling for selected activity count.
src/pages/summit_speakers/summit-speakers-list-page.js Triggers selected-activity count refresh on selection changes; updates selected-items summary rendering.
src/i18n/en.json Removes the “no activities” summary keys; keeps a single count-based string.
src/actions/submitter-actions.js Adds thunk to fetch selected submitters activity count using current filters/selection.
src/actions/speaker-actions.js Adds thunk to fetch selected speakers activity count using current filters/selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +145 to +155
componentDidUpdate(prevProps) {
const { source } = this.state;
const subjectPropKey =
source === sources.speakers ? "speakersProps" : "submittersProps";
const { selectedCount: currentCount } = this.props[subjectPropKey];
const { selectedCount: prevCount } = prevProps[subjectPropKey];

if (currentCount !== prevCount) {
this.getSelectedActivityCount();
}
}
Comment on lines +963 to +968
return getRequest(
createAction(REQUEST_SELECTED_SPEAKERS_ACTIVITY_COUNT),
createAction(RECEIVE_SELECTED_SPEAKERS_ACTIVITY_COUNT),
`${window.API_BASE_URL}/api/v1/summits/${currentSummit.id}/speakers/all/events/count`,
authErrorHandler
)(params)(dispatch);
Comment on lines +128 to +133
return getRequest(
createAction(REQUEST_SELECTED_SUBMITTERS_ACTIVITY_COUNT),
createAction(RECEIVE_SELECTED_SUBMITTERS_ACTIVITY_COUNT),
`${window.API_BASE_URL}/api/v1/summits/${currentSummit.id}/submitters/all/events/count`,
authErrorHandler
)(params)(dispatch);
Comment on lines 33 to 37
import { buildSpeakersSubmittersList } from "../utils/methods";



const DEFAULT_STATE = {
@santipalenque santipalenque requested a review from smarcet June 26, 2026 14:38

@smarcet smarcet 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.

LGTM

@smarcet smarcet merged commit 350c73d into master Jun 26, 2026
9 checks passed
caseylocker added a commit that referenced this pull request Jun 27, 2026
…998)

Keep the branch current with the master tip per smarcet's request (Core Team Sync 2026-06-26). Picks up 350c73d (#998 speaker-list activity count); clean auto-merge, en.json edits are in non-overlapping regions. No sponsor-reports files affected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

3 participants