Skip to content

Add Exercise opens clean after an exercise was added - #165

Open
daniel-bernardino747 wants to merge 1 commit into
TraceApps:devfrom
daniel-bernardino747:ui/picker-reset-after-add
Open

daniel-bernardino747 wants to merge 1 commit into
TraceApps:devfrom
daniel-bernardino747:ui/picker-reset-after-add

Conversation

@daniel-bernardino747

Copy link
Copy Markdown
Contributor

Closes #161

Summary

The picker's search and filters are dropped when it closes after at least one add, so the next open starts clean. Closing without adding keeps them, and the picker still stays open with its filters while several exercises are added in a row.

Changes

  • src/components/exercises/ExercisePicker.svelte: an onDestroy that removes the saved filters when something was added in that session
  • CHANGELOG.md: entry under Unreleased

No visual or style changes. The same picker is used in the Workout Editor, where it behaves the same way.

Screenshots

Reopening Add Exercise after adding Bench Press with "press" + Chest:

Before After

How to test

  1. Diary > Add Exercise, search "press", tap Chest, add an exercise, close.
  2. Open Add Exercise again: empty search, All selected.
  3. Search and filter again, close without adding, reopen: search and filter are still there.

Notes

This is only a suggestion. Feel free to use all of it, part of it or none of it.
I used AI (Claude Code) to help write these changes; I reviewed and tested them myself.

The picker keeps its search and filters in sessionStorage so that
re-opening it mid-workout doesn't lose them. After an add, though, the
next open is for a different exercise, and it started with the last
one's search and filters to clear by hand.

They are now dropped when the picker closes after at least one add.
Closing without adding keeps them, and the picker still stays open with
its filters while several exercises are added in a row.
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