feat(dashboards): add needs-attention strip for at-risk events - #1173
feat(dashboards): add needs-attention strip for at-risk events#1173mrautela365 wants to merge 2 commits into
Conversation
Surface up to three upcoming events that are behind their registration goal (under 50% to goal) with a low comparison pace, at the top of the Marketing Impact overview. Each item shows a severity tag, the shortfall, pace vs last year, and a deep-link to open the event. Derived from the existing event roster data — no additional query. LFXV2-2768 Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
PR SummaryLow Risk Overview The attention strip loads upcoming event roster data and derives up to three BEHIND GOAL items when registration is under 50% of goal and Geographic reach is backed by a new Shared Reviewed by Cursor Bugbot for commit f4a1c09. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Adds a Needs attention strip for upcoming at-risk events to the marketing impact overview.
Changes:
- Identifies and ranks up to three events behind registration goals.
- Displays severity, registration pacing, and event actions.
- Adds shared attention-item interfaces.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
marketing-impact.interface.ts |
Defines attention item types. |
overview-tab.component.ts |
Registers the attention component. |
overview-tab.component.html |
Places the strip atop the overview. |
events-attention-section.component.ts |
Fetches and derives at-risk events. |
events-attention-section.component.html |
Renders attention items and actions. |
Comments suppressed due to low confidence (1)
apps/lfx-one/src/app/modules/dashboards/marketing-impact/components/events-attention-section/events-attention-section.component.ts:60
- This reimplements the same at-risk rule already used by
EventRosterSectionComponentatevent-roster-section.component.ts:87-89. Keeping the threshold and comparison logic in two components allows the roster warning and Needs attention strip to disagree after either rule changes; centralize the classification/percentage helper and reuse it in both surfaces.
const atRisk = this.roster()
.events.map((event) => ({ event, percent: this.regPercent(event) }))
.filter((row) => row.percent !== null && (row.percent as number) < BEHIND_GOAL_THRESHOLD && row.event.compScore === 'low')
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| this.loading.set(true); | ||
| // Upcoming only — attention is about events we can still influence. | ||
| return this.analyticsService.getEventRoster(slug, false).pipe(finalize(() => this.loading.set(false))); |
| @if (item.actionUrl) { | ||
| <a | ||
| [href]="item.actionUrl" |
| tag: 'BEHIND GOAL', | ||
| severity, | ||
| title: `${event.eventName} is ${percent}% to its registration goal`, | ||
| detail: `${formatNumber(event.registrations.actual)} / ${formatNumber(event.registrations.goal)} registrations${vsLy}. Email and paid are the fastest levers.`, |
Add a geographic reach panel showing event registrations by country, sourced from ANALYTICS.PLATINUM_LFX_ONE.MARKETING_EVENT_REGISTRATION_COUNTRY (YTD). Renders the top countries as ranked share bars with ISO code, a title-cased name, registration count, and share of total, plus a headline count of countries reached. LFXV2-2768 Signed-off-by: Misha Rautela <mrautela@linuxfoundation.org>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f4a1c09. Configure here.
| WHERE c.REGISTRATION_COUNT_YTD > 0 | ||
| ORDER BY c.REGISTRATION_COUNT_YTD DESC | ||
| LIMIT ${boundedLimit} | ||
| `; |
There was a problem hiding this comment.
Geo query skips country aggregation
Medium Severity
The new getEventGeoReach country query joins slug_resolve (which can return multiple project_id values for one slug) and returns raw per-project country rows with LIMIT 12, without GROUP BY/SUM by country. The paired totals query sums all rows and counts distinct countries, so the panel can show duplicate countries, wrong per-country registration counts and share percentages, and a top-12 list that is not the true top countries foundation-wide.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f4a1c09. Configure here.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
apps/lfx-one/src/app/modules/dashboards/marketing-impact/components/events-attention-section/events-attention-section.component.ts:49
- This creates a second cold
getEventRoster(slug, false)subscription alongsideEventRosterSectionComponent(line 67 there), so loading the overview sends two identical HTTP requests and executes the Snowflake roster query twice. Derive the strip from one shared upcoming-roster result—either lift it to the overview and pass it to both children or cache the request by slug/includePast—so the advertised reuse does not add an N+1 read.
return this.analyticsService.getEventRoster(slug, false).pipe(finalize(() => this.loading.set(false)));
|
|
||
| <lfx-event-roster-section [foundationSlug]="foundationSlug()" data-testid="overview-tab-event-roster" /> | ||
|
|
||
| <lfx-events-geo-section [foundationSlug]="foundationSlug()" [foundationName]="foundationName()" data-testid="overview-tab-events-geo" /> |
| aria-valuemin="0" | ||
| aria-valuemax="100" | ||
| [attr.aria-label]="row.name + ' registration share: ' + row.sharePercent + '%'" | ||
| [style.width.%]="row.barPercent"></div> |


Summary
Adds a Needs attention strip at the top of the overview surfacing up to three upcoming events behind their registration goal with a low comparison pace, each with a deep-link to open the event. Derived from the existing roster data — no new query.
PR 4/6 of the LF Events dashboard stack (LFXV2-2768). Base:
feat/LFXV2-2768-event-drawer(PR). Review/merge PRs 1–3 first.LFXV2-2768