Personalized names for completed workouts on the feed - #47
Open
methodsat-afk wants to merge 1 commit into
Open
Conversation
FITFO-730. A logged session showed up on the feed under its plan label
("Push A"). It now reads as the person's own: "Grady's Turbo Push Day".
Feed-only. The plan keeps the coach's regular names — nothing about how a
workout is scheduled, started, or logged changes. This is display on the
community feed and nothing else.
The adjective comes from a bank of 30, seeded on the post id. That gives the
three properties a feed needs: each completion draws its own word, so logging
two workouts in one day yields two different adjectives; a post's name never
changes once written, which a Math.random() (rerenders) or a date seed
(rewrites history) would both break; and no workout type is pinned to a word,
so the same "Push A" reads differently every time it is logged.
Rest and recovery sessions skip the adjective. Anything unpersonalizable — no
author name, a placeholder like "FitFo Member", an unreadable title — falls
through to the original title untouched.
Applied once per post and reused for the three accessibility labels, so screen
readers match what is on screen.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 free
to 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.
Closes FITFO-730.
What
A completed workout showed up on the community feed under its plan label — "Push A", "Upper B". It now reads as the person's own:
Push AGrady's Turbo Push DayPush AGrady's Thunder Push DayUpper BAston's Gritty Upper DayShoulders+Arms AJoe's Golden Shoulders & Arms DayRestSam's Rest DayScope
Feed only. The plan keeps the coach's regular names. Nothing about how a workout is scheduled, started, logged, or matched changes — this is display on
CommunityScreenand nothing else. No API or schema changes.How the adjective is chosen
From a bank of 30 words, seeded on the post id. That was the key decision, and it buys three things at once:
Math.random()would rename an old post on every re-render; a date-based seed would rewrite history every morning. Both are wrong for a permanent record.Push Areads differently every time it's logged.Rest and recovery sessions skip the adjective. Anything unpersonalizable — no author name, a placeholder like "FitFo Member", an unreadable title — falls through to the original title untouched, so a post can never render worse than it started.
Computed once per post and reused for the three accessibility labels, so screen readers match what's on screen.
Test plan
tsc --noEmitat 224 errors — exactly baseline, none in the changed filesFiles
src/lib/completedWorkoutName.ts— new, pure, no React Native importssrc/lib/completedWorkoutName.test.ts— newsrc/screens/CommunityScreen.tsx— 13 lines