Skip to content

Home weekly pulse row#1918

Merged
seferturan merged 16 commits intomainfrom
feat/home-weekly-pulse
Apr 3, 2026
Merged

Home weekly pulse row#1918
seferturan merged 16 commits intomainfrom
feat/home-weekly-pulse

Conversation

@rudf0rd
Copy link
Copy Markdown
Contributor

@rudf0rd rudf0rd commented Mar 20, 2026

Scene Setting: A Clear Description

This PR introduces Weekly Pulse, a compact stats dashboard that appears on the home page for authenticated desktop/tablet users, right between "Continue Watching" and "Start Watching." It answers the question: "What did my week look like?"

Show, Don't Tell: Screenshots and Videos

CleanShot 2026-03-20 at 15 05 15@2x

In addition to the above, a decision tree will show the most interesting stats based on the user's activity.

Testing: The Dress Rehearsal

I get dem tests!

  • Unit tests for all pure utility functions: pulseStats.spec.ts covers relevance scoring, redundancy filtering, stat computation (sumHours, countUniqueDays, getBusiestDay, maxPlaysInSingleDay, computeDelta). pulseGraphs.spec.ts covers graph data generation (countByCalendarDay, bucketByTimeOfDay, computeWeekTrend, computeRatingsDistribution) and the pickGraph scoring algorithm.
  • useUserRatings.spec.ts and useUserComments.spec.ts verify date-bounded filtering logic for both data sources.
  • Verified skeleton loading state renders the correct grid placeholder count and transitions cleanly to populated cells.
  • Verified graph selection adapts correctly when data characteristics change (e.g., no movies watched → totalPlays cell dropped in favor of Episodes).

@trakt-bot trakt-bot Bot enabled auto-merge (rebase) March 20, 2026 22:13
@rudf0rd rudf0rd requested review from seferturan and vladjerca March 20, 2026 22:13
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates a new 'Weekly Pulse' feature into the application's homepage, offering authenticated desktop and tablet users a personalized and concise overview of their recent viewing habits. The feature aims to provide quick, actionable insights into user engagement through a combination of key statistics and dynamically chosen graphical representations, enhancing the user experience by making personal data more accessible and understandable.

Highlights

  • New Feature: Weekly Pulse Dashboard: Introduced a 'Weekly Pulse' section on the homepage for authenticated desktop/tablet users, providing a compact dashboard of their weekly viewing statistics.
  • Comprehensive Statistics Display: The dashboard presents key metrics such as total plays, episodes watched, movies watched, unique shows, active days, busiest day, best day for plays, total hours watched, ratings given, and comments written.
  • Dynamic Graph Visualization: Features a dynamic graph that intelligently selects and displays the most relevant visualization based on user activity, including daily activity bars, week-over-week trends, peak viewing hours, shows vs. movies breakdown, and ratings distribution.
  • Internationalization Support: Added extensive internationalization (i18n) keys across multiple languages to support the new statistics, tooltips, labels, and graph headers.
  • Robust Testing Coverage: Includes comprehensive unit tests for all core utility functions (relevance scoring, redundancy filtering, stat computation, graph data generation, graph selection) and verification of UI states like skeleton loading and adaptive graph selection.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Mar 20, 2026

DeepSource Code Review

We reviewed changes in efeb753...b4799ba on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Coverage  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Apr 3, 2026 10:23a.m. Review ↗
Test coverage Apr 3, 2026 10:23a.m. Review ↗

Code Coverage Summary

Language Line Coverage (Overall)
Aggregate
81.2%
[▲ up 0.7% from main]
Javascript
81.2%
[▲ up 0.7% from main]

➟ Additional coverage metrics may have been reported. See full coverage report ↗

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new 'Weekly Pulse' statistics section to the client application, including new localization keys across multiple languages, a new query for user comments, and several Svelte components and utility functions for displaying and calculating user activity statistics and dynamic graphs. Review comments suggest improving type safety in userCommentsQuery.ts by explicitly validating API response types, refactoring the icon rendering logic in WeeklyPulse.svelte for better maintainability, and adhering to style guide conventions for constant naming in PulseGraph.svelte and function parameter handling in pulseGraphs.ts and useWeeklyPulse.ts.

Comment thread projects/client/src/lib/requests/queries/users/userCommentsQuery.ts
Comment thread projects/client/src/lib/sections/stats/WeeklyPulse.svelte Outdated
Comment thread projects/client/src/lib/sections/stats/_internal/PulseGraph.svelte Outdated
Comment thread projects/client/src/lib/sections/stats/_internal/pulseGraphs.ts Outdated
Comment thread projects/client/src/lib/sections/stats/_internal/useWeeklyPulse.ts Outdated
@rudf0rd rudf0rd force-pushed the feat/home-weekly-pulse branch 3 times, most recently from d95c7c7 to 606e470 Compare March 21, 2026 19:08
Copy link
Copy Markdown
Contributor

@seferturan seferturan left a comment

Choose a reason for hiding this comment

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

For this I'd say let's leverage an existing library for charts: https://charts.carbondesignsystem.com/introduction

We can add our own wrappers to them in features/charts

Comment thread projects/client/src/lib/sections/stats/_internal/PulseCell.svelte
Comment thread projects/client/src/lib/sections/stats/_internal/PulseGraph.svelte Outdated
Comment thread projects/client/src/lib/sections/stats/_internal/PulseGraph.svelte Outdated
@vladjerca vladjerca force-pushed the feat/home-weekly-pulse branch from 606e470 to 78a4938 Compare March 23, 2026 19:05
@rudf0rd rudf0rd force-pushed the feat/home-weekly-pulse branch 2 times, most recently from 6f96233 to 6cb519a Compare March 24, 2026 22:44
@rudf0rd
Copy link
Copy Markdown
Contributor Author

rudf0rd commented Mar 24, 2026

Updated screenshots

Laptop

CleanShot 2026-03-24 at 15 47 48@2x

Tablet

CleanShot 2026-03-24 at 15 46 53@2x

Mobile

CleanShot 2026-03-24 at 15 45 09@2x

@rudf0rd rudf0rd force-pushed the feat/home-weekly-pulse branch from 6cb519a to 1b8aece Compare March 24, 2026 22:50
@rudf0rd rudf0rd requested review from seferturan and vladjerca March 24, 2026 22:59
Copy link
Copy Markdown
Contributor

@seferturan seferturan left a comment

Choose a reason for hiding this comment

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

There seems to be some strangeness with the last label (desktop and mobile); label out of bounds and stretching:
Image
Image

Hopefully just an issue of taking the list-gap into count to fix this alignment:
Image

In light mode the bars and the stroke on the dot is very dark 😅
Image

Comment thread projects/client/src/lib/sections/stats/_internal/activityHistoryParams.ts Outdated
Comment thread projects/client/src/lib/sections/stats/_internal/PulseCell.svelte Outdated
Comment thread projects/client/src/lib/sections/stats/_internal/PulseDeltaTag.svelte Outdated
Comment thread projects/client/src/lib/sections/stats/_internal/PulseGraph.svelte Outdated
Comment thread projects/client/src/routes/+page.svelte Outdated
Comment thread commitlint.config.js Outdated
@seferturan
Copy link
Copy Markdown
Contributor

@rudf0rd, any update on this? 😅

@rudf0rd rudf0rd force-pushed the feat/home-weekly-pulse branch from 1b8aece to bde99a3 Compare March 31, 2026 00:45
@seferturan seferturan force-pushed the feat/home-weekly-pulse branch 3 times, most recently from 47c38f0 to 00a4553 Compare April 3, 2026 10:21
rudf0rd added 6 commits April 3, 2026 12:23
Add a weekly pulse dashboard showing stat cells with relevance-scored
ranking, five graph types (daily bars, week trend, ratings distribution,
peak hours, shows vs movies), icon tooltips, skeleton loading state,
and adaptive 7-column grid layout. Includes hooks for activity history,
ratings, and comments data via the query layer, pure utility functions
for stat computation and graph data generation, and test coverage.
Add i18n message keys for stat labels, graph titles, delta indicators,
time buckets, rating average, and icon tooltips. Includes translations
for all 20 supported locales.
…driven layout

- Add CSS variables for responsive pulse card sizing via dynamic-item-count/dynamic-card-width mixins
- Create unified scoring system (pulseItem.ts) that normalizes stat and graph scores to a common scale
- Interleave stats and graphs by interest score with max 2 consecutive graphs constraint
- Support multiple graphs on widescreen, CSS overflow-hidden clips what doesn't fit
- Deprioritize redundant stats (e.g. plays == episodes) instead of filtering them out
- Wrap pulse section in SectionList with classList prop for consistent header/collapse behavior
- Extract PulseIcon component following WellKnownLogo pattern
- Use Card component for stat cells and graphs with layout CSS variable sizing
- Hoist SVG constants, eliminate magic numbers, deduplicate daysInWeek constant
Extract inline delta pill from PulseCell into a dedicated PulseDeltaTag
component backed by StemTag. Use semantic CSS variables for icon styling,
DRY up icon rendering with a snippet, and unexport internal scoreStat.
Switch pulse dashboard to flex-wrap layout with span-aware graph sizing.
Add mobile/tablet responsive breakpoints that limit visible items by
unit cost. Remove device-level RenderFor guard since the component now
handles its own responsiveness.
rudf0rd and others added 10 commits April 3, 2026 12:23
- Extract 5 graph subcomponents: DailyBars, WeekTrend, WatchClock, ShowsMovies, Ratings
- Remove redundant auth guard wrapping WeeklyPulse on home page
- Drop compact tooltip variant from PulseCell (arrow rendering bug)
- Remove wrapper div in PulseDeltaTag, use align-items on parent
- Fix light mode: use theme-aware vars for dot stroke and bar tracks
- Fix label overflow with text-overflow ellipsis
replace custom activity history queries with useUser().history which
provides watchedDates arrays via the minimal endpoints. removes
sumHours stat (no runtime data available from history). deletes
activityHistoryParams.ts.
scoreStat was parsing formatted display strings back to numbers via
Number(stat.value.replace(/,/g, '')) which breaks for compact notation
like "4.2K". adds rawValue: number to PulseStat and uses it directly
in scoring functions.
use correct --height-pulse-list var in SectionList, add shareReplay(1)
to items observable matching useStreak pattern, fix cross-feature
relative import in useUserComments to use $lib/ alias.
@seferturan seferturan force-pushed the feat/home-weekly-pulse branch from 00a4553 to b4799ba Compare April 3, 2026 10:23
@seferturan seferturan self-requested a review April 3, 2026 10:23
Copy link
Copy Markdown
Contributor

@seferturan seferturan left a comment

Choose a reason for hiding this comment

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

I added some minor fixups:

  • Feature flagged
  • Support for drilled down version in drawer
  • A simplified 'no scroll' on larger screens
  • Split up some code in separate files.

@seferturan seferturan disabled auto-merge April 3, 2026 11:06
@seferturan seferturan merged commit a083800 into main Apr 3, 2026
14 of 15 checks passed
@seferturan seferturan deleted the feat/home-weekly-pulse branch April 3, 2026 11:06
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