Fix residence auto-update, widget theming, and document patterns

- Fix residence detail not updating after edit:
  - DataManager.updateResidence() now updates both _residences and _myResidences
  - ResidenceViewModel auto-updates selectedResidence when data changes
  - No pull-to-refresh needed after editing

- Add widget theme support:
  - Widgets now use user's selected theme via App Group UserDefaults
  - ThemeManager has simplified version for widget extension context
  - Added WIDGET_EXTENSION compiler flag to CaseraExtension target

- Redesign widget views with organic aesthetic:
  - Updated FreeWidgetView, SmallWidgetView, MediumWidgetView, LargeWidgetView
  - Created OrganicTaskRowView, OrganicStatsView, OrganicStatPillWidget

- Document patterns in CLAUDE.md:
  - Added Mutation & Auto-Update Pattern section
  - Added iOS Shared Components documentation
  - Documented reusable buttons, forms, empty states, cards, modifiers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-17 22:58:55 -06:00
parent 7d76393e40
commit b39d37a6e8
8 changed files with 719 additions and 254 deletions

View File

@@ -370,6 +370,13 @@ object DataManager {
_residences.value = _residences.value.map {
if (it.id == residence.id) residence else it
}
// Also update myResidences if present (used by getResidence cache lookup)
_myResidences.value?.let { myRes ->
val updatedResidences = myRes.residences.map {
if (it.id == residence.id) residence else it
}
_myResidences.value = myRes.copy(residences = updatedResidences)
}
persistToDisk()
}

View File

@@ -9,7 +9,7 @@ package com.example.casera.network
*/
object ApiConfig {
// ⚠️ CHANGE THIS TO TOGGLE ENVIRONMENT ⚠️
val CURRENT_ENV = Environment.LOCAL
val CURRENT_ENV = Environment.DEV
enum class Environment {
LOCAL,