Skip to content

Align STL Export Tower Grid with Real Weekdays - #8316

Open
ChetanSenta wants to merge 2 commits into
JhaSourav07:mainfrom
ChetanSenta:fix/stl-export-weekday-alignment
Open

Align STL Export Tower Grid with Real Weekdays#8316
ChetanSenta wants to merge 2 commits into
JhaSourav07:mainfrom
ChetanSenta:fix/stl-export-weekday-alignment

Conversation

@ChetanSenta

Copy link
Copy Markdown
Contributor

Description

Fixes #8315

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other

What this PR does

activityToTowers() (the 3D STL print export) derived each tower's grid
row from idx % 7 — the flat array index — rather than the day's
actual weekday. Every other tower-grid builder in the codebase
(computeTowers() in lib/svg/layout.ts, chunkDaysIntoWeeks() in
lib/calculate.ts) anchors rows to real, Sunday-first weekdays. This
made the exported 3D-printable model's grid pattern not match the same
user's actual 2D badge whenever the export's date range didn't happen to
start on a Sunday (the common case). Fixed by computing real weekday via
getUTCDay() and tracking week-column boundaries explicitly at real
Sunday transitions.

Changes

File Change
lib/export3d.ts activityToTowers() now derives row from getUTCDay() and increments col only at Sunday boundaries
lib/export3d.test.ts New — verifies row=weekday alignment, correct week-column incrementing, and identical alignment regardless of the export's start-of-range weekday

Checklist before requesting a review:

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally.
  • I have run npm run format and npm run lint locally and resolved all errors.
  • My commits follow the Conventional Commits format.
  • I have made sure that I have only one commit to merge in this PR.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Someone 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 25, 2026

Copy link
Copy Markdown

This pull request addresses an important issue by aligning the STL export's tower grid with actual weekdays, which enhances the consistency of the exported models with the 2D badge representation. This change is crucial for users who rely on accurate date representations in their exports. Additionally, it includes new tests to verify the correct alignment and incrementing of week-columns.

It's worth noting that similar past decisions focused on enhancing timezone normalization and calendar boundary handling, which underscores the importance of accurate date calculations in our application. Thank you for your contribution, and I look forward to your updates!

@retenta-bot retenta-bot Bot changed the title fix(export3d): align STL export's tower grid to real weekday, matching the 2D badge's grid convention Align STL Export Tower Grid with Real Weekdays Jul 25, 2026
@github-actions github-actions Bot added the status:blocked This PR is blocked due to a failing CI check. label Jul 25, 2026
@github-actions github-actions Bot removed the status:blocked This PR is blocked due to a failing CI check. label Jul 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Size Report (Gzipped Sizes)

✨ No significant bundle size changes detected.

📊 Summary of Totals

Category PR Size Base Size Difference
Total JS 4052.60 KB 4052.50 KB +0.10 KB (+0.00%)
Total CSS 338.94 KB 338.94 KB 0 B

@Aamod007 Aamod007 added level:intermediate Moderate complexity tasks quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. mentor:Aamod007 type:bug Something isn't working as expected type:testing Adding, updating, or fixing tests labels Jul 27, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Aligning the STL export tower grid with real weekdays — significant refactoring of the 3D export logic. CI failing, please fix.

Labels: level:intermediate (3 files, 167+93), quality:clean, type:bug, type:testing, mentor:Aamod007

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewing after noting the only CI failure is Vercel authorization (not code-related). All other checks (Format · Lint · Typecheck · Test, Production Build, CodeQL) pass. Approving — the Vercel deploy auth is a repo-level config issue, not a code problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:intermediate Moderate complexity tasks mentor:Aamod007 quality:clean PR follows clean coding practices, proper formatting, documentation, and maintainability standards. type:bug Something isn't working as expected type:testing Adding, updating, or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 3D STL export's activityToTowers() uses idx % 7 for row assignment instead of real day-of-week — misaligned vs. the SVG badge's own grid

2 participants