fix: Save to Collection button not responding (#1) #3

Merged
admin merged 1 commits from fix/issue-1-save-to-collection into master 2026-04-12 10:14:15 -05:00

1 Commits

Author SHA1 Message Date
Trey t
987ebf9690 fix: Save to Collection button not responding without user interaction
The Save to Collection button on the identification screen would remain
disabled after plant identification completed, requiring the user to tap
a prediction row before it would enable. This was caused by an @Observable
+ @State tracking issue where computed properties in SwiftUI view modifiers
don't always trigger re-renders when the underlying observable changes.

Replaced the empty .onChange workaround with a local @State property
(saveEnabled) that is explicitly updated when selectedPrediction or
saveState changes, ensuring the button state always reflects the current
ViewModel state.

Fixes #1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 10:08:30 -05:00