feat: widget has two tap targets — fitness + add food
Widget background tap → platform://fitness → opens Fitness tab Widget + button tap → platform://add-food → opens Fitness + food assistant Small widget: + button in bottom-right corner (emerald green) Medium widget: + button in bottom-right corner Lock screen widgets: single tap → fitness (no room for + button) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -121,9 +121,15 @@ struct MainTabView: View {
|
||||
AssistantSheetView(onFoodAdded: foodAdded)
|
||||
}
|
||||
.onOpenURL { url in
|
||||
if url.scheme == "platform" && url.host == "add-food" {
|
||||
selectedTab = 1 // Fitness tab
|
||||
guard url.scheme == "platform" else { return }
|
||||
switch url.host {
|
||||
case "fitness":
|
||||
selectedTab = 1
|
||||
case "add-food":
|
||||
selectedTab = 1
|
||||
showAssistant = true
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
.task {
|
||||
|
||||
Reference in New Issue
Block a user