Skip to content

feat: add hide_weekend parameter for compact contribution calendar view#8186

Open
sudeekshaballanda-hub wants to merge 5 commits into
JhaSourav07:mainfrom
sudeekshaballanda-hub:feat/hide-weekend-parameter
Open

feat: add hide_weekend parameter for compact contribution calendar view#8186
sudeekshaballanda-hub wants to merge 5 commits into
JhaSourav07:mainfrom
sudeekshaballanda-hub:feat/hide-weekend-parameter

Conversation

@sudeekshaballanda-hub

Copy link
Copy Markdown

Description

Adds a ?hide_weekend=true URL parameter that collapses Saturday and Sunday columns from the contribution calendar, providing a compact work-week view.

  • Problem: Users who primarily code on weekdays find the weekend columns create visual clutter and reduce heatmap readability.
  • Solution: A new hide_weekend parameter filters out weekend days and adjusts the calendar layout to display only Monday-Friday (5 columns).
  • Why: This gives users more control over their calendar view, similar to the existing start_day parameter.

Fixes #8073


Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Visual Preview

The hide_weekend parameter removes Saturday and Sunday columns, reducing the calendar from 7 columns to 5 columns for a compact work-week view.

Example Usage:


Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally (localhost:3000/api/streak?user=jhasourav07&hide_weekend=true).
  • I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
  • My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
  • I have updated README.md if I added a new theme or URL parameter.
  • I have started the repo.
  • I have made sure that i have only one commit to merge in this PR.
  • The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
  • (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.

How to Test

  1. Without parameter: /api/streak?user=jhasourav07 → 7 columns (Sun-Sat)
  2. With hide_weekend=true: /api/streak?user=jhasourav07&hide_weekend=true → 5 columns (Mon-Fri)
  3. Combined with start_day=1: /api/streak?user=jhasourav07&start_day=1&hide_weekend=true → 5 columns starting Monday

Technical Implementation

  • Added hideWeekend parameter to chunkDaysIntoWeeks function in lib/calculate.ts
  • Filtered out Saturday (6) and Sunday (0) when hideWeekend is true
  • Adjusted week grouping logic to maintain proper week boundaries
  • Passed hide_weekend from API route to calendar logic
  • Parameter already available in params object for SVG generators

Closes #8073

- Add hideWeekend parameter to chunkDaysIntoWeeks function
- Filter out Saturday and Sunday when hideWeekend is true
- Adjust week grouping logic for compact view
- Pass hide_weekend from API route to calendar logic
- Works alongside start_day parameter
- Closes JhaSourav07#8073
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

@sudeekshaballanda-hub is attempting to deploy a commit to the jhasourav07's projects Team on Vercel.

A member of the Team first needs to authorize it.

@retenta-bot

retenta-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

This PR adds a valuable feature that enhances user experience by allowing customization of the contribution calendar view. It is similar to a previously validated decision to add a hide_weekend parameter to the weekday graph, which also aimed to improve visual clarity. This consistency in feature implementation across different components is beneficial. Looking forward to your feedback on this enhancement!

@retenta-bot retenta-bot Bot changed the title feat: add hide_weekend parameter to collapse Saturday and Sunday columns feat: add hide_weekend parameter for compact contribution calendar view Jul 19, 2026
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 19, 2026
- Wrap currentWeek in contributionDays property to match ContributionWeek type
- Resolves TypeScript error in production build
- Validate YYYY-MM-DD format
- Filter out empty or invalid date strings
- Ensure only valid dates are included in calendar
- Fixes empty-fallback test failure
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jul 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

Asset PR Size Base Size Difference Status
static/chunks/1992-[hash].js 10.16 KB 9.98 KB +0.17 KB (+1.72%) 🔴 Regression
static/chunks/1a258343-[hash].js 22.37 KB 22.03 KB +0.34 KB (+1.54%) 🔴 Regression
static/chunks/2373-[hash].js 41.60 KB 41.88 KB -0.29 KB (-0.68%) 🟢 Improvement
static/chunks/2561-[hash].js 10.77 KB 10.54 KB +0.23 KB (+2.20%) 🔴 Regression
static/chunks/2f0b94e8-[hash].js 13.91 KB 13.77 KB +0.15 KB (+1.08%) 🔴 Regression
static/chunks/3215-[hash].js - 3.45 KB -3.45 KB (-100.00%) 🗑️ Deleted
static/chunks/4116-[hash].js 2.54 KB 2.51 KB +0.03 KB (+1.36%) 🔴 Regression
static/chunks/4256-[hash].js 95.26 KB - +95.26 KB (++100%) 🆕 New
static/chunks/4781-[hash].js 5.09 KB 6.90 KB -1.81 KB (-26.27%) 🟢 Improvement
static/chunks/5404-[hash].js - 40.62 KB -40.62 KB (-100.00%) 🗑️ Deleted
static/chunks/6297-[hash].js - 52.11 KB -52.11 KB (-100.00%) 🗑️ Deleted
static/chunks/6595-[hash].js 5.06 KB - +5.06 KB (++100%) 🆕 New
static/chunks/664-[hash].js 54.85 KB - +54.85 KB (++100%) 🆕 New
static/chunks/7192-[hash].js 40.32 KB - +40.32 KB (++100%) 🆕 New
static/chunks/9453-[hash].js - 93.62 KB -93.62 KB (-100.00%) 🗑️ Deleted
static/css/[hash].css 41.13 KB 41.06 KB +0.07 KB (+0.17%) 🔴 Regression

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 3994.07 KB 3975.85 KB +18.22 KB (+0.46%)
Total CSS 331.28 KB 331.16 KB +0.13 KB (+0.04%)

@sudeekshaballanda-hub

sudeekshaballanda-hub commented Jul 19, 2026

Copy link
Copy Markdown
Author

@JhaSourav07

This PR is ready for review. I'm a GSSoC contributor working on this feature. All CI checks have passed.
Please let me know if there's anything else I can adjust. Thanks!

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.

feat: Add hide_weekend parameter to collapse Saturday and Sunday columns

1 participant