Skip to content

feat(org-lens): all-time range for project detail influence trend + sparklines (LFXV2-2867) - #1305

Draft
ahmedomosanya wants to merge 1 commit into
mainfrom
feat/LFXV2-2867-project-detail-all-time-range
Draft

feat(org-lens): all-time range for project detail influence trend + sparklines (LFXV2-2867)#1305
ahmedomosanya wants to merge 1 commit into
mainfrom
feat/LFXV2-2867-project-detail-all-time-range

Conversation

@ahmedomosanya

@ahmedomosanya ahmedomosanya commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a true "All time" range to the Org Lens Project Detail influence-trend chart and card sparklines (LFXV2-2867). The BFF now serves the new adaptive lifetime-bucketed warehouse read models for ?range=all, alongside the existing trailing-monthly source for 1y/2y.

Dependency (draft until this clears)

Reads three new Snowflake models shipped in lf-dbt #2711: ORG_LENS_PROJECT_DETAIL_TREND_LIFETIME, ORG_LENS_PROJECT_DETAIL_SPARKLINES_LIFETIME, ORG_LENS_PROJECT_INFLUENCE_LIFETIME_BUCKET_SPINE. Kept as a draft until lf-dbt #2711 merges and the tables land in prod — until then the all path 500s in prod.

Changes

  • BFF (org-lens-project-detail.service.ts): getTrendBlock / getInfluenceBlock branch on range. all reads the lifetime-bucketed trend/sparkline tables + the bucket spine and emits a variable periods[] axis (the project's shared adaptive bucket calendar, ≤ 12 points); 1y/2y keep the trailing-monthly source + client-derived month axis. New parameterized fetches (fetchTrendLifetime, fetchSparklinesLifetime, fetchLifetimeAxis) and bucket-label formatting (MMM YYYY / Q# YYYY / YYYY / YYYY–YYYY).
  • Cache keys: the trend/influence cache keys now include range, so an all-time request is never served a 1y/2y series.
  • Controller: threads range into getTrendBlock.
  • Shared contract: additive optional periods?: string[] on OrgLensTrendBlock / OrgLensInfluenceBlock (present only for all); PD_TIME_RANGE_MONTHS.all documented as variable-length.
  • Frontend component: consumes periods[] for the chart axis labels.

Test plan

  • yarn check-types, yarn lint:check, yarn build — all pass locally.
  • Verified locally against dev-seeded lifetime tables: all-time trend + sparklines render with adaptive bucket axis (≤ 12 points; long-lived projects fold to multi-year).
  • Re-verify against prod once lf-dbt #2711 lands.

…nd + sparklines (LFXV2-2867)

Wire the BFF + frontend to the new lifetime-bucketed dbt read models so the
Project Detail influence-trend chart and card sparklines support a true
"All time" range. getTrendBlock / getInfluenceBlock branch on range: `all` reads
the adaptive lifetime-bucketed trend / sparkline / bucket-spine tables and emits
a variable periods[] axis (the project's shared bucket calendar), while 1y/2y
keep the trailing-monthly source and the client-derived month axis. Range is
threaded through the controller and folded into the trend/influence cache keys so
an all-time request is never served a 1y/2y series. The Angular component consumes
periods[] for the chart axis labels.

Depends on lf-dbt #2711 (the lifetime read models) reaching prod first.

Signed-off-by: ahmedomosanya <aopeyemi@contractor.linuxfoundation.org>
Copilot AI balanced review requested due to automatic review settings August 4, 2026 15:32
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2e8e35bf-2fb3-41fc-9400-398e655dd320

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

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 adaptive all-time Org Lens Project Detail trends and sparklines backed by lifetime Snowflake models.

Changes:

  • Adds lifetime-bucketed BFF queries and range-aware caching.
  • Extends shared contracts with adaptive period labels.
  • Updates charts and sparklines to consume server-provided axes.

Reviewed changes

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

Show a summary per file
File Description
packages/shared/src/interfaces/org-lens-project-detail.interface.ts Adds optional adaptive period labels.
packages/shared/src/constants/org-lens-project-detail.constants.ts Defines all-time as variable-length.
apps/lfx-one/src/server/services/org-lens-project-detail.service.ts Queries and maps lifetime models.
apps/lfx-one/src/server/controllers/org-lens-project-detail.controller.ts Passes range to trend retrieval.
apps/lfx-one/src/app/shared/services/org-lens-project-detail.service.ts Sends range with trend requests.
apps/lfx-one/src/app/modules/dashboards/org/org-project-detail/org-project-detail.component.ts Renders adaptive chart axes.

// Only the viewing org's own row is needed here (for the section-title band chips), so fetch
// that single row rather than the whole board — the board itself is now paged separately.
this.fetchViewingLeaderboardRow(orgUid, slug, timeRangeType).catch(() => null),
range === 'all' ? this.fetchLifetimeSparklineData(orgUid, slug) : this.fetchMonthlySparklineData(orgUid, slug),
Comment on lines +893 to +899
// "All time" (periods present): the payload already carries the adaptive-bucket axis, so render
// the series as-is against the server-emitted labels. 1y/2y: slice the trailing months and derive
// the fixed month labels client-side (unchanged).
const useBuckets = periods !== null && periods.length > 0;
const sparkline = useBuckets ? card.sparkline : card.sparkline.slice(-months);
const projectSparkline = useBuckets ? card.projectSparkline : card.projectSparkline.slice(-months);
const labels = useBuckets ? periods.slice(-sparkline.length) : this.monthLabels.slice(-sparkline.length);
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