Skip to content

fix: use colon separator in Slice 2 timer - #28

Open
bluewandd wants to merge 3 commits into
aervxa:mainfrom
bluewandd:pr/lepse-slice2-timer-colon
Open

fix: use colon separator in Slice 2 timer#28
bluewandd wants to merge 3 commits into
aervxa:mainfrom
bluewandd:pr/lepse-slice2-timer-colon

Conversation

@bluewandd

Copy link
Copy Markdown

Summary

  • Restore the standard colon separator in the Slice 2 timer.
  • Add focused component tests that protect the rendered separator and prevent the old modifier from returning.

This is PR 3 of a three-PR sequence. Its head is commit fb0cace2c457d38fa4cfccef0b2cbf74f1ffb6b1 and includes PRs 1 and 2 by design.

Merge the email-verification and auth-cache PRs first. After those merges, this PR's remaining change is the timer separator correction.

@bluewandd

Copy link
Copy Markdown
Author

Context for reviewers

This is the third PR in the sequence. Its parent already contains the email-verification synchronization and auth-cache isolation work from PRs 27 and 29. The incremental product change here is the Slice 2 timer separator correction.

The user-visible issue

The clock component previously transformed the first ordinary colon with:

.replace(':', '꞉')

is U+A789 MODIFIER LETTER COLON, a non-ASCII letter-like character chosen for optical centering. It is rendered by a fallback font when the primary clock font does not provide that glyph. That makes the separator look different from the surrounding digits, with platform and font-rendering differences becoming especially visible in the large clock.

The old expression also produced mixed separators in long stopwatch values. formatDuration emits values such as 01:02:03.450, and String.prototype.replace with a string pattern changes only the first colon. The rendered result became:

01꞉02:03

The first separator came from the fallback glyph while the second remained an ordinary colon.

What changes

The component now renders the value returned by its existing clock/stopwatch/pomodoro expression directly. The .replace() call and the U+A789 glyph are removed.

The following behavior stays unchanged:

  • nowStr and its 12/24-hour locale behavior;
  • stopwatch and pomodoro calculations;
  • the one-hour slice threshold;
  • AM/PM rendering;
  • font declarations and font loading;
  • sizing classes, layout, and responsive breakpoints;
  • the email-verification and auth-cache code from the two preceding PRs.

This makes the change presentation-only. For example:

Mode Before After
Normal clock 3꞉45 PM 3:45 PM
Stopwatch under one hour 05꞉07 05:07
Stopwatch over one hour 01꞉02:03 01:02:03
Pomodoro 25꞉00 25:00

The time values remain the same after normalizing the old modifier glyph to an ordinary colon.

Review guidance

The focused timer test protects the source-level regression by checking that:

  • the clock interpolation still renders nowStr or formatted;
  • the modifier colon does not return to the component;
  • the .replace() transformation does not return to the clock expression.

The Lachesis test glob also keeps the profile-query and auth-cache tests from PRs 27 and 29 in the same local run:

npm test --workspace=@lepse/lachesis

A useful manual check is to view the normal clock, a running stopwatch below and above one hour, and a pomodoro timer. The separator should be the same ordinary : in each mode, with the existing layout and AM/PM treatment preserved.

The test remains a local/manual check because the current Lachesis release workflow builds the app but does not run the frontend test suite.

Sequence and review boundary

PR 28 includes PR 27 and PR 29 by design. Reviewers can isolate this PR's intended product delta by comparing the auth-cache head with this head: the timer component and its focused test are the only new product paths. The intended landing order is:

  1. feat: add email verification #27
  2. fix: harden B1/B2 auth-cache security #29
  3. fix: use colon separator in Slice 2 timer #28

The locale formatting behavior in nowStr.slice(0, -3) and the exact-one-hour boundary are inherited concerns outside this separator fix. They remain separate follow-up candidates so this PR keeps its one-character rendering correction easy to review.

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.

2 participants