Skip to content

Fix the develop review: CI race, bugs, split view, speed and cleanup - #25

Merged
sayed0am merged 23 commits into
developfrom
develop-perf
Nov 1, 2026
Merged

sayed0am merged 23 commits into
developfrom
develop-perf

Conversation

@sayed0am

@sayed0am sayed0am commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Fixes for #21 (develop into main), from a review of the whole develop diff. It now includes everything from #24, which is closed in favour of this one.

CI failure

DeletedNightStateTest failed on CI. DayViewModel read sleep through two separate Room flows, one for the night and one for the strip of nights. After a delete or a restore they could update one after the other, and the test caught the state in between. Now one read feeds both, so they always change together.

Bugs

  • Mind and body: a paused quiet screen showed a Pause button that did nothing. It now shows Resume.
  • Backup: badges, past weeks, saved workouts, exercises and workout rounds weren't backed up. They are now restored whole. An exercise already on the phone keeps its own last weight, and restoring twice adds nothing.
  • Personal bests: a lift typed in another case ("bench press" against "Bench press") wasn't reported as a new best.
  • Game summary: periods were named from how many were played. A quarters game ended after two read "1st half, 2nd half". They're now named from the game's setup, in the live screen's wording.
  • Sleep edits: an edit was resolved against the one session alone, so editing or deleting a nap could overwrite the edit of a nap next to it. It's now resolved among nearby sessions, as the screens do.
  • Sleep times sheet: the overlap check only saw the day's naps. It now checks every sleep around the day, including last evening's nap.
  • Zone ranges: they now read again after the zones are moved on the Heart rate zones page.
  • Start on your usual: it could start a kcal goal that Ready no longer offers.
  • Folded phone (split view): each workout kind now gets its own live screen there too, so HIIT and run reps keep Skip and +10 s, and games keep Half time.
  • Half folded like a laptop: the half under the fold is short, and the full layouts overflowed it. HIIT's seconds sat on the buttons, a run lost its pace and distance, and strength and yoga lost their controls. Below 480 dp the live screens are now compact, and the map and yoga leave out the heart rate the other half already shows.
  • Weekly recap: rewards are refreshed before the recap reads the weeks, so it no longer sends stale numbers.
  • On the unfolded screen:
    • The workout glow no longer ends in a straight line.
    • Glow cards no longer flash their flat colour when they resize.
  • Route map: a run that went nowhere no longer shows a world map.

Speed

  • Route smoothing and rep metres are cached, so the route maths no longer runs several times a second.
  • Live screens read the ticking time only in the text that shows it.
  • Rewards keep the days they read and write only what changed.
  • The strength peak uses a binary search, and sleep stages are read once per night.

Unfolded layouts

  • Start a workout shows the rest of the sports beside the tiles.
  • Activity's Start card fills the width with sports, centred.

Shared code

  • One lit heart rate pill, and the same words when there's no reading.
  • One max heart rate source.
  • One set of summary facts for the share card and the summary.
  • PlanChoice for the plan cards.
  • TypedValue for Ready's distance goal.
  • RoundIcon, the MinusPlus stepper, topHairline and clock().

Cleanup

  • About 600 lines of dead code removed: the old split view, unreachable branches, and functions nothing called, along with tests that only covered them.
  • All 8 compiler warnings are fixed.

Testing

  • TZ=UTC ./gradlew :protocol:test :app:testDebugUnitTest :app:assembleDebug :app:assembleRelease passes.
  • New tests cover the backup tables, the lift case, early-ended games, the neighbouring nap edit, the kcal goal and the route map rule.
  • Checked on the Galaxy Fold:
    • Unfolded: a run, its map page and its summary, and a HIIT, live and paused.
    • Unfolded: Start a workout, Activity's Start card and the Steps detail glow.
    • Folded: a strap workout's page.
    • Half folded like a laptop: HIIT (work, rest and done), a run (pace and map), strength (ready, set, log and rest), basketball, cross-training and yoga.
    • Half folded like a book: a run (pace and map) and a HIIT. The heart card's zone edge was a hard line on the tall card, now a soft fade.

🤖 Generated with Claude Code

sayed0am and others added 21 commits November 1, 2026 16:37
- One sleep read for the night and the strip of nights, so a delete or a
  restore changes both in the same state (DeletedNightStateTest on CI)
- Mind and body: a paused quiet screen shows Resume, not a dead Pause
- Backup: badges, past weeks, saved workouts, exercises and rounds
- Personal bests: a lift typed in another case still beats its best
- Game summary: periods named from how the game was set up
- Sleep edits: resolved among neighbouring sessions, so editing one nap
  can't overwrite the next one's edit
- Times sheet: checks overlaps against every sleep around the day
- Zone ranges read again after the zones are moved
- Start on your usual: no kcal goal Ready wouldn't offer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Speed: cache the smoothed route and the rep metres, read the pulse dot
scale and IME inset off composition, keep live controls stable, key the
map's zone colours on coarse sizes, binary search the strength peak,
read each night's stages once in RecoveryEngine, and let RewardsKeeper
keep its days between refreshes and write only what changed.

Duplication: one bucketMeans and evenly for chart lines, one zoneLine,
one max heart rate window, one tested max range, badge thresholds read
from BADGES, the share card's heart line from FamilySummary, rep names
from StartCopy.repParts, a pace field on the summary hero instead of a
label lookup, the Health Connect sleep export in one place, and the
repeated surface colours pointed at their shared tokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workouts synced while the app was closed never reached week_result, so the
recap went out with old numbers and was then marked sent. RewardsKeeper now
has refreshNow, which builds the merged workout list once and refreshes with
the stored weekly goal, and WeeklyRecap.check runs it first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Half open on a fold, the live screen used to fall back to the old
shared screen, so HIIT and run reps lost Skip and +10 s, games lost
Half time and strength showed the old sets panel. Every kind now keeps
its own screen and controls. Games and indoor leave the heart rate to
the other half, where the glance shows it. The old screen, its sets
panel, map page and side figures are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d facts, live clock

The recap's rewards refresh reads the shared max heart rate too, and
the indoor screen keeps its split view zone bar with the ticking time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the unfolded phone the glow's radius, 90% of the width, was taller
than its 420 dp box, so it ended in a straight line across the page.
The radius is now capped at the box height. Phones look the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the two-column width, the rest of the sports, A to Z, sit in a
column of their own beside the tiles, each side scrolling by itself,
so none waits behind More sports. Folded it's the same as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a phone it's still your three most used and All sports. Wider, as
many tiles as fit at a phone's spacing: your other sports, then the
everyday ones, one tile per sport whichever kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening or closing a detail beside the tab on an unfolded phone
rebuilds and resizes the cards. Until a card's glow for its new size
was drawn, it showed the plain body colour, a flat green flash on
Steps. Now it keeps its last glow, or the last one drawn for that look
at any size, stretched to fit until its own is ready, and the cache
holds 16 instead of 10 so the sizes in use stay in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…screen

The pace page's strip and the map's chip were the same pill at two
heights, now LitHeartPill. Every live screen says Paused, Waiting for
the strap or Waiting for heart rate through WorkoutCopy.noHeartRate,
where some said No heart rate yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It kept its own typing state, focus tracking and tap target, the same
as TypedValue's. Time keeps its own: one figure of hours moves on to
the minutes by itself, which TypedValue doesn't do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RoundIcon takes a size, surface and ink, so Ready's 52 dp steppers, the
live minimize buttons and the map's buttons use it. MinusPlus is the
stepper for Ready's goals and the strength log card. Ten list rows draw
their divider with Modifier.topHairline, and five copies of the HH:mm
clock are one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run with GPS fixes all in one spot drew a map zoomed out to the
world. Route.mappable needs the fixes to spread 25 m, and the summary
card, the past workout page and the share card use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leftovers from earlier designs that no screen calls any more: the old
Panel and PanelHeader, chart and glow helpers, the personal best line,
the saved title, Ready's target hint and strength steppers, the step
divergence check, and others, with the tests that only covered them.
The layout helpers tests use to check widget and grid geometry stay.

The past workout page's map check now uses Route.mappable too, and
the needless !!, ?. and else that the compiler warned about are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Past the PastSummary return, GlowWorkoutScreen only ever shows a
strap workout, so its phone branches are gone. LiveMapScreen always
sits under the shared bottom bar, so its own dots, controls and notes
are gone and bottomRoom is required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sayed0am sayed0am changed the title Faster live screens, split view per workout kind, shared parts and dead code removed Fix the develop review: CI race, bugs, split view, speed and cleanup Nov 1, 2026
sayed0am and others added 2 commits November 1, 2026 21:07
Stood like a laptop, the half under the fold is about 355 dp high and
the live screens kept their full layouts, so they overflowed: HIIT's
seconds sat on the buttons, the run's pace and distance were squeezed
away, strength and yoga lost their controls off the bottom, and games
lost the controls' labels.

Below 480 dp the screens are now compact: the total small on top,
HIIT's phase, seconds and +10 s on one row, the run's distance, pace
and kcal in one row, strength's set or rest as one row with its clock,
and yoga's time without the ring. With the heart rate on the other
half, the map and yoga leave out their own. Checked on the Fold with
a HIIT, run, strength, basketball, cross-training and yoga.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed pill

Stood like a book, the heart card takes a whole half of the screen,
and the level's fixed 22 dp fade turned into a hard line across it.
The fade is now at least 8% of the card's length, so it stays soft;
phone-sized cards keep 22 dp. The run's pace page leaves out its heart
pill when the heart card is beside it, as the map already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sayed0am
sayed0am merged commit f07c635 into develop Nov 1, 2026
1 check passed
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.

1 participant