← Back to Pull requests

Improve the partner Overview and Programs pages #4682

Merged
Joker666 merged 21 files (514 lines) on Oct 13, 2026 18:59 UTC
View on GitHub
Joker666 Joker666 commented on Oct 13, 2026 15:37 UTC
Author

Changes

Fixes https://linear.app/dubinc/issue/ENG-1797/reorder-the-cards-on-the-partner-all-programs-overview-page
Fixes https://linear.app/dubinc/issue/ENG-1798/show-each-programs-share-of-earnings-in-top-programs-by-earnings
Fixes https://linear.app/dubinc/issue/ENG-1807/stop-the-marketplace-filter-counts-from-running-on-the-partner
Fixes https://linear.app/dubinc/issue/ENG-1747/add-status-tabs-to-the-partner-programs-page-with-an-inactive-tab

Mobile order

  • Below a 64rem page width (about a 1,380px window with the sidebars), the Overview cards now stack as: earnings chart, Top programs, Recent earnings, Recent payouts, Tasks, Top links. From a 48rem page width, they show in 2 columns. The switch uses the page container width, so narrow desktop windows get this layout too.

  • The desktop layout does not change.
  • Top programs

  • Each row shows the program's share of the positive earnings in the date range, so the shares add up to 100% even when another program has a clawback.

  • A bar behind each program name shows its earnings compared to the top program.
  • Programs page

  • The sidebar no longer loads the Marketplace filter counts on /programs. Before, each tab change, search or sort sent 3 requests.

  • The Inactive table shows the Reason and the Inactive date. GET /api/partner-profile/programs returns inactiveAt: bannedAt for a ban, or the latest partner.deactivated or partner.archived activity log. Changes before activity logs existed show "-". The log lookup runs only with includeInactiveDates=true, which only the Inactive table sends.
  • Shared code

  • A shared formatPercentage in @dub/utils replaces three identical local copies (program overview blocks and funnel chart) and the Top programs formatter.
  • Tests

  • New e2e checks for the card order on mobile and on desktop.

  • A new e2e check that /programs sends no Marketplace count requests.

  • A new API test for inactiveAt.
  • Motivation

    On small screens, Recent payouts and Tasks showed directly below the chart, before the earnings cards. The updated mobile layout shows Top programs and Recent earnings first. The share of earnings shows which programs drive the total. The Marketplace counts were extra requests that the Programs page never showed. The Inactive table now has the columns of the design.

    UI/Screenshot

    Mobile, a 1200px window, desktop (layout unchanged), Top programs, and the Inactive table. The Top programs screenshot adds test programs, because the local data has earnings in one program only.

    <img width="390" alt="overview-mobile" src="https://github.com/user-attachments/assets/5b4ff153-2cb4-4cdb-8671-347295bcf1d4" />

    <img width="1200" alt="overview-1200" src="https://github.com/user-attachments/assets/a07ed479-53ca-4c5c-b937-fda410b70549" />

    <img width="1440" alt="overview-desktop" src="https://github.com/user-attachments/assets/5dca7cea-c467-47e5-9236-f872c972438e" />

    <img width="350" alt="top-programs" src="https://github.com/user-attachments/assets/2daba93c-dd56-41f7-ae6e-ea72d9555f49" />

    <img width="1440" alt="inactive-table" src="https://github.com/user-attachments/assets/622e598f-bc05-49f6-88e3-01487feb48b8" />

    How to test

    1. Run pnpm dev in apps/web and log in to partners.localhost:8888 as a partner with earnings in a few programs.
    2. Open /overview in the browser device mode at a phone or tablet width. The cards stack in the order above.
    3. In a 1200px window, the cards show in 2 columns in the same order. At 1440px or wider, the layout is the same as before.
    4. In Top programs, check that the percentages add up to 100% (rounded). Change the date range, and they update.
    5. Open /programs, switch tabs and search. The network panel shows no /api/network/programs/count request. On /marketplace/all, the sidebar filters still show their counts.
    6. Ban one partner and deactivate another in a program dashboard. In /programs?tab=inactive as each partner, the table shows the reason and the date.
    7. Run pnpm exec playwright test playwright/partners/overview.spec.ts playwright/partners/programs.spec.ts --project=partners and pnpm exec playwright test playwright/api/partner-profile/programs.spec.ts --project=api in apps/web.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    The Top Programs card shows each program’s share of total earnings, with bars highlighting relative earnings.
    Inactive programs display a status reason and the date they became inactive, when available.
    Improvements
    On mobile, Recent payouts, Tasks, and Top links follow the earnings and program cards; larger-screen layouts retain a side-by-side layout for Recent payouts and the earnings chart.
    The earnings chart reflects total earnings for the overview period.
    Marketplace filter counts load only when the filter sidebar is shown.
    Small percentage values are displayed more clearly.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 514 lines (+436 / -78) across 21 files Reviewer: steven-tey Review duration: 201m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.69) × (1 − Review Confidence (0.65)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.69 · 514 lines diff across 21 files
    0.69
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.47 · 1 substantive comment(s)
    0.47
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    64%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.374
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    1 item
    "Review active on #4682"
    general weight: 0.35
    Reviewers
    Assignees
    Joker666 Joker666
    Labels
    risk: low confidence: 64.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 68.9% (HIGH) · Higher = larger blast radius
    68.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 64.7% · Lower = rushed or shallow review
    64.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.3% · Safe to merge
    24.3%
    Repository