Skip to content

refactor: collapse the duplicated duration and analytics code - #21

Merged
devRMA merged 2 commits into
chore/remove-dead-codefrom
refactor/simplify-analytics-and-durations
Aug 2, 2026
Merged

refactor: collapse the duplicated duration and analytics code#21
devRMA merged 2 commits into
chore/remove-dead-codefrom
refactor/simplify-analytics-and-durations

Conversation

@devRMA

Copy link
Copy Markdown
Owner

Four functions formatted the same minutes: formatHoursAndMinutes in
duration-row, formatBalance in work-summary (the same one plus a sign),
formatDuration in journey-form and formatClock in work-calculator, with
MINUTES_PER_HOUR redeclared across five files. They now come from one
lib/duration module.

safeGAEvent kept two branches emitting equivalent gtag calls and rebuilt
the same window cast four times; both collapse into one typed helper.
The retry loop stays: sendGAEvent from @next/third-parties drops the
event and warns when dataLayer is missing, so it cannot replace a poll
that exists to cover the gap until GA loads after consent.

AdManager probed googlesyndication.com on every page load and popped the
adblock modal regardless of NEXT_PUBLIC_ENABLE_ADS. With the flag off,
which is what .env currently ships, a visitor running an adblocker was
asked to disable it for ads that never render. Three existing tests only
passed because they inherited that behaviour; they now enable ads
explicitly, and a new one pins the flag being honoured.

The blanket biome-ignore-all in globals.css narrows to the
reduced-motion block that actually needs !important, and the JSON-LD
suppression states the ceiling it is safe under instead of just "SEO".

Co-Authored-By: Claude Opus 5 noreply@anthropic.com


Stack created with GitHub Stacks CLIGive Feedback 💬

@vercel

vercelBot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
workloadReadyReadyPreviewAug 2, 2026 6:50pm

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This comment was marked as resolved.

devRMAand others added 2 commits August 2, 2026 15:43
Four functions formatted the same minutes: formatHoursAndMinutes in
duration-row, formatBalance in work-summary (the same one plus a sign),
formatDuration in journey-form and formatClock in work-calculator, with
MINUTES_PER_HOUR redeclared across five files. They now come from one
lib/duration module.
safeGAEvent kept two branches emitting equivalent gtag calls and rebuilt
the same window cast four times; both collapse into one typed helper.
The retry loop stays: sendGAEvent from @next/third-parties drops the
event and warns when dataLayer is missing, so it cannot replace a poll
that exists to cover the gap until GA loads after consent.
AdManager probed googlesyndication.com on every page load and popped the
adblock modal regardless of NEXT_PUBLIC_ENABLE_ADS. With the flag off,
which is what .env currently ships, a visitor running an adblocker was
asked to disable it for ads that never render. Three existing tests only
passed because they inherited that behaviour; they now enable ads
explicitly, and a new one pins the flag being honoured.
The blanket biome-ignore-all in globals.css narrows to the
reduced-motion block that actually needs !important, and the JSON-LD
suppression states the ceiling it is safe under instead of just "SEO".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Rounding only the modulo remainder let the minute component reach 60:
59.6 rendered as "0h 60m" and 119.6 as "1h 60m", and the same split
feeds formatPaddedDuration, so a masked field could show "00:60".
Rounding the total first carries the extra minute into the hour.
The existing duration-row test asserted "0h 60m" as the expected
output, which pinned the defect in place; it now expects "1h 0m".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@devRMA
devRMAforce-pushed the refactor/simplify-analytics-and-durations branch from 437ee40 to e201ff3CompareAugust 2, 2026 18:46
@devRMA
devRMA merged commit c78ccfa into mainAug 2, 2026
4 checks passed
@devRMA
devRMA deleted the refactor/simplify-analytics-and-durations branch August 2, 2026 19:00
Sign up for freeto 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

@devRMA@codecov-commenter