Bugfix/more embedded viewmodel support#95
Merged
foscomputerservices merged 7 commits intomainfrom Jan 2, 2026
Merged
Conversation
…ore-embedded-viewmodel-support
# Conflicts: # .gitignore
Implements path-based ModelRegistry to correctly distinguish between multiple ViewModels of the same type during encoding. Previously, all instances of the same ViewModel type would share the same substitution values because lookup was only by type. Key changes: - Add ModelRegistry class for path-based model registration and lookup - Add unwrapOptional() to handle Optional ViewModels in allPropertyNames() - Update currentModel(for:) to use codingPath for accurate model lookup - Update LocalizingEncoder.encode() to build registry before encoding This enables patterns like having innerViewModel1 and innerViewModel2 of the same type, each with their own substitution values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New test files: - ModelRegistryTests.swift: 9 tests for path-based model lookup - LocalizableDateTests.swift: 25 tests for date localization Enhanced existing tests: - EmbeddedViewModelTests: +10 tests for optionals, deep nesting, collections - LocalizablePropertyTests: +6 tests for error paths, encoder state - LocalizableSubstitutionsTests: +8 edge case tests Total: 58 new tests validating ModelRegistry path resolution, LocalizableDate formatting, optional ViewModel handling, and substitution edge cases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update EmbeddedViewModelTests and ModelRegistryTests to use expectFullViewModelTests() pattern for comprehensive multi-locale testing (codable, versioning, translations) - Add Spanish translations for all test ViewModels in YAML files - Expand FOSMVVMArchitecture.md Testing Support section with LocalizableTestCase documentation and testing patterns - Create fosmvvm-viewmodel-test-generator skill with SKILL.md and reference.md templates for generating ViewModel tests - Bump plugin version to 1.3.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.