-
Notifications
You must be signed in to change notification settings - Fork 0
feat(mobile): workout session fullscreen + series testids — PRD-5 #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -226,89 +226,98 @@ export function WorkoutSession({ treino, onFinish, onCancel }: Readonly<WorkoutS | |
| } | ||
|
|
||
| // --- Tela de Sessão Ativa --- | ||
|
|
||
| // ponytail: mobile fullscreen overlay; desktop inline. slide-up anim via globals keyframe. | ||
| return ( | ||
| <Card className="w-full max-w-2xl mx-auto"> | ||
| <CardHeader> | ||
| <CardTitle className="text-2xl text-center"> | ||
| {exercicioAtual.exercicioOriginal.nomeExercicio} | ||
| </CardTitle> | ||
| <div className="text-center text-muted-foreground"> | ||
| Exercício {exercicioAtualIndex + 1} de {exerciciosEmSessao.length} | ||
| </div> | ||
| </CardHeader> | ||
| <CardContent className="space-y-6"> | ||
| {/* Descrição do Exercício Planejado */} | ||
| <div className="text-center bg-secondary text-secondary-foreground rounded-lg p-3"> | ||
| <p className="font-bold"> | ||
| Planejado: {exercicioAtual.exercicioOriginal.series} séries x{' '} | ||
| {exercicioAtual.exercicioOriginal.repeticoes} reps | ||
| </p> | ||
| {exercicioAtual.exercicioOriginal.observacoes && ( | ||
| <p className="text-sm">Obs: {exercicioAtual.exercicioOriginal.observacoes}</p> | ||
| )} | ||
| </div> | ||
|
|
||
| {/* Tabela de Séries */} | ||
| <div className="space-y-4"> | ||
| {exercicioAtual.seriesExecutadas.map((serie) => ( | ||
| <div key={serie.id} className="grid grid-cols-4 items-center gap-4"> | ||
| <Label className="text-right">Série {serie.serieNumero}</Label> | ||
| <Input | ||
| type="number" | ||
| placeholder="Peso (kg)" | ||
| onChange={(e) => handleSerieChange(serie.id, 'peso', e.target.value)} | ||
| /> | ||
| <Input | ||
| type="number" | ||
| placeholder="Reps" | ||
| onChange={(e) => handleSerieChange(serie.id, 'repeticoesFeitas', e.target.value)} | ||
| /> | ||
| <Button | ||
| size="icon" | ||
| variant={serie.concluido ? 'default' : 'outline'} | ||
| onClick={() => handleSerieToggle(serie.id)} | ||
| <div className="fixed inset-x-0 top-0 z-50 flex h-dvh flex-col bg-background md:static md:z-auto md:h-auto md:bg-transparent animate-[slide-up_0.3s_ease-out] motion-reduce:animate-none"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The slide-up animation plays on desktop too, which may cause visual overlap with adjacent page content during the 0.3s mount animation. Since the desktop layout is intended to be inline ( Prompt for AI agents |
||
| <Card className="flex h-full w-full flex-col md:max-w-2xl md:mx-auto md:h-auto"> | ||
| <CardHeader className="shrink-0"> | ||
| <CardTitle className="text-2xl text-center"> | ||
| {exercicioAtual.exercicioOriginal.nomeExercicio} | ||
| </CardTitle> | ||
| <div className="text-center text-muted-foreground"> | ||
| Exercício {exercicioAtualIndex + 1} de {exerciciosEmSessao.length} | ||
| </div> | ||
| </CardHeader> | ||
| <CardContent className="flex-1 space-y-6 overflow-y-auto"> | ||
| {/* Descrição do Exercício Planejado */} | ||
| <div className="text-center bg-secondary text-secondary-foreground rounded-lg p-3"> | ||
| <p className="font-bold"> | ||
| Planejado: {exercicioAtual.exercicioOriginal.series} séries x{' '} | ||
| {exercicioAtual.exercicioOriginal.repeticoes} reps | ||
| </p> | ||
| {exercicioAtual.exercicioOriginal.observacoes && ( | ||
| <p className="text-sm">Obs: {exercicioAtual.exercicioOriginal.observacoes}</p> | ||
| )} | ||
| </div> | ||
|
|
||
| {/* Tabela de Séries */} | ||
| <div className="space-y-4"> | ||
| {exercicioAtual.seriesExecutadas.map((serie, serieIdx) => ( | ||
| <div | ||
| key={serie.id} | ||
| data-testid="series-row" | ||
| className="grid grid-cols-4 items-center gap-2" | ||
| > | ||
| <Check className="h-4 w-4" /> | ||
| </Button> | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
|
||
| {/* Cronômetro de Descanso */} | ||
| {isRunning && ( | ||
| <div className="flex items-center justify-center gap-2 text-2xl font-bold text-primary"> | ||
| <Timer /> | ||
| <span> | ||
| {minutes.toString().padStart(2, '0')}:{seconds.toString().padStart(2, '0')} | ||
| </span> | ||
| <Label className="text-right">Série {serie.serieNumero}</Label> | ||
| <Input | ||
| type="number" | ||
| placeholder="Peso (kg)" | ||
| onChange={(e) => handleSerieChange(serie.id, 'peso', e.target.value)} | ||
| /> | ||
| <Input | ||
| type="number" | ||
| placeholder="Reps" | ||
| onChange={(e) => handleSerieChange(serie.id, 'repeticoesFeitas', e.target.value)} | ||
| /> | ||
| <Button | ||
| size="icon" | ||
| variant={serie.concluido ? 'default' : 'outline'} | ||
| onClick={() => handleSerieToggle(serie.id)} | ||
| data-testid={`serie-check-${serieIdx}`} | ||
| aria-label={`Marcar série ${serie.serieNumero}`} | ||
| className="touch-target" | ||
| > | ||
| <Check className="h-4 w-4" /> | ||
| </Button> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| )} | ||
| </CardContent> | ||
|
|
||
| <CardFooter className="flex justify-between"> | ||
| <Button | ||
| variant="outline" | ||
| onClick={handleExercicioAnterior} | ||
| disabled={exercicioAtualIndex === 0} | ||
| > | ||
| <ArrowLeft className="mr-2 h-4 w-4" /> Anterior | ||
| </Button> | ||
| {/* Cronômetro de Descanso */} | ||
| {isRunning && ( | ||
| <div className="flex items-center justify-center gap-2 text-2xl font-bold text-primary"> | ||
| <Timer /> | ||
| <span> | ||
| {minutes.toString().padStart(2, '0')}:{seconds.toString().padStart(2, '0')} | ||
| </span> | ||
| </div> | ||
| )} | ||
| </CardContent> | ||
|
|
||
| {exercicioAtualIndex === exerciciosEmSessao.length - 1 ? ( | ||
| <CardFooter className="sticky bottom-0 flex shrink-0 justify-between bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80 md:bg-transparent md:backdrop-blur-none"> | ||
| <Button | ||
| onClick={handleFinalizarTreino} | ||
| className="bg-green-600 hover:bg-green-700" | ||
| disabled={isFinishing} | ||
| variant="outline" | ||
| onClick={handleExercicioAnterior} | ||
| disabled={exercicioAtualIndex === 0} | ||
| > | ||
| Finalizar Treino | ||
| </Button> | ||
| ) : ( | ||
| <Button onClick={handleProximoExercicio}> | ||
| Próximo <ArrowRight className="ml-2 h-4 w-4" /> | ||
| <ArrowLeft className="mr-2 h-4 w-4" /> Anterior | ||
| </Button> | ||
| )} | ||
| </CardFooter> | ||
| </Card> | ||
|
|
||
| {exercicioAtualIndex === exerciciosEmSessao.length - 1 ? ( | ||
| <Button | ||
| onClick={handleFinalizarTreino} | ||
| className="bg-green-600 hover:bg-green-700" | ||
| disabled={isFinishing} | ||
| > | ||
| Finalizar Treino | ||
| </Button> | ||
| ) : ( | ||
| <Button onClick={handleProximoExercicio}> | ||
| Próximo <ArrowRight className="ml-2 h-4 w-4" /> | ||
| </Button> | ||
| )} | ||
| </CardFooter> | ||
| </Card> | ||
| </div> | ||
| ); | ||
| } | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: docs/CURRENT-STATE.md: duplicate
### PRD-4heading. The newmerged #181heading was added but the oldPR #181 (open)heading was left in place. Remove the stale duplicate so the PRD-4 feature description lives under a single heading.Prompt for AI agents