Skip to content

Grand bain/home grand bain - Turn Home into the grand bain - #171

Closed
SalimMc wants to merge 4 commits into
mainfrom
grand-bain/home-grand-bain
Closed

SalimMc wants to merge 4 commits into
mainfrom
grand-bain/home-grand-bain

Conversation

@SalimMc

@SalimMc SalimMc commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

What

Part of the "Grand bain" redesign: the Home screen. There are three commits: the decorations, the pass water level, then Home itself.

Decorations (ui/theme/PoolDecorations.kt, new)

Plain shapes in theme colors, no images. Nothing animates forever.

  • poolCaustics(color): faint wavy light reflections, like the ones at the bottom of a pool.
  • poolFloorLines(color): the dark lane lines on a pool floor, with their "T" ends.
  • poolDepthMarkers(): depth tags (1.0 m, 1.5 m, …, see depthMarkerLabel) every 220 dp down the end edge of a scrolling screen.
    • DEPTH_MARKER_GUTTER (40 dp) is the space to leave free for them.
  • WaterLevel(level, color): water filling level (0–1) of the space, with a wavy surface. It rises once when shown.
    • waterPath and waterSurfaceY hold the geometry.
  • WaterColumnShape: a shape with a square bottom and a small wave on top.
  • EntryFloats(usedCount, maxEntries, color): an entry counter drawn as lane-rope floats, solid for each entry left and hollow for each used.
    • It is drawn only for passes of up to MAX_ENTRY_FLOATS = 30 entries (entryFloats).

Pass water level (ui/home/PassWaterLevel.kt, new)

  • passWaterLevel(subscription, usedCount, now) follows the same limit as Home's pass message:
    • dated pass: time left until expiry, divided by the time from added to expiry;
    • entry-limited pass: entries left divided by the maximum;
    • no limit: always full.
  • Edge cases:
    • Expired, or expiring exactly now → empty.
    • Added after its own expiration (a wrong clock) → full.
    • maxEntries = 0 is ignored.

Home (ui/home/HomeScreen.kt)

  • Sections: small capitalized headings LAST SWIM, ACTIVITY and SPENDING split the cards.
  • Depth markers run down the end edge of the scrolling page. The content keeps a 40 dp gutter for them.
  • Last swim card: floor lines and light reflections behind the text.
  • Pass card:
    • it is a pool whose water level drains as the pass is used up (passWaterLevel);
    • a pass limited only by entries also shows its entries as floats (PASS_ENTRY_FLOATS);
    • a dated pass shows no floats, since its water follows the expiry date;
    • message, urgency colors and icons are unchanged.
  • Weekly chart: bars are columns of water (WaterColumnShape) filled with barBrush, a vertical gradient.
    • This week's bar and the tapped bar are solid at the top; the others are paler.
    • Tapping a bar still shows its legend.
  • The ViewModel, the stats and the existing test tags are unchanged.

Note for review

The original HomeScreen.kt diff was lost: GitHub did not render it on the closed PR #160. This version was rebuilt from that PR's tests and decorations, so please look at this file more closely than the others.

Tests

  • PoolDecorationsTest:
    • depth labels, including a negative index;
    • water surface position and clamping;
    • water path bounds (empty, partial and full);
    • the water column outline;
    • entry floats: order, clamping, and empty for big passes.
  • PassWaterLevelTest: entry-limited, dated, both limits, expired (including exactly now), added after expiry, no limit, maxEntries = 0.
  • HomeScreenTest:
    • the sections are shown;
    • floats are shown for an entry-limited pass, but not for a dated one;
    • barBrush returns the expected gradient for highlighted and normal bars.
  • Ran locally: the full ./gradlew check ktfmtCheck passes (unit tests and lint, about 8 minutes). The unit tests ran with an English locale (-Duser.language=en), because two HistoryListModelTest cases already fail on main under a French locale.

How to review

  • Open Home with:
    • an entry-limited pass: water level plus floats;
    • a dated pass: water level, no floats.
  • Scroll down: the depth markers go deeper. Tap a weekly bar to see its legend.
  • This PR is independent of the other grand bain PRs and can be merged on its own.

🤖 Generated with Claude Code

SalimMc and others added 4 commits October 30, 2026 18:40
Light reflections, pool floor lines, depth markers, a wavy water level,
water columns and a counter of lane-rope floats, all drawn with plain
shapes in the theme's colors and never animating forever.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Time left until it expires for a dated pass, entries left otherwise,
following the same limit as Home's pass message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Home is split into Last swim, Activity and Spending sections along a
wall of depth markers. The pass card drains like a pool as it is used
and shows an entry-limited pass's entries as floats; the weekly bars
are columns of water.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Feature/home grand bain - Turn Home into the grand bain
@SalimMc
SalimMc requested a review from SamiPr0 October 30, 2026 18:57
@SalimMc SalimMc self-assigned this Oct 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
66.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@SamiPr0 SamiPr0 closed this Oct 31, 2026
@SamiPr0
SamiPr0 deleted the grand-bain/home-grand-bain branch October 31, 2026 21:15
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