Add analytics tracking, overview PDF export, and charger updates
Add first launch event, share tracking for overview PDF and diagram exports. Add SystemOverviewPDFExporter for A4 PDF generation. Update charger model with new configuration fields and localization for all 5 languages. Refresh app icon assets and CLAUDE.md build instructions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
31
CLAUDE.md
31
CLAUDE.md
@@ -4,21 +4,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||
|
||||
## Build & Test Commands
|
||||
|
||||
```bash
|
||||
# Build
|
||||
xcodebuild -scheme Cable -destination 'platform=iOS Simulator,name=iPhone 15' build
|
||||
Use the **Xcode MCP server** tools instead of `xcodebuild` CLI:
|
||||
|
||||
# Run all tests (unit + UI)
|
||||
xcodebuild -scheme Cable -destination 'platform=iOS Simulator,name=iPhone 15' test
|
||||
- **List windows first**: Always run `mcp__xcode__XcodeListWindows` to find the correct `tabIdentifier` — it changes depending on which Xcode windows are open.
|
||||
- **Build**: `mcp__xcode__BuildProject`
|
||||
- **Run all tests**: `mcp__xcode__RunAllTests`
|
||||
- **Check errors**: `mcp__xcode__GetBuildLog` (severity: `error`) or `mcp__xcode__XcodeListNavigatorIssues`
|
||||
|
||||
# Run only unit tests
|
||||
xcodebuild -scheme Cable -destination 'platform=iOS Simulator,name=iPhone 15' -only-testing:CableTests test
|
||||
|
||||
# Open in Xcode (preferred for UI iteration with previews)
|
||||
open Cable.xcodeproj
|
||||
```
|
||||
|
||||
Requires Xcode 15+ and iOS 17 simulator. No external dependencies beyond the Xcode toolchain.
|
||||
No external dependencies beyond the Xcode toolchain.
|
||||
|
||||
## Architecture
|
||||
|
||||
@@ -56,7 +49,17 @@ Each feature has its own directory under `Cable/`: `Loads/`, `Systems/`, `Batter
|
||||
|
||||
## Localization
|
||||
|
||||
5 languages: English (base), German, Spanish, French, Dutch. UI strings use `String(localized:)`. Translation files are in `*.lproj/Localizable.strings` and `Localizable.stringsdict`.
|
||||
5 languages: English (base), German, Spanish, French, Dutch. Translation files are in `*.lproj/Localizable.strings` and `Localizable.stringsdict`.
|
||||
|
||||
- Use `String(localized:defaultValue:)` — **not** `NSLocalizedString`. The `defaultValue` serves as English fallback and avoids showing raw keys when a Localizable.strings entry is missing.
|
||||
- When adding new user-facing strings, add translations to **all 5** Localizable.strings files immediately.
|
||||
|
||||
## PDF Export Pattern
|
||||
|
||||
PDF exports use `UIGraphicsPDFRenderer` with A4 portrait format. The pattern is:
|
||||
- **Exporter struct** (e.g. `SystemOverviewPDFExporter`, `SystemBillOfMaterialsPDFExporter`) with snapshot data types — keeps Core Graphics rendering isolated from SwiftUI/SwiftData.
|
||||
- **ShareSheet** triggered via `@State` item binding in the parent view.
|
||||
- **Toolbar button** (not inline content) for the export action.
|
||||
|
||||
## StoreKit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user