Skip to content

feat(dashboards): add needs-attention strip for at-risk events - #1173

Draft
mrautela365 wants to merge 2 commits into
feat/LFXV2-2768-event-drawerfrom
feat/LFXV2-2768-needs-attention
Draft

feat(dashboards): add needs-attention strip for at-risk events#1173
mrautela365 wants to merge 2 commits into
feat/LFXV2-2768-event-drawerfrom
feat/LFXV2-2768-needs-attention

Conversation

@mrautela365

Copy link
Copy Markdown
Contributor

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

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>
Copilot AI review requested due to automatic review settings July 23, 2026 03:53
@mrautela365
mrautela365 requested a review from a team as a code owner July 23, 2026 03:53
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Read-only analytics UI and a new Snowflake-backed endpoint following existing slug validation patterns; no auth or data-mutation changes.

Overview
Adds two Marketing Impact overview panels and wires them into the overview tab: a Needs attention strip at the top and a Geographic reach block after the event roster.

The attention strip loads upcoming event roster data and derives up to three BEHIND GOAL items when registration is under 50% of goal and compScore is low, with critical vs warning styling and an Open event link when a URL exists. The section hides entirely when there are no qualifying events.

Geographic reach is backed by a new GET /api/analytics/event-geo-reach path (route → controller → ProjectService Snowflake queries on MARKETING_EVENT_REGISTRATION_COUNTRY), with shared types EventGeoReachResponse / EventCountryReach and a client AnalyticsService.getEventGeoReach that degrades to empty data on error. The UI shows country bars, counts, share %, loading skeletons, and an empty state.

Shared EventAttentionItem / AttentionSeverity types support the attention UI.

Reviewed by Cursor Bugbot for commit f4a1c09. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1400be2c-28b5-4b53-9870-08c526913b06

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/LFXV2-2768-needs-attention

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 EventRosterSectionComponent at event-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)));
Comment on lines +43 to +45
@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>
Copilot AI review requested due to automatic review settings July 23, 2026 14:04

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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}
`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f4a1c09. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 alongside EventRosterSectionComponent (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>
@mrautela365
mrautela365 marked this pull request as draft August 3, 2026 21:02
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.

2 participants