Skip to content

Deck stats: followers and copies on a deck you're not studying - #334

Merged
jvsena42 merged 3 commits into
mainfrom
feat/deck-stats-social-counts
Sep 23, 2026
Merged

jvsena42 merged 3 commits into
mainfrom
feat/deck-stats-social-counts

Conversation

@jvsena42

Copy link
Copy Markdown
Owner

What

On a deck you neither own nor follow, the statistics bar spent its whole width on a single "551 / Total" — one column centred in an empty card.

showProgress hides Due, New and Mastered there, and that is right: all three are facts about your study of a deck, and "442 Due" beside a Follow button promises study you cannot start. But the room they left went to nothing.

It now goes to the two facts about the deck, which are what you are deciding on: Total · Followers · Copies.

Before After
551 / Total alone 551 Total · 1 Followers (· N Copies when anyone has copied it)

Both counts were already in DeckDetailUiState.Content, from the indexer's distinct-tagger counts for the reserved labels. They were only ever drawn as a caption above the author, which is now shown for an owned or followed deck alone — otherwise the bar is carrying it, and twice is once too many.

Each column is hidden at zero rather than shown as "0", unchanged from the caption's rule: the indexer answers with nothing when it is behind or unreachable, so a zero would be a lie in both cases. Total on its own stays the honest fallback.

iOS came along, and gained the gate it never had

StatsBarView had no showProgress equivalent, so a stranger's deck on iOS showed "0 Due" and "0 Mastered" — precisely the claim the Android flag exists to stop. It takes the same gate now, and the same two columns. clonedCount was populated by the shared ViewModel and read by nothing on the Swift side; the bridge maps it.

No shared code changed — this is presentation only.

Verified on a device

emulator-5554, staging, on "Inglês para viajar de avião" (551 cards, not owned, not followed), at all three width classes, because the wide layout's metadata column is the narrowest place the three columns ever land:

  • compact 1080x2400
  • medium 1600x2560 @ 320dpi (800dp)
  • expanded 2560x1600 @ 240dpi (1706dp — the two-pane layout, bar in the left column)

Three columns fit at every one. The three-column case was driven with the counts stubbed to 128/17, since no staging deck has a clone yet; the stub was reverted and the screen re-driven on the real build before committing.

./gradlew detektAll checkStringPlurals :shared:jvmTest :androidApp:assembleDebug all green. lintSwift not runnable on this Linux host — left to CI.

Strings

component_stats_bar_followers and component_stats_bar_copies, in all eleven languages on both platforms.

Journeys

26-copy-to-edit.xml gains two assertions — what the bar carries before you follow, and that following swaps it back — and RESULTS.md records the 2026-09-23 run.

🤖 Generated with Claude Code

jvsena42 and others added 3 commits September 23, 2026 08:20
The stats bar spent its whole width on a single "551 / Total" on a deck
you neither own nor follow. Due, New and Mastered are facts about *your*
study of a deck, so `showProgress` hides all three there — correctly, since
"442 Due" beside a Follow button promises study you cannot start — leaving
one column centred in an empty card.

That room now goes to the two facts about the *deck*, which are what you
are actually deciding on: Total · Followers · Copies. Both counts were
already in the state, from the indexer's distinct-tagger counts for the
reserved labels; they were only ever drawn as a caption above the author,
which is now shown for an owned or followed deck alone — the bar is
carrying it otherwise, and twice is once too many.

Each is hidden at zero rather than shown as "0", unchanged from the
caption's rule: the indexer answers with nothing when it is behind or
unreachable, so a zero would be a lie in both cases, and Total on its own
stays the honest fallback.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
iOS had no `showProgress` equivalent, so a stranger's deck showed "0 Due"
and "0 Mastered" — the exact claim the Android flag exists to stop. It now
takes the same gate, and the same two counts take the room: Total ·
Followers · Copies.

`clonedCount` was populated by the shared ViewModel and read by nothing on
this side, so the bridge maps it now. The follower caption is kept for an
owned or followed deck only, matching Android.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…deck

Two assertions on the foreign-deck screen 26 already opens, and the
2026-09-23 run behind them: the three width classes the three columns have
to fit in, and the stub the Copies column needed since no staging deck has
a clone yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jvsena42
jvsena42 enabled auto-merge September 23, 2026 11:22
@jvsena42
jvsena42 merged commit bf452fe into main Sep 23, 2026
8 checks passed
@jvsena42
jvsena42 deleted the feat/deck-stats-social-counts branch September 23, 2026 11:23
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