Files
InvestmentTrackerApp/PortfolioJournalWidget/WidgetIntents.swift
T
alexandrev-tibco 326be6db04 1.6.0 #10 ocultar saldos + Face ID · #11 widget interactivo + Siri
#10 Ocultar saldos: BalancePrivacyManager (balancesHidden + requireBiometricToReveal),
modifier .hiddenBalance() (blur + máscara de bullets, ancho estable), botón ojo en Dashboard,
revelar con Face ID vía AppLockService, sección Privacidad en Settings. Aplicado a total
portfolio, forecast, sources, goals, monthly summary.

#11 Siri/App Intents: NetWorthIntent ('¿cuál es mi patrimonio?' → 'Tu patrimonio es X'),
StreakIntent, 5 AppShortcuts con frases. Widget interactivo iOS 17: botón Refresh
(Button(intent:) → reloadAllTimelines, in-process) en medium/large, gated #available(iOS 17).
Reader read-only del AppGroup. Dialogs Siri refactorizados a String(localized:).

Localización: strings de #10 y de Siri en los 7 idiomas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L2p3gUZRNWW388rWFRjiU7
2026-07-25 17:52:09 +02:00

22 lines
847 B
Swift

import AppIntents
import WidgetKit
// MARK: - Interactive widget intents (iOS 17+)
//
// These run in-process from the widget via `Button(intent:)` no app launch.
// The intent type compiles on iOS 16, but the interactive Button that invokes it
// is gated to iOS 17 in the widget views, so iOS 16 still builds and works with
// the existing `.widgetURL` deep links.
/// Reloads all widget timelines so the numbers refresh without opening the app.
struct RefreshWidgetIntent: AppIntent {
static let title: LocalizedStringResource = "Refresh Portfolio Widget"
static let description = IntentDescription("Reload the portfolio widget with the latest values.")
static let isDiscoverable = false
func perform() async throws -> some IntentResult {
WidgetCenter.shared.reloadAllTimelines()
return .result()
}
}