refactor: collapse the duplicated duration and analytics code - #21
Merged
devRMA merged 2 commits intoAug 2, 2026
Merged
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
codecov-commenter
commented
Aug 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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>
devRMAforce-pushed
the
refactor/simplify-analytics-and-durations
branch
from
August 2, 2026 18:46
437ee40 to
e201ff3CompareUh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 CLI • Give Feedback 💬