Skip to content

Instantly share code, notes, and snippets.

@kventil
Created April 16, 2026 05:40
Show Gist options
  • Select an option

  • Save kventil/bb53c965e71497a252d80ed1dda9425a to your computer and use it in GitHub Desktop.

Select an option

Save kventil/bb53c965e71497a252d80ed1dda9425a to your computer and use it in GitHub Desktop.
Repository Wiki — generated by GitNexus
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Glucometer — Wiki</title>
<script src="https://cdn.jsdelivr.net/npm/marked@11.0.0/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
<style>
*{margin:0;padding:0;box-sizing:border-box}
:root{
--bg:#ffffff;--sidebar-bg:#f8f9fb;--border:#e5e7eb;
--text:#1e293b;--text-muted:#64748b;--primary:#2563eb;
--primary-soft:#eff6ff;--hover:#f1f5f9;--code-bg:#f1f5f9;
--radius:8px;--shadow:0 1px 3px rgba(0,0,0,.08);
}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
line-height:1.65;color:var(--text);background:var(--bg)}
.layout{display:flex;min-height:100vh}
.sidebar{width:280px;background:var(--sidebar-bg);border-right:1px solid var(--border);
position:fixed;top:0;left:0;bottom:0;overflow-y:auto;padding:24px 16px;
display:flex;flex-direction:column;z-index:10}
.content{margin-left:280px;flex:1;padding:48px 64px;max-width:960px}
.sidebar-header{margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid var(--border)}
.sidebar-title{font-size:16px;font-weight:700;color:var(--text);display:flex;align-items:center;gap:8px}
.sidebar-title svg{flex-shrink:0}
.sidebar-meta{font-size:11px;color:var(--text-muted);margin-top:6px}
.nav-section{margin-bottom:2px}
.nav-item{display:block;padding:7px 12px;border-radius:var(--radius);cursor:pointer;
font-size:13px;color:var(--text);text-decoration:none;transition:all .15s;
white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nav-item:hover{background:var(--hover)}
.nav-item.active{background:var(--primary-soft);color:var(--primary);font-weight:600}
.nav-item.overview{font-weight:600;margin-bottom:4px}
.nav-children{padding-left:14px;border-left:1px solid var(--border);margin-left:12px}
.nav-group-label{font-size:11px;font-weight:600;color:var(--text-muted);
text-transform:uppercase;letter-spacing:.5px;padding:12px 12px 4px;user-select:none}
.sidebar-footer{margin-top:auto;padding-top:16px;border-top:1px solid var(--border);
font-size:11px;color:var(--text-muted);text-align:center}
.content h1{font-size:28px;font-weight:700;margin-bottom:8px;line-height:1.3}
.content h2{font-size:22px;font-weight:600;margin:32px 0 12px;padding-bottom:6px;border-bottom:1px solid var(--border)}
.content h3{font-size:17px;font-weight:600;margin:24px 0 8px}
.content h4{font-size:15px;font-weight:600;margin:20px 0 6px}
.content p{margin:12px 0}
.content ul,.content ol{margin:12px 0 12px 24px}
.content li{margin:4px 0}
.content a{color:var(--primary);text-decoration:none}
.content a:hover{text-decoration:underline}
.content blockquote{border-left:3px solid var(--primary);padding:8px 16px;margin:16px 0;
background:var(--primary-soft);border-radius:0 var(--radius) var(--radius) 0;
color:var(--text-muted);font-size:14px}
.content code{font-family:'SF Mono',Consolas,'Courier New',monospace;font-size:13px;
background:var(--code-bg);padding:2px 6px;border-radius:4px}
.content pre{background:#1e293b;color:#e2e8f0;border-radius:var(--radius);padding:16px;
overflow-x:auto;margin:16px 0}
.content pre code{background:none;padding:0;font-size:13px;line-height:1.6;color:inherit}
.content table{border-collapse:collapse;width:100%;margin:16px 0}
.content th,.content td{border:1px solid var(--border);padding:8px 12px;text-align:left;font-size:14px}
.content th{background:var(--sidebar-bg);font-weight:600}
.content img{max-width:100%;border-radius:var(--radius)}
.content hr{border:none;border-top:1px solid var(--border);margin:32px 0}
.content .mermaid{margin:20px 0;text-align:center}
.menu-toggle{display:none;position:fixed;top:12px;left:12px;z-index:20;
background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);
padding:8px 12px;cursor:pointer;font-size:18px;box-shadow:var(--shadow)}
@media(max-width:768px){
.sidebar{transform:translateX(-100%);transition:transform .2s}
.sidebar.open{transform:translateX(0);box-shadow:2px 0 12px rgba(0,0,0,.1)}
.content{margin-left:0;padding:24px 20px;padding-top:56px}
.menu-toggle{display:block}
}
.empty-state{text-align:center;padding:80px 20px;color:var(--text-muted)}
.empty-state h2{font-size:20px;margin-bottom:8px;border:none}
</style>
</head>
<body>
<button class="menu-toggle" id="menu-toggle" aria-label="Toggle menu">&#9776;</button>
<div class="layout">
<nav class="sidebar" id="sidebar">
<div class="sidebar-header">
<div class="sidebar-title">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2z"/><path d="M22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7z"/></svg>
Glucometer
</div>
<div class="sidebar-meta" id="meta-info"></div>
</div>
<div id="nav-tree"></div>
<div class="sidebar-footer">Generated by GitNexus</div>
</nav>
<main class="content" id="content">
<div class="empty-state"><h2>Loading…</h2></div>
</main>
</div>
<script>
var PAGES = {"core-application":"# Core Application\n\n# Core Application Module Documentation\n\n## Overview\n\nThe Core Application module serves as the entry point for the Glucometer app, managing the lifecycle of the application and coordinating shared service objects. It is responsible for initializing critical components such as Bluetooth communication, data management, and UI setup. The module is structured around two main classes: `AppDelegate` and `SceneDelegate`, which handle application and scene lifecycle events, respectively.\n\n## Key Components\n\n### 1. AppDelegate\n\nThe `AppDelegate` class is the primary application delegate that manages the app's lifecycle and shared resources. It is responsible for:\n\n- **Initializing Shared Services**: Instantiates and configures shared service objects that are used throughout the app.\n- **Handling App Launch**: Executes one-time setup tasks during the app launch, including migrating user defaults and starting the Bluetooth stack.\n- **Managing App Lifecycle Events**: Provides stubs for handling various app lifecycle events.\n\n#### Shared Service Objects\n\n- **`sharedBLE`**: An instance of the `BLE` class that manages Bluetooth Low Energy (BLE) communication. It is initialized early to ensure that the `CBCentralManager` is ready for state restoration.\n \n- **`sharedGlucoseData`**: An instance of the `GlucoseData` class that handles GATT parsing and HealthKit persistence. This object is shared between the UI and background processes.\n\n- **`backgroundSyncManager`**: An instance of the `BackgroundSyncManager` class that manages synchronization tasks and acts as a BLE delegate during headless state restoration.\n\n#### Launch Method\n\nThe `application(_:didFinishLaunchingWithOptions:)` method performs the following key actions:\n\n1. **Migrate User Defaults**: Calls `DeviceStore.migrateIfNeeded()` to ensure legacy keys are updated.\n2. **Request Notification Permissions**: If onboarding is complete, it requests permission for notifications.\n3. **Start BLE**: Sets up the BLE delegate and starts the BLE stack.\n4. **Activate Watch Connectivity**: Initializes the WatchConnectivity session to allow data transfer to the Apple Watch.\n\n### 2. SceneDelegate\n\nThe `SceneDelegate` class manages the lifecycle of the app's UI scenes. It is responsible for:\n\n- **Connecting to Scenes**: Handles the connection of a new scene to the app, setting up the UI and injecting shared services into the view model.\n- **Handoff of BLE State**: Transfers any existing BLE connection state to the `GlucozyViewModel` to ensure a seamless user experience.\n\n#### Scene Connection Method\n\nThe `scene(_:willConnectTo:options:)` method performs the following actions:\n\n1. **Create View Model**: Instantiates `GlucozyViewModel`, injecting shared instances of `GlucoseData` and `BLE`.\n2. **Redirect Delegates**: Sets the view model as the delegate for `sharedGlucoseData` and `sharedBLE`, allowing it to handle BLE events and data updates.\n3. **Request HealthKit Authorization**: Requests authorization for HealthKit if onboarding is complete.\n4. **Handle Headless Handoff**: If the BLE device is already connected, it transfers the connection state to the view model.\n\n### 3. ViewController\n\nThe `ViewController` class is a legacy component retained for storyboard compatibility. It is not instantiated at runtime but is necessary to prevent crashes when loading the storyboard.\n\n## Architecture Overview\n\nThe following diagram illustrates the relationship between the key components of the Core Application module:\n\n```mermaid\ngraph TD;\n A[AppDelegate] -->|instantiates| B[sharedBLE]\n A -->|instantiates| C[sharedGlucoseData]\n A -->|instantiates| D[backgroundSyncManager]\n A -->|calls| E[application(_:didFinishLaunchingWithOptions:)]\n F[SceneDelegate] -->|creates| G[GlucozyViewModel]\n F -->|redirects delegates| G\n F -->|calls| H[scene(_:willConnectTo:options:)]\n G -->|uses| C\n G -->|uses| B\n```\n\n## Integration with the Codebase\n\nThe Core Application module integrates with other parts of the Glucometer app as follows:\n\n- **GlucozyViewModel**: The view model acts as the intermediary between the UI and the shared data/services, handling business logic and data presentation.\n- **BackgroundSyncManager**: This component manages background synchronization tasks and interacts with the BLE stack to ensure data consistency.\n- **HealthKit**: The app requests HealthKit authorization to store and retrieve glucose data, ensuring compliance with user privacy and data management standards.\n\n## Conclusion\n\nThe Core Application module is essential for initializing and managing the app's lifecycle and shared resources. Understanding its structure and functionality is crucial for developers looking to contribute to the Glucometer app, particularly in areas related to BLE communication, data management, and UI integration.","data-models":"# Data Models\n\n# Data Models Module\n\nThe **Data Models** module is responsible for managing glucose data within the Glucometer application. It encompasses the parsing of glucose readings from Bluetooth Low Energy (BLE) devices, the storage and retrieval of this data from HealthKit, and the communication of this data to the user interface and other components of the application.\n\n## Overview\n\nThe module consists of several key components that work together to handle glucose data:\n\n- **GlucoseData**: The central model that parses GATT packets and manages HealthKit interactions.\n- **GlucoseDataDelegate**: A protocol for delivering glucose data to UI components.\n- **LogEntry**: A discriminated union representing individual glucose readings or events.\n- **SavedDevice**: A model for managing paired BLE glucometers and their state.\n- **GlucoseWidgetData**: A structure for sharing glucose data with widget extensions.\n\n## Key Components\n\n### GlucoseData\n\nThe `GlucoseData` class is the core of the data model. It handles the following responsibilities:\n\n- **GATT Parsing**: It decodes raw GATT packets from BLE devices into structured data.\n- **HealthKit Persistence**: It writes glucose readings to HealthKit, either immediately or in batches.\n\n#### Key Methods\n\n- `processBatchRecords(_:)`: Processes an array of raw GATT tuples, writes them to HealthKit, and notifies the delegate.\n- `readHK()`: Loads recent glucose samples from HealthKit and constructs `LogEntry` values.\n- `addNewRecord(newRecord:)`: Parses a single GATT tuple and routes it to the appropriate output.\n\n### GlucoseDataDelegate\n\nThe `GlucoseDataDelegate` protocol defines methods for receiving glucose data updates. It is implemented by classes that need to display or process glucose readings, such as `GlucozyViewModel`.\n\n#### Methods\n\n- `loadHistoricalEntries(_:)`: Called with historical glucose readings from HealthKit.\n- `addGlucoseLogEntry(...)`: Called for each new glucose reading during a live BLE sync.\n- `didReceiveBatchEntries(_:)`: Called after a complete batch sync.\n\n### LogEntry\n\nThe `LogEntry` enum represents a single item in the glucose log. It can either be a glucose reading or a status message.\n\n#### Cases\n\n- `glucoseRecord`: Contains details about a glucose reading, including value, date, meal context, and device UUID.\n- `event`: Represents a status or diagnostic message.\n\n### SavedDevice\n\nThe `SavedDevice` struct models a paired BLE glucometer, storing its UUID, name, last sequence number, and last seen date. It is used in conjunction with the `DeviceStore` for persistent storage.\n\n#### Key Methods in DeviceStore\n\n- `loadAll()`: Loads all saved devices from UserDefaults.\n- `add(_:)`: Adds a new device to the store.\n- `updateSequenceNumber(for:to:)`: Updates the last sequence number for a device.\n\n### GlucoseWidgetData\n\nThe `GlucoseWidgetData` struct is used for sharing glucose data between the main app and widget extensions. It is encoded as JSON and stored in a shared App Group.\n\n#### Key Properties\n\n- `latestValue`: The most recent glucose reading.\n- `trend`: The rate of change in glucose levels.\n- `isInRange`: A computed property to check if the latest reading is within the target range.\n\n## Architecture Overview\n\nThe following diagram illustrates the relationships between the key components of the Data Models module:\n\n```mermaid\ngraph TD;\n A[GlucoseData] -->|notifies| B[GlucoseDataDelegate]\n A -->|writes to| C[HealthKit]\n A -->|produces| D[LogEntry]\n E[SavedDevice] -->|managed by| F[DeviceStore]\n G[GlucoseWidgetData] -->|shared with| H[Widget Extension]\n```\n\n## How It Connects to the Rest of the Codebase\n\nThe Data Models module interacts with several other parts of the Glucometer application:\n\n- **HealthKitManager**: Used by `GlucoseData` to persist glucose readings to HealthKit.\n- **BLE.swift**: Provides raw GATT data that `GlucoseData` parses.\n- **GlucozyViewModel**: Implements `GlucoseDataDelegate` to update the UI with glucose readings.\n- **UserDefaults**: Used by `DeviceStore` to persist device information.\n\n## Conclusion\n\nThe Data Models module is a critical part of the Glucometer application, providing the necessary infrastructure to handle glucose data from BLE devices, manage historical records, and communicate with the user interface and widget extensions. Understanding its components and their interactions is essential for contributing to the codebase and enhancing the application's functionality.","design-system":"# Design System\n\n# Design System Module\n\nThe **Design System** module provides a comprehensive set of semantic design tokens for the Glucometer application, facilitating consistent styling and theming across UIKit and SwiftUI components. This module encapsulates colors, typography, spacing, corner radii, and animations, ensuring a cohesive user interface that adheres to design principles.\n\n## Overview\n\nThe Design System is structured around five main components:\n- **Colors**: Defines a palette of colors used throughout the application.\n- **Typography**: Specifies font styles and sizes that scale with Dynamic Type.\n- **Spacing**: Provides a consistent spacing scale for layout.\n- **Corner Radii**: Standardizes corner radius values for UI elements.\n- **Animations**: Defines standard durations for various animations.\n\nThese components are organized into namespaced enums, allowing for easy access and modification without instantiating objects.\n\n## Key Components\n\n### 1. GlucozyColors\n\nThe `GlucozyColors` enum defines semantic color tokens that are dynamic-color-aware, adapting to light and dark modes. Key colors include:\n\n- `accent`: The primary accent color, falling back to system blue if not available.\n- `pageBackground`, `cardBackground`, `elevatedBackground`: Background colors for different UI layers.\n- `textPrimary`, `textSecondary`, `textTertiary`: Text colors for various levels of emphasis.\n- `urgentLow`, `low`, `inRange`, `high`, `veryHigh`: Colors representing glucose levels based on clinical classifications.\n\n### 2. GlucozyRange\n\nThe `GlucozyRange` enum classifies glucose levels into five categories based on ADA/ISPAD thresholds. It provides:\n\n- An initializer that accepts a raw mg/dL value and assigns the appropriate case.\n- Properties for `color`, `label`, `iconName`, and `accessibilityLabel` to facilitate UI representation.\n\n### 3. GlucozyTypography\n\nThe `GlucozyTypography` enum defines a set of font styles that scale with Dynamic Type. Key methods include:\n\n- `heroReading()`: For large hero text.\n- `unitLabel()`, `rangeStatus()`, `sectionHeader()`: For various UI components.\n- `scaledFont(...)`: A private method that creates fonts with optional rounded design and monospaced digits.\n\n### 4. GlucozySpacing\n\nThe `GlucozySpacing` enum provides a 6-step spacing scale, aligning with common grid conventions. Values include:\n\n- `xs`, `sm`, `md`, `lg`, `xl`, `xxl`: Standard spacing values in points.\n\n### 5. GlucozyRadius\n\nThe `GlucozyRadius` enum standardizes corner radius values for UI elements, ensuring a consistent look and feel. Key values include:\n\n- `card`, `innerElement`, `button`, `badge`, `pill`: Defined corner radii for various UI components.\n\n### 6. GlucozyAnimation\n\nThe `GlucozyAnimation` enum defines constants for animation durations, categorized as:\n\n- `micro`: For quick state changes.\n- `standard`: For layout transitions.\n- `chart`: For longer data transitions.\n\n### 7. GlucozyCardStyle\n\nThe `GlucozyCardStyle` enum provides a convenience method to apply a standard card appearance to UIKit views. The method `apply(to:)` sets the background color, corner radius, and clipping behavior.\n\n## Theme Integration\n\nThe `Theme` enum serves as a semantic re-export of design tokens, organized by component concern. This allows UIKit components to access design tokens in a more intuitive manner. For example:\n\n```swift\nlet glucoseColor = Theme.Glucose.inRange\n```\n\nThis abstraction simplifies updates to the underlying token mappings without affecting the components that rely on them.\n\n## Localization\n\nThe `Strings` module handles localization, providing a clear distinction between canonical keys (stored in HealthKit metadata) and display strings used in the UI. Functions like `localizedMealName`, `localizedSampleType`, and `localizedHealthStatus` convert canonical keys into localized display strings.\n\n## Architecture Diagram\n\n```mermaid\ngraph TD;\n A[GlucozyDesignSystem] -->|uses| B[GlucozyColors]\n A -->|uses| C[GlucozyRange]\n A -->|uses| D[GlucozyTypography]\n A -->|uses| E[GlucozySpacing]\n A -->|uses| F[GlucozyRadius]\n A -->|uses| G[GlucozyAnimation]\n A -->|applies| H[GlucozyCardStyle]\n A -->|re-exports| I[Theme]\n I -->|uses| B\n I -->|uses| C\n I -->|uses| D\n I -->|uses| E\n I -->|uses| F\n I -->|uses| G\n```\n\n## Conclusion\n\nThe Design System module is a foundational component of the Glucometer application, providing a structured approach to styling and theming. By utilizing semantic tokens, it ensures consistency and adaptability across the user interface, enhancing the overall user experience. Developers can easily extend or modify the design system as needed, promoting a scalable and maintainable codebase.","other-claude-md":"# Other — CLAUDE.md\n\n# CLAUDE.md Module Documentation\n\n## Overview\n\nThe **CLAUDE.md** module serves as a comprehensive guide for developers working with the Claude Code repository, specifically for the Glucometer project. It outlines versioning practices, release notes management, building and running instructions, architecture, and integration with TestFlight and Fastlane for continuous deployment.\n\n## Purpose\n\nThe primary purpose of this module is to provide clear and structured guidance on how to manage the codebase effectively, ensuring that developers can contribute to the project with a consistent understanding of its operational and architectural standards.\n\n## Versioning\n\nThe project follows **Semantic Versioning (semver)**, formatted as `MAJOR.MINOR.PATCH`, starting from `0.0.1`. \n\n### Versioning Details\n\n- **MARKETING_VERSION**: The human-readable version string, located in `Glucometer.xcodeproj/project.pbxproj`. This must be updated across all eight build configurations (Debug + Release for four targets).\n- **CURRENT_PROJECT_VERSION**: The build number (integer) that must be incremented with every upload to App Store Connect, also set in all eight configurations.\n\n### Version Bumping Steps\n\n1. Update `MARKETING_VERSION` in `project.pbxproj` (use replace-all).\n2. Increment `CURRENT_PROJECT_VERSION` in `project.pbxproj` (use replace-all).\n3. Document changes in `CHANGELOG.md`.\n\n## Release Notes Management\n\nRelease notes are maintained in `CHANGELOG.md`, which serves as the source of truth for all version updates.\n\n### TestFlight Distribution Steps\n\n1. Copy relevant bullet points from `CHANGELOG.md`.\n2. Paste into the **\"What to Test\"** field in App Store Connect for TestFlight groups.\n3. For public releases, use the same content in the **\"What's New\"** field.\n\n## Building and Running the Project\n\nTo build and run the project, follow these steps:\n\n1. Open `Glucometer.xcodeproj` in Xcode.\n2. Ensure that the **HealthKit capability** is enabled in the Xcode target settings.\n3. For testing in **Test Mode**, set `TEST_MODE = true` in `ViewController.swift` to simulate glucose packet processing without Bluetooth.\n\n### Requirements\n\n- A **physical device** is required for Bluetooth Low Energy (BLE) operations.\n- The project uses only Apple frameworks (CoreBluetooth, HealthKit, UIKit).\n- Swift strict concurrency is enforced; all imports must use `internal import`.\n\n## Fastlane Integration\n\nThe project utilizes **fastlane** for TestFlight distribution, with configuration files located in `fastlane/Fastfile` and `fastlane/Appfile`.\n\n### Running Fastlane\n\nTo run fastlane, ensure it is installed via Homebrew Ruby and set the appropriate PATH:\n\n```bash\nexport PATH=\"/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/4.0.0/bin:$PATH\"\nexport GEM_HOME=\"/opt/homebrew/lib/ruby/gems/4.0.0\"\n```\n\n### Deploying to TestFlight\n\nTo deploy to TestFlight, execute:\n\n```bash\nfastlane beta\n```\n\nThis command performs the following actions:\n\n1. Bumps `CURRENT_PROJECT_VERSION` in `project.pbxproj`.\n2. Archives the `Glucometer` scheme.\n3. Extracts changelog notes from `CHANGELOG.md`.\n4. Uploads the IPA to TestFlight.\n5. Commits and pushes the build number bump.\n\n### Required Environment Variables\n\nBefore running the `beta` lane, set the following environment variables for App Store Connect API key authentication:\n\n```bash\nexport ASC_KEY_ID=\"<key ID from App Store Connect>\"\nexport ASC_ISSUER_ID=\"<issuer UUID from Users & Access → Integrations>\"\nexport ASC_KEY_FILEPATH=\"<path to .p8 file>\"\n```\n\n## Architecture\n\nThe Glucometer project follows the **Model-View-Controller (MVC)** design pattern, consisting of four main classes that facilitate data flow from the BLE device to HealthKit.\n\n### Key Components\n\n- **`BLE.swift`**: Manages CoreBluetooth interactions, scanning for peripherals, connecting, and handling notifications. It assembles raw data packets and communicates with the `ViewController` through delegate methods.\n \n- **`GlucoseRecord.swift`**: Contains the `GlucoseData` class, responsible for parsing raw GATT binary data and interacting with `HealthKitManager` to persist glucose records.\n\n- **`HealthKitManager.swift`**: Wraps `HKHealthStore` to manage read/write permissions and data storage for blood glucose samples.\n\n- **`ViewController.swift`**: Implements the `BLEProtocol`, handling user interactions and displaying data. It manages the sync process with HealthKit and updates the UI accordingly.\n\n- **`AppDelegate.swift`**: Initializes the `GlucoseData` instance and injects it into the `ViewController`.\n\n- **`SceneDelegate.swift`**: Provides a minimal scene-based lifecycle management for iOS 13 and later.\n\n### Data Flow Diagram\n\n```mermaid\ngraph TD;\n A[BLE] -->|Sends data| B[ViewController];\n B -->|Requests data| C[GlucoseData];\n C -->|Saves data| D[HealthKitManager];\n```\n\n## Key Implementation Notes\n\n- RACP commands are sent as `[UInt8]` via `BLE.doWrite`.\n- Glucose concentration is converted from kg/L to mg/dL for HealthKit.\n- Context flags determine how records are appended based on the presence of context packets.\n- The `tempDeviceID` in `BLE.swift` is a placeholder and not the actual UUID.\n- Sequence number synchronization occurs during the app's launch, ensuring the latest data is fetched.\n\n## Conclusion\n\nThe **CLAUDE.md** module provides essential guidelines for managing the Glucometer project, from versioning and release notes to architecture and deployment processes. By adhering to these practices, developers can ensure a consistent and efficient workflow while contributing to the codebase.","other-docs-superpowers":"# Other — docs-superpowers\n\n# Other — docs-superpowers Module Documentation\n\n## Purpose\n\nThe **docs-superpowers** module enhances the Watch app by replacing a static placeholder with a dynamic glucose display. This feature provides users with real-time glucose readings and a history of their last 10 readings, sourced directly from HealthKit. The implementation leverages SwiftUI for a modern, declarative UI approach.\n\n## Architecture Overview\n\nThe module consists of two primary components located in the `GlucometerWatch Watch App/` directory:\n\n1. **`GlucoseWatchViewModel.swift`**: A new `ObservableObject` that handles all HealthKit data fetching and prepares the data for the UI.\n2. **`ContentView.swift`**: A modified SwiftUI view that presents the glucose data using the ViewModel.\n\n```mermaid\ngraph TD;\n A[ContentView] -->|uses| B[GlucoseWatchViewModel]\n B -->|fetches| C[HealthKit]\n C -->|provides| D[WatchGlucoseEntry]\n```\n\n## Key Components\n\n### Data Model\n\nThe data model for the glucose readings is defined by the `WatchGlucoseEntry` struct:\n\n```swift\nstruct WatchGlucoseEntry {\n let value: Double // mg/dL\n let trend: String // \"↑↑\" \"↑\" \"→\" \"↓\" \"↓↓\"\n let timeAgo: String // \"now\" \"5m\" \"2h\"\n let isInRange: Bool // 70–180 mg/dL\n let mealContext: String // \"After Meal\", \"Fasting\", etc. — empty string if absent\n}\n```\n\n### ViewModel: `GlucoseWatchViewModel`\n\nThe `GlucoseWatchViewModel` is responsible for managing the state and data of the glucose display. It conforms to `ObservableObject` and exposes the following properties:\n\n- **`currentEntry: WatchGlucoseEntry?`**: Represents the latest glucose reading. It is `nil` while loading or if no data is available.\n- **`historyEntries: [WatchGlucoseEntry]`**: An array containing up to 10 recent glucose readings, with the most recent entry at index 0.\n- **`isLoading: Bool`**: Indicates whether data is currently being fetched.\n\n#### Fetch Logic\n\nThe ViewModel implements the following logic to fetch and prepare data:\n\n1. Queries HealthKit for 11 samples of blood glucose data, sorted by `endDate` in descending order.\n2. Sets `currentEntry` based on the most recent sample compared to the second most recent sample.\n3. Populates `historyEntries` with the first 10 samples, calculating the trend for each entry based on the difference from the next sample.\n4. Requests read-only authorization for `bloodGlucose` from HealthKit before performing queries.\n5. Provides a `reload()` method that is called when the view appears and when the app's scene transitions to active.\n\n#### In-Range Thresholds\n\nThe ViewModel defines in-range thresholds for glucose levels:\n- Low: 70 mg/dL\n- High: 180 mg/dL\n\nThese thresholds align with the complication used in the iPhone app.\n\n### View: `ContentView`\n\nThe `ContentView` is a SwiftUI view that displays the glucose data in a user-friendly format. It consists of:\n\n1. **Hero Section**: Displays the `currentEntry` with:\n - A large value label that is color-coded based on the glucose level.\n - A trend arrow indicating the direction of change.\n - A time-ago label showing how recent the reading is.\n\n2. **History List**: A scrollable list of the `historyEntries`, where each entry shows:\n - The glucose value and trend.\n - The time since the reading was taken.\n - The meal context, displayed in a caption style if available.\n\n3. **Pull-to-Refresh**: Implements a refreshable view that allows users to manually reload data.\n\n4. **Empty/Loading States**: Displays a spinner while loading and a message if no readings are available after loading.\n\n## HealthKit Entitlement\n\nThe Watch app's entitlements already include `com.apple.developer.healthkit`, so no additional changes are required for HealthKit access.\n\n## Out of Scope\n\nThe following features are not included in this module:\n\n- Triggering a Bluetooth Low Energy (BLE) sync from the Watch.\n- Continuous glucose monitoring (CGM) or background refresh capabilities.\n- User-configurable in-range thresholds.\n\n## Conclusion\n\nThe **docs-superpowers** module provides a robust solution for displaying glucose readings on the Watch app, enhancing user experience with real-time data and a clean, modern interface. Developers can extend this module by adding features or improving the data-fetching logic while maintaining the existing architecture.","other-fastlane":"# Other — fastlane\n\n# Other — fastlane Module Documentation\n\n## Overview\n\nThe **fastlane** module is designed to automate the process of building and distributing an iOS application to TestFlight. It leverages the Fastlane toolset to streamline the deployment pipeline, ensuring that the application is built, versioned, and uploaded efficiently.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate the continuous integration and delivery (CI/CD) of the iOS application \"Glucozy.\" It automates the following key tasks:\n- Building the application with the correct configuration.\n- Bumping the build number for versioning.\n- Extracting changelog notes for release documentation.\n- Uploading the built application to TestFlight for distribution.\n\n## Key Components\n\n### Fastfile\n\nThe `Fastfile` is the core configuration file for Fastlane, defining the automation lanes and their respective actions. The main lane defined in this module is `beta`, which handles the entire process of building and uploading the app.\n\n#### Lane: beta\n\n```ruby\nlane :beta do |options|\n # Key file path resolution\n key_filepath = File.expand_path(File.join(\"..\", ENV[\"ASC_KEY_FILEPATH\"]), __dir__)\n api_key = app_store_connect_api_key(\n key_id: ENV[\"ASC_KEY_ID\"],\n issuer_id: ENV[\"ASC_ISSUER_ID\"],\n key_filepath: key_filepath,\n in_house: false\n )\n\n new_build = bump_build_number\n notes = options[:notes] || changelog_notes\n\n auth_flags = \"-allowProvisioningUpdates \" \\\n \"-authenticationKeyPath '#{key_filepath}' \" \\\n \"-authenticationKeyID #{ENV[\"ASC_KEY_ID\"]} \" \\\n \"-authenticationKeyIssuerID #{ENV[\"ASC_ISSUER_ID\"]}\"\n\n gym(\n scheme: \"Glucometer\",\n project: \"Glucometer.xcodeproj\",\n configuration: \"Release\",\n export_method: \"app-store\",\n destination: \"generic/platform=iOS\",\n output_directory: \"build/\",\n output_name: \"Glucozy.ipa\",\n clean: true,\n xcargs: auth_flags,\n xcodebuild_formatter: \"xcbeautify\",\n export_options: {\n signingStyle: \"automatic\",\n teamID: \"5YRLS5Z638\"\n }\n )\n\n pilot(\n api_key: api_key,\n skip_waiting_for_build_processing: false,\n changelog: notes,\n distribute_external: false\n )\n\n version = get_version_number(xcodeproj: \"Glucometer.xcodeproj\", target: \"Glucometer\")\n git_commit(\n path: \"Glucometer.xcodeproj/project.pbxproj\",\n message: \"Release #{version} (#{new_build}) to TestFlight\"\n )\n push_to_git_remote\nend\n```\n\n### Helper Methods\n\n#### bump_build_number\n\nThis method reads the current build number from the Xcode project file, increments it, and writes the new value back to the file. It ensures that each build has a unique identifier.\n\n```ruby\ndef bump_build_number\n pbxproj = \"../Glucometer.xcodeproj/project.pbxproj\"\n content = File.read(pbxproj)\n\n current = content.match(/CURRENT_PROJECT_VERSION = (\\d+);/)&.captures&.first&.to_i\n UI.user_error!(\"Could not read CURRENT_PROJECT_VERSION from project.pbxproj\") unless current\n\n new_build = current + 1\n updated = content.gsub(/CURRENT_PROJECT_VERSION = #{current};/, \"CURRENT_PROJECT_VERSION = #{new_build};\")\n File.write(pbxproj, updated)\n\n UI.success(\"Build number bumped: #{current} → #{new_build}\")\n new_build\nend\n```\n\n#### changelog_notes\n\nThis method extracts the latest changelog notes from the `CHANGELOG.md` file, formatting them appropriately for TestFlight. It ensures that only valid characters are included.\n\n```ruby\ndef changelog_notes\n changelog = File.read(\"../CHANGELOG.md\")\n match = changelog.match(/## \\[.*?\\].*?\\n(.*?)^---/m)\n return \"See changelog for details.\" unless match\n\n match[1].strip\n .gsub(/[^\\u0000-\\u00FF]/, \"\")\n .gsub(/\\s{2,}/, \" \")\n .strip\nend\n```\n\n## Configuration\n\n### Appfile\n\nThe `Appfile` contains essential configuration details for the application, including the app identifier and team ID.\n\n```ruby\napp_identifier(\"hibbeler.dev.Glucozy\")\nteam_id(\"5YRLS5Z638\")\n```\n\n### Environment Variables\n\nThe following environment variables are required for the `beta` lane to function correctly:\n- `ASC_KEY_FILEPATH`: Path to the App Store Connect API key file.\n- `ASC_KEY_ID`: Key ID for the App Store Connect API.\n- `ASC_ISSUER_ID`: Issuer ID for the App Store Connect API.\n\n## Execution Flow\n\nThe execution flow for the `beta` lane can be visualized as follows:\n\n```mermaid\ngraph TD;\n A[Start beta lane] --> B[Resolve key file path];\n B --> C[Get API key];\n C --> D[Bump build number];\n D --> E[Get changelog notes];\n E --> F[Build app with gym];\n F --> G[Upload to TestFlight with pilot];\n G --> H[Get version number];\n H --> I[Commit changes to Git];\n I --> J[Push to Git remote];\n J --> K[End];\n```\n\n## Conclusion\n\nThe **fastlane** module provides a robust solution for automating the build and distribution process of the \"Glucozy\" iOS application. By utilizing Fastlane's capabilities, developers can ensure a streamlined workflow that minimizes manual intervention and reduces the risk of errors during deployment.","other-gemfile":"# Other — Gemfile\n\n# Other — Gemfile\n\n## Overview\n\nThe **Gemfile** is a crucial component in Ruby projects that utilize Bundler for dependency management. It specifies the external libraries (gems) that the project depends on, allowing for consistent and reproducible environments across different setups.\n\n## Purpose\n\nThe primary purpose of the Gemfile is to declare the gems required for the application to function correctly. By listing these dependencies, developers can ensure that the same versions of libraries are used in development, testing, and production environments.\n\n## Key Components\n\n### Source Declaration\n\n```ruby\nsource \"https://rubygems.org\"\n```\n\n- This line specifies the source from which the gems will be fetched. In this case, it points to the official RubyGems repository.\n\n### Gem Declaration\n\n```ruby\ngem \"fastlane\"\n```\n\n- This line declares a dependency on the `fastlane` gem, which is a tool for automating tasks related to app deployment and release management. By including this gem, the project can leverage its functionalities.\n\n## How It Works\n\n1. **Bundler Integration**: The Gemfile is used by Bundler, a Ruby gem that manages gem dependencies. When a developer runs `bundle install`, Bundler reads the Gemfile and installs the specified gems along with their dependencies.\n\n2. **Environment Consistency**: By using a Gemfile, developers can ensure that all team members and deployment environments use the same versions of gems. This is further enhanced by the creation of a `Gemfile.lock` file, which locks the versions of the installed gems.\n\n3. **Version Management**: While the current Gemfile does not specify versions for the `fastlane` gem, it is a best practice to define version constraints to avoid breaking changes in future releases. For example:\n ```ruby\n gem \"fastlane\", \"~> 2.0\"\n ```\n\n## Connection to the Codebase\n\nThe Gemfile serves as the entry point for managing dependencies in the project. It does not contain any executable code or logic but is essential for setting up the environment in which the application runs. \n\nWhen the application is executed, Bundler ensures that all required gems are loaded, allowing the rest of the codebase to utilize the functionalities provided by these libraries.\n\n## Best Practices\n\n- **Version Pinning**: Always specify version constraints for gems to prevent unexpected behavior due to updates.\n- **Regular Updates**: Periodically review and update the Gemfile to include newer versions of gems that may offer improvements or security fixes.\n- **Use `Gemfile.lock`**: Commit the `Gemfile.lock` file to version control to ensure that all environments use the same gem versions.\n\n## Conclusion\n\nThe Gemfile is a foundational element of Ruby applications that rely on external libraries. By clearly defining dependencies, it facilitates a smooth development process and helps maintain consistency across different environments. Proper management of the Gemfile and its associated gems is essential for the stability and reliability of the application.","other-glucometer-assets-xcassets":"# Other — Glucometer-Assets.xcassets\n\n# Glucometer-Assets.xcassets Module Documentation\n\n## Overview\n\nThe **Glucometer-Assets.xcassets** module is a collection of asset files used in the Glucometer application. This module primarily contains color definitions and app icons that are utilized throughout the application interface. The assets are defined in JSON format, which is compatible with Xcode's asset catalog system, allowing for easy management and integration of visual resources.\n\n## Purpose\n\nThe purpose of this module is to provide a centralized location for managing visual assets, including:\n\n- Accent colors used in the application UI.\n- App icons for different appearances and resolutions.\n\nBy organizing these assets in a structured manner, developers can ensure consistency in the application's look and feel while simplifying the process of updating visual elements.\n\n## Key Components\n\n### 1. Accent Colors\n\nLocated in `Glucometer/Assets.xcassets/AccentColor.colorset/Contents.json`, this component defines a set of colors that can be used throughout the application. Each color entry includes:\n\n- **Color Space**: Specifies the color space (e.g., `srgb`).\n- **Components**: Defines the RGBA values for the color.\n- **Idiom**: Indicates the target device type (e.g., `universal`).\n- **Appearances**: Optional property that allows for different color variations based on the appearance (e.g., `dark`, `high contrast`).\n\n#### Example Color Definitions\n\n```json\n{\n \"color\": {\n \"color-space\": \"srgb\",\n \"components\": {\n \"alpha\": \"1.000\",\n \"blue\": \"1.000\",\n \"green\": \"0.478\",\n \"red\": \"0.000\"\n }\n },\n \"idiom\": \"universal\"\n}\n```\n\n### 2. App Icons\n\nLocated in `Glucometer/Assets.xcassets/AppIcon.appiconset/Contents.json`, this component defines the app icons used for the Glucometer application. Each icon entry includes:\n\n- **Filename**: The name of the image file.\n- **Idiom**: Indicates the target device type (e.g., `universal`).\n- **Platform**: Specifies the platform (e.g., `ios`).\n- **Size**: The dimensions of the icon (e.g., `1024x1024`).\n- **Appearances**: Optional property that allows for different icon variations based on the appearance (e.g., `dark`, `tinted`).\n\n#### Example App Icon Definition\n\n```json\n{\n \"filename\": \"Glucozy-Icon.png\",\n \"idiom\": \"universal\",\n \"platform\": \"ios\",\n \"size\": \"1024x1024\"\n}\n```\n\n### 3. General Information\n\nThe `Contents.json` files in both the AccentColor and AppIcon directories include an `info` section that provides metadata about the asset set, such as the author and version.\n\n```json\n\"info\": {\n \"author\": \"xcode\",\n \"version\": 1\n}\n```\n\n## Integration with the Codebase\n\nThe assets defined in this module are referenced throughout the Glucometer application. Developers can access these assets using Xcode's asset catalog system, which allows for easy retrieval of colors and icons based on the current device appearance and settings.\n\n### Usage Example\n\nTo use an accent color in Swift, you can retrieve it as follows:\n\n```swift\nlet accentColor = UIColor(named: \"AccentColor\")\n```\n\nFor app icons, the system automatically selects the appropriate icon based on the device's appearance settings, ensuring that the correct icon is displayed without additional code.\n\n## Conclusion\n\nThe **Glucometer-Assets.xcassets** module plays a crucial role in maintaining the visual consistency of the Glucometer application. By organizing colors and icons in a structured manner, it simplifies asset management and enhances the overall user experience. Developers are encouraged to update this module as needed to reflect any changes in the application's design requirements.","other-glucometer-base-lproj":"# Other — Glucometer-Base.lproj\n\n# Glucometer-Base.lproj Module Documentation\n\n## Overview\n\nThe **Glucometer-Base.lproj** module is responsible for defining the launch screen of the Glucozy application. This module utilizes a storyboard file to create a visually appealing and user-friendly interface that is displayed when the app is launched. The launch screen is designed to provide users with an immediate visual context while the app is loading.\n\n## Purpose\n\nThe primary purpose of this module is to present a launch screen that enhances user experience by:\n\n- Providing a smooth transition into the app.\n- Displaying the app's branding through the logo and name.\n- Ensuring compatibility with various device sizes and orientations using Auto Layout.\n\n## Key Components\n\n### LaunchScreen.storyboard\n\nThe main component of this module is the `LaunchScreen.storyboard` file, which is structured in XML format. Below are the key elements defined within this storyboard:\n\n- **View Controller**: The root view controller (`viewController`) contains a single view that serves as the launch screen.\n- **Stack View**: A vertical stack view (`stk-01-234`) is used to arrange the subviews (image and label) in a centered layout.\n- **Image View**: Displays the app's logo (a drop icon) with a specified size and tint color.\n- **Label**: Shows the app name \"Glucozy\" in a large, thin font, centered below the logo.\n\n### Layout and Constraints\n\nThe layout is designed using Auto Layout, ensuring that the elements are properly positioned and sized across different devices. Key constraints include:\n\n- The stack view is centered both horizontally and vertically within the main view.\n- The image view has fixed width and height constraints to maintain its size.\n\n### Resources\n\nThe storyboard references a system image named `drop.fill`, which is used as the logo for the application. This image is defined in the resources section of the storyboard.\n\n## How It Works\n\nWhen the Glucozy application is launched, the iOS system automatically displays the launch screen defined in this module. The storyboard is processed by the Interface Builder, which renders the UI elements according to the defined constraints and properties. \n\nThe launch screen remains visible until the app is fully loaded and ready to present its main interface. This approach helps to create a seamless user experience by minimizing perceived loading times.\n\n## Integration with the Codebase\n\nThe **Glucometer-Base.lproj** module is integrated into the overall Glucozy application as the initial user interface presented to users. It does not contain any outgoing or incoming calls to other modules, as it solely serves the purpose of displaying the launch screen.\n\n### Execution Flow\n\nThere are no specific execution flows or internal calls associated with this module, as it is purely a UI component that is displayed during the app's startup phase.\n\n## Conclusion\n\nThe **Glucometer-Base.lproj** module plays a crucial role in establishing the first impression of the Glucozy application. By utilizing a well-structured storyboard with Auto Layout, it ensures that the launch screen is visually appealing and functional across various devices. Developers contributing to this module should focus on maintaining the design consistency and ensuring that any updates to the app's branding are reflected in the launch screen.","other-glucometer-de-lproj":"# Other — Glucometer-de.lproj\n\n# Glucometer-de.lproj Module Documentation\n\n## Overview\n\nThe **Glucometer-de.lproj** module is responsible for providing localized strings and configuration settings for the German language version of the Glucozy application. This module includes user interface text, alerts, action labels, and health-related messages that are displayed to users in German. It plays a crucial role in ensuring that the application is accessible and user-friendly for German-speaking users.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate the localization of the Glucozy app for German-speaking users. It contains all necessary strings that the app uses to communicate with users, including:\n\n- Descriptions for health data usage\n- Action labels for user interactions\n- Status messages for device connectivity\n- Alerts and hints for user guidance\n- Meal markers and health context descriptions\n\n## Key Components\n\n### 1. InfoPlist.strings\n\nThis file contains key-value pairs that describe the app's usage of health data and Bluetooth functionality. The strings are used to inform users about the permissions required by the app.\n\n- **NSHealthUpdateUsageDescription**: Describes the app's ability to write blood sugar measurements to Apple Health.\n- **NSHealthShareUsageDescription**: Describes the app's ability to read blood sugar history from Apple Health.\n- **NSBluetoothWhileInUseUsageDescription**: Explains that Bluetooth is used to connect to the glucometer while the app is in use.\n- **NSBluetoothAlwaysUsageDescription**: Indicates that Bluetooth may be used in the background to maintain a connection with the glucometer.\n\n### 2. Localizable.strings\n\nThis file contains a comprehensive set of localized strings that are used throughout the app. The strings are organized into categories for better readability and maintenance.\n\n#### App Titles and Units\n- **\"title.app\"**: The app's name, \"Glucozy\".\n- **\"unit.mgdl\"**: Unit of measurement for blood sugar in mg/dl.\n\n#### Actions\n- **\"action.sync\"**: Label for the sync action.\n- **\"action.cancel\"**: Label for the cancel action.\n- **\"action.save\"**: Label for the save action.\n\n#### Status Messages\n- **\"status.ready\"**: Indicates that the glucometer is ready for use.\n- **\"status.scanning\"**: Indicates that the app is searching for the glucometer.\n\n#### Alerts\n- **\"alert.targetRange.title\"**: Title for the target range alert.\n- **\"alert.note.title\"**: Title for the note alert.\n\n#### Insights and Statistics\n- **\"insights.avg.info\"**: Information about average blood sugar levels.\n- **\"insights.tir.info\"**: Information about time in range for blood sugar levels.\n\n### 3. Meal Markers and Health Context\n\nThe module includes predefined meal markers and health context descriptions that help users categorize their blood sugar measurements:\n\n- **Meal Markers**: \n - \"meal.before\": Before meal\n - \"meal.after\": After meal\n - \"meal.fasting\": Fasting\n\n- **Health Context**:\n - \"health.minor\": Minor discomfort\n - \"health.major\": Major discomfort\n\n### 4. Insights and Statistics\n\nThe module provides localized strings for insights and statistics related to blood sugar measurements, including average levels, time in range, and variability metrics.\n\n## Integration with the Codebase\n\nThe **Glucometer-de.lproj** module is integrated into the Glucozy application through the localization framework provided by iOS. The app dynamically loads the appropriate strings based on the user's language settings. This ensures that all user-facing text is displayed in German when the app is set to that language.\n\n### Example Usage\n\nWhen a user interacts with the app, the localized strings are fetched and displayed. For instance, when the user initiates a sync action, the app will display the \"action.sync\" string, which is \"Sync\" in German.\n\n## Conclusion\n\nThe **Glucometer-de.lproj** module is essential for providing a localized experience for German-speaking users of the Glucozy app. By managing all user-facing strings and health-related messages, it ensures that users can effectively interact with the app and understand their blood sugar data. This module is a key component of the overall user experience and plays a vital role in the app's functionality.","other-glucometer-en-lproj":"# Other — Glucometer-en.lproj\n\n# Glucometer-en.lproj Module Documentation\n\n## Overview\n\nThe **Glucometer-en.lproj** module is responsible for providing localized strings and configuration settings for the Glucozy application, which is designed to manage blood glucose readings. This module includes user interface text, alerts, action labels, and health-related descriptions that are displayed to the user in English. It plays a crucial role in ensuring that the application is user-friendly and accessible to English-speaking users.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate localization by providing a set of strings that can be used throughout the Glucozy application. This includes:\n\n- Descriptions for health permissions and Bluetooth usage.\n- User interface labels for actions, filters, and statistics.\n- Alerts and onboarding messages to guide users through the application.\n- Contextual information related to health and meal markers.\n\n## Key Components\n\n### 1. InfoPlist.strings\n\nThis file contains key-value pairs that describe the app's usage of health and Bluetooth features. The strings are used to inform users why the app requires certain permissions.\n\n#### Key Entries:\n- `NSHealthUpdateUsageDescription`: Describes the app's ability to write blood glucose readings to Apple Health.\n- `NSHealthShareUsageDescription`: Describes the app's ability to read blood glucose history from Apple Health.\n- `NSBluetoothWhileInUseUsageDescription`: Explains the need for Bluetooth access while the app is in use.\n- `NSBluetoothAlwaysUsageDescription`: Explains the need for Bluetooth access in the background.\n\n### 2. Localizable.strings\n\nThis file contains a comprehensive set of localized strings used throughout the application. It is organized into several sections for clarity.\n\n#### Sections:\n\n- **App**: General app titles and unit formats.\n- **Actions**: Labels for user actions such as syncing, saving, and managing devices.\n- **Filter / Stats**: Labels for filtering data and displaying statistics.\n- **Meal Markers**: Descriptions for different meal contexts.\n- **Health Context**: Labels for health-related issues.\n- **Sample Types**: Types of glucose samples.\n- **Status Bar**: Status messages for various app states.\n- **Event Log**: Messages logged during events like syncing and connection attempts.\n- **Alerts**: Titles and messages for user alerts.\n- **Scanner**: Messages related to scanning for glucometers.\n- **Navigation**: Labels for navigation elements.\n- **Onboarding**: Messages displayed during the onboarding process.\n- **Settings**: Configuration options and privacy statements.\n- **Insights Card**: Labels for displaying insights and statistics.\n\n### 3. User Interface Integration\n\nThe strings defined in this module are integrated into the user interface of the Glucozy application. They are referenced in the codebase wherever user-facing text is required, ensuring that the application is fully localized for English-speaking users.\n\n### 4. Example Usage\n\nHere are a few examples of how strings from the **Localizable.strings** file might be used in the application:\n\n```swift\nlet appTitle = NSLocalizedString(\"title.app\", comment: \"App title\")\nlet syncAction = NSLocalizedString(\"action.sync\", comment: \"Sync action label\")\nlet alertMessage = String(format: NSLocalizedString(\"alert.forget\", comment: \"Forget device alert\"), deviceName)\n```\n\n## Connection to the Codebase\n\nThe **Glucometer-en.lproj** module connects to the rest of the Glucozy codebase primarily through the use of localized strings. These strings are called in various parts of the application, including:\n\n- View controllers for displaying user interface elements.\n- Alert controllers for presenting messages to the user.\n- Onboarding flows to guide new users through the app setup.\n\nBy centralizing all localized strings in this module, the application maintains a clean and organized structure, making it easier to manage translations and updates in the future.\n\n## Conclusion\n\nThe **Glucometer-en.lproj** module is a vital component of the Glucozy application, providing essential localization support for English-speaking users. By organizing strings into logical sections and ensuring they are easily accessible throughout the codebase, this module enhances the user experience and facilitates the management of blood glucose readings.","other-glucometer-fr-lproj":"# Other — Glucometer-fr.lproj\n\n# Glucometer-fr.lproj Module Documentation\n\n## Overview\n\nThe **Glucometer-fr.lproj** module is responsible for providing localized strings and configuration settings for the French version of the Glucozy application. This module includes user interface text, alerts, action labels, and health-related messages that are displayed to users in French. It ensures that the application is accessible and user-friendly for French-speaking users.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate the localization of the Glucozy app for French-speaking users. It contains all necessary strings that the app uses to communicate with users, including descriptions, action buttons, alerts, and health statistics. By centralizing these strings, the module allows for easier updates and maintenance of the app's localization.\n\n## Key Components\n\n### 1. InfoPlist.strings\n\nThis file contains key-value pairs that provide descriptions for various permissions required by the app. These descriptions are displayed to users when the app requests access to certain features, such as HealthKit and Bluetooth.\n\n- **NSHealthUpdateUsageDescription**: Describes the app's need to record blood glucose measurements in Apple Health.\n- **NSHealthShareUsageDescription**: Explains the app's ability to read historical blood glucose data from Apple Health.\n- **NSBluetoothWhileInUseUsageDescription**: Indicates that the app uses Bluetooth to connect to the glucometer while in use.\n- **NSBluetoothAlwaysUsageDescription**: States that the app can use Bluetooth to connect to the glucometer in the background.\n\n### 2. Localizable.strings\n\nThis file contains the bulk of the user-facing strings used throughout the app. It is organized into several categories for clarity:\n\n#### App\n\n- **title.app**: The title of the application.\n- **unit.mgdl**: Unit of measurement for blood glucose in mg/dL.\n\n#### Actions\n\nStrings for user actions, such as:\n- **action.sync**: \"Sync\"\n- **action.cancel**: \"Annuler\"\n- **action.save**: \"Enregistrer\"\n\n#### Filter / Stats\n\nStrings related to filtering data and displaying statistics:\n- **filter.7days**: \"7j\"\n- **stats.avg**: \"Moy\"\n\n#### Meal Markers\n\nDefines meal markers for blood glucose readings:\n- **meal.before**: \"Avant le repas\"\n- **meal.after**: \"Après le repas\"\n\n#### Health Context\n\nStrings that describe health contexts:\n- **health.minor**: \"Problèmes de santé mineurs\"\n- **health.major**: \"Problèmes de santé majeurs\"\n\n#### Alerts\n\nStrings for alert messages:\n- **alert.targetRange.title**: \"Plage cible\"\n- **alert.note.title**: \"Note\"\n\n#### Insights Card\n\nStrings for insights and statistics:\n- **insights.statistics**: \"Statistiques\"\n- **insights.avg.info**: \"Glycémie moyenne pour toutes les mesures de cette période.\"\n\n### 3. Navigation and Hints\n\nStrings that assist with navigation and provide hints to users:\n- **nav.devices**: \"Appareils\"\n- **hint.swipe**: \"← note · repas →\"\n\n### 4. Onboarding\n\nStrings used during the onboarding process to guide users:\n- **onboarding.welcome.title**: \"Bienvenue sur Glucozy\"\n- **onboarding.bluetooth.body**: \"Glucozy utilise le Bluetooth pour synchroniser sans fil les mesures de votre glucomètre.\"\n\n### 5. Settings\n\nStrings related to app settings:\n- **settings.version**: \"Version\"\n- **settings.privacy.tagline**: \"Aucune donnée collectée. Jamais.\"\n\n## Integration with the Codebase\n\nThe **Glucometer-fr.lproj** module integrates seamlessly with the rest of the Glucozy application. The localized strings are accessed throughout the app using the standard localization methods provided by iOS. For example, when a button is created, the title can be set using:\n\n```swift\nlet syncButton = UIButton()\nsyncButton.setTitle(NSLocalizedString(\"action.sync\", comment: \"\"), for: .normal)\n```\n\nThis ensures that the correct localized string is displayed based on the user's language settings.\n\n## Conclusion\n\nThe **Glucometer-fr.lproj** module is a crucial part of the Glucozy application, enabling French localization and enhancing user experience for French-speaking users. By organizing strings into logical categories and providing clear descriptions for permissions, this module supports the app's functionality and accessibility. \n\nNo execution flows or internal calls are detected within this module, as it primarily serves as a resource for localization.","other-glucometer-xcodeproj-project-xcworkspace":"# Other — Glucometer.xcodeproj-project.xcworkspace\n\n# Glucometer.xcodeproj-project.xcworkspace Module Documentation\n\n## Overview\n\nThe **Glucometer.xcodeproj-project.xcworkspace** module serves as the workspace configuration for the Glucometer project in Xcode. It is a container that organizes multiple Xcode projects and their associated files, allowing developers to manage and build the project efficiently. This workspace does not contain any executable code or logic but serves as a structural element within the Xcode environment.\n\n## Purpose\n\nThe primary purpose of the workspace is to facilitate the development process by grouping related projects and resources. This is particularly useful in larger applications where multiple components may need to interact or share resources. The workspace allows developers to work on different parts of the application simultaneously while maintaining a coherent structure.\n\n## Key Components\n\n### Workspace Structure\n\nThe workspace is defined in the `contents.xcworkspacedata` file, which is an XML representation of the workspace's contents. The current structure is minimal, as shown below:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:\">\n <\/FileRef>\n<\/Workspace>\n```\n\n- **Workspace Element**: The root element that defines the workspace version.\n- **FileRef Element**: A reference to the workspace itself, indicating that it contains no additional projects or files at this time.\n\n### Integration with Other Projects\n\nWhile this workspace does not currently reference any additional projects or files, it is designed to be extensible. Developers can add other Xcode projects to the workspace as needed, allowing for a modular approach to application development.\n\n## How It Works\n\nThe workspace operates within the Xcode IDE, providing a visual and organizational structure for developers. When opened in Xcode, it allows developers to:\n\n- Navigate between different projects.\n- Manage dependencies and shared resources.\n- Build and run the application as a cohesive unit.\n\n## Future Considerations\n\nAs the Glucometer project evolves, it may be beneficial to expand the workspace to include additional projects or libraries. This could involve:\n\n- Adding new Xcode projects that represent different modules of the application.\n- Including third-party libraries or frameworks that the application depends on.\n- Organizing resources such as assets, configurations, and documentation within the workspace.\n\n## Conclusion\n\nThe **Glucometer.xcodeproj-project.xcworkspace** module is a foundational element of the Glucometer application, providing a structured environment for development. While it currently has a simple configuration, it is designed to grow and adapt as the project requirements change. Developers should consider how best to utilize this workspace to enhance collaboration and streamline the development process.","other-glucometer-xcodeproj-xcshareddata":"# Other — Glucometer.xcodeproj-xcshareddata\n\n# Glucometer.xcodeproj-xcshareddata Module Documentation\n\n## Overview\n\nThe **Glucometer.xcodeproj-xcshareddata** module contains shared scheme configurations for the Glucometer application and its associated extensions. This module is essential for defining how the application and its components are built, tested, and launched within Xcode. It includes configurations for the main app, a widget extension, and a watch app, ensuring that all components can be developed and tested in a cohesive manner.\n\n## Purpose\n\nThe primary purpose of this module is to manage the build and execution settings for the Glucometer app and its extensions. It allows developers to specify how the application should be built for different configurations (Debug, Release) and how it should behave during testing and profiling.\n\n## Key Components\n\n### Schemes\n\nThe module contains two main scheme files:\n\n1. **Glucometer.xcscheme**\n2. **GlucometerWidgetExtension.xcscheme**\n\nEach scheme defines various actions that dictate the build and execution process for the respective targets.\n\n#### Glucometer.xcscheme\n\n- **BuildAction**: Specifies how the main app and its extensions are built. It includes entries for:\n - `Glucometer.app`\n - `GlucometerWidgetExtension.appex`\n - `GlucometerWatch Watch App.app`\n - `GlucometerWatchComplicationExtension.appex`\n \n Each entry allows for testing, running, profiling, archiving, and analyzing.\n\n- **TestAction**: Configured to use the Debug build configuration and automatically create test plans.\n\n- **LaunchAction**: Defines how the app is launched in Release mode, including settings for debugging and environment variables.\n\n- **ProfileAction**: Similar to LaunchAction but specifically for profiling the app.\n\n- **AnalyzeAction**: Configured for the Debug build to analyze the code for potential issues.\n\n- **ArchiveAction**: Specifies settings for archiving the app in Release mode.\n\n#### GlucometerWidgetExtension.xcscheme\n\n- **BuildAction**: Similar to the main scheme but focused on the widget extension and includes references to both the widget and the main app.\n\n- **TestAction**: Configured for testing the widget in Debug mode.\n\n- **LaunchAction**: Specifies how the widget extension is launched, including environment variables specific to widget behavior.\n\n- **ProfileAction**: Configured for profiling the widget extension.\n\n- **AnalyzeAction**: Set for analyzing the widget extension in Debug mode.\n\n- **ArchiveAction**: Specifies settings for archiving the widget extension.\n\n### Buildable References\n\nEach scheme contains multiple `BuildableReference` entries that link to the specific targets within the Glucometer project. These references are crucial for ensuring that the correct components are built and executed during the development process.\n\n## Execution Flow\n\nThere are no explicit execution flows or internal calls defined within this module, as it primarily serves as a configuration layer for Xcode. The schemes dictate how the application and its extensions are built and run, but they do not contain executable code themselves.\n\n## Architecture Diagram\n\n```mermaid\ngraph TD;\n A[Glucometer.xcscheme] -->|Builds| B[Glucometer.app]\n A -->|Builds| C[GlucometerWidgetExtension.appex]\n A -->|Builds| D[GlucometerWatch Watch App.app]\n A -->|Builds| E[GlucometerWatchComplicationExtension.appex]\n F[GlucometerWidgetExtension.xcscheme] -->|Builds| C\n F -->|Builds| B\n```\n\n## Integration with the Codebase\n\nThe schemes defined in this module are integrated into the overall Glucometer project, allowing developers to build and test the application and its extensions seamlessly. When a developer selects a scheme in Xcode, the corresponding build and execution settings are applied, ensuring that the correct targets are built with the appropriate configurations.\n\n## Conclusion\n\nThe **Glucometer.xcodeproj-xcshareddata** module is a critical component of the Glucometer application, providing the necessary configurations for building, testing, and launching the app and its extensions. Understanding this module is essential for developers looking to contribute to the Glucometer project, as it lays the groundwork for the development workflow within Xcode.","other-glucometer-xcodeproj":"# Other — Glucometer.xcodeproj\n\n# Glucometer Module Documentation\n\n## Overview\n\nThe **Glucometer** module is an iOS application project designed to interface with glucose monitoring devices. It includes a main application, a watchOS app, and extensions for widgets and complications. The module leverages several frameworks, including SwiftUI, WidgetKit, and HealthKit, to provide a seamless user experience for tracking and managing blood glucose levels.\n\n## Key Components\n\n### 1. Project Structure\n\nThe project is organized into several key targets:\n\n- **Glucometer**: The main iOS application.\n- **GlucometerWidgetExtension**: An app extension for displaying glucose data in a widget.\n- **GlucometerWatch**: A watchOS application for monitoring glucose levels on Apple Watch.\n- **GlucometerWatchComplicationExtension**: An extension for complications on the Apple Watch face.\n\n### 2. Frameworks\n\nThe project utilizes the following frameworks:\n\n- **SwiftUI**: For building the user interface of the iOS app and watchOS app.\n- **WidgetKit**: For creating widgets that display glucose data on the home screen.\n- **HealthKit**: For reading and writing health-related data, specifically glucose readings.\n- **WatchConnectivity**: For communication between the iOS app and the watchOS app.\n\n### 3. Build Phases\n\nThe project includes several build phases to manage the compilation and packaging of the application:\n\n- **Embed Foundation Extensions**: This phase embeds the widget and complication extensions into the main application.\n- **Embed Watch Content**: This phase embeds the watchOS app into the main application.\n- **Frameworks**: This phase links the necessary frameworks required by the application.\n\n### 4. Build Configurations\n\nThe project supports multiple build configurations, including Debug and Release, for each target. Each configuration specifies settings such as code signing entitlements, deployment targets, and build settings.\n\n## Architecture\n\nThe architecture of the Glucometer module can be visualized as follows:\n\n```mermaid\ngraph TD;\n A[Glucometer] -->|Uses| B[SwiftUI]\n A -->|Uses| C[HealthKit]\n A -->|Uses| D[WidgetKit]\n A -->|Uses| E[WatchConnectivity]\n A -->|Contains| F[GlucometerWidgetExtension]\n A -->|Contains| G[GlucometerWatch]\n A -->|Contains| H[GlucometerWatchComplicationExtension]\n```\n\n## How It Works\n\n1. **User Interface**: The main application uses SwiftUI to create a responsive user interface that allows users to view and manage their glucose data. The watchOS app provides a similar interface optimized for the smaller screen.\n\n2. **Data Management**: The application interacts with HealthKit to read and write glucose data. Users can view their glucose history and log new readings directly from the app.\n\n3. **Widgets and Complications**: The widget extension displays real-time glucose data on the home screen, while the complication extension provides quick access to glucose information directly from the watch face.\n\n4. **Communication**: The watchOS app communicates with the iOS app using WatchConnectivity, allowing for data synchronization and updates.\n\n## Integration with the Codebase\n\nThe Glucometer module is designed to integrate seamlessly with other modules in the codebase. It relies on shared frameworks and services for data management and user interface components. Developers can extend functionality by adding new features to the existing targets or creating new extensions as needed.\n\n### Contribution Guidelines\n\nTo contribute to the Glucometer module:\n\n1. **Clone the Repository**: Start by cloning the repository to your local machine.\n2. **Create a Branch**: Create a new branch for your feature or bug fix.\n3. **Implement Changes**: Make your changes, ensuring to follow the existing coding standards and practices.\n4. **Test Your Changes**: Run the application and ensure that your changes do not introduce any issues.\n5. **Submit a Pull Request**: Once your changes are complete, submit a pull request for review.\n\n## Conclusion\n\nThe Glucometer module is a comprehensive solution for managing glucose monitoring on iOS and watchOS devices. With its modular architecture and integration with key frameworks, it provides a robust platform for developers to build upon and enhance the user experience.","other-glucometer":"# Other — Glucometer\n\n# Glucometer Module Documentation\n\n## Overview\n\nThe Glucometer module is designed to facilitate the retrieval of blood glucose measurements from Bluetooth-enabled glucometers and store this data in Apple HealthKit. It leverages CoreBluetooth for communication with the glucometer and HealthKit for data storage, enabling users to integrate glucose readings with other health metrics.\n\n## Purpose\n\nThe primary goal of the Glucometer module is to provide a seamless experience for users to monitor their blood glucose levels by:\n- Connecting to a Bluetooth-enabled glucometer.\n- Retrieving glucose measurements and associated context data.\n- Writing this data to HealthKit for further analysis and integration with other health applications.\n\n## Architecture\n\nThe Glucometer module follows the Model-View-ViewModel (MVVM) architecture, integrating UIKit and SwiftUI components. The data flow is primarily driven by Bluetooth interactions and HealthKit operations.\n\n```mermaid\ngraph TD;\n A[BLE Glucometer] -->|Connects| B[BLE.swift]\n B --> C[GlucozyViewModel]\n C --> D[GlucoseData.processBatchRecords]\n D --> E[HealthKitManager.batchWriteRecords]\n D --> F[GlucoseDataDelegate.didReceiveBatchEntries]\n F --> C\n C -->|Updates| G[SwiftUI Views]\n```\n\n## Key Components\n\n### 1. BLE.swift (Services/BLE)\n\n- **Functionality**: Manages Bluetooth Low Energy (BLE) interactions with the glucometer.\n- **Key Methods**:\n - `scanForPeripherals()`: Initiates scanning for BLE devices.\n - `connect(to peripheral: CBPeripheral)`: Connects to the specified glucometer.\n - `doWrite(data: [UInt8])`: Sends commands to the glucometer, such as RACP commands for data retrieval.\n\n### 2. GlucozyViewModel (ViewModel/GlucozyViewModel)\n\n- **Functionality**: Acts as the central data manager, conforming to `@MainActor ObservableObject`.\n- **Key Responsibilities**:\n - Implements `BLEProtocol` to handle BLE events.\n - Implements `GlucoseDataDelegate` to process incoming glucose data.\n - Triggers background sync operations via `SyncTriggerable`.\n\n### 3. GlucoseData (Model/GlucoseRecord)\n\n- **Functionality**: Represents the glucose measurement data and manages the processing pipeline.\n- **Key Methods**:\n - `processBatchRecords(_:deviceUUID:)`: Parses raw GATT data, writes to HealthKit, and updates the sequence number.\n - `recompute()`: Updates published properties for SwiftUI views.\n\n### 4. HealthKitManager (Services/HealthKitManager)\n\n- **Functionality**: Interfaces with HealthKit to manage reading and writing of glucose records.\n- **Key Methods**:\n - `batchWriteRecords(records: [GlucoseRecord])`: Writes a batch of glucose records to HealthKit, ensuring deduplication and correct timezone handling.\n\n### 5. BackgroundSyncManager (Services/BackgroundSyncManager)\n\n- **Functionality**: Manages background synchronization of glucose data.\n- **Key Responsibilities**:\n - Polls for new data every 3 minutes after establishing a BLE connection.\n - Directly calls `GlucoseData.processBatchRecords` during headless state restoration.\n\n## Building and Running\n\n1. Open `Glucometer.xcodeproj` in Xcode.\n2. Ensure the following:\n - A physical device is used for BLE operations (the simulator does not support Bluetooth).\n - HealthKit capability is enabled in the Xcode target.\n3. For testing in the simulator, invoke `vm.loadTestData()` in `SceneDelegate` to simulate glucose readings.\n\n## File Structure\n\nThe module is organized into several directories, each serving a specific purpose:\n\n```\nGlucometer/\n├── App/ # App lifecycle management\n├── Views/ # SwiftUI views\n├── UIKit/ # UIKit components\n├── ViewModel/ # ViewModel classes\n├── Model/ # Data models\n├── Services/ # Core services (BLE, HealthKit, etc.)\n└── Utilities/ # Helper functions and utilities\n```\n\n## Key Implementation Notes\n\n- **RACP Commands**: Commands are sent as `[UInt8]` arrays. Examples include:\n - `[1,1]`: Read all records.\n - `[1,6]`: Read the last record.\n- **Glucose Unit Conversion**: GATT sends glucose levels in kg/L; the module converts these to mg/dL by multiplying by 100,000.\n- **Context Flag Handling**: The module checks the context flag in the measurement byte to determine if additional context data is required.\n- **App Group**: The app uses the group identifier `group.com.glucozy.shared` to share data with the widget extension.\n\n## Conclusion\n\nThe Glucometer module provides a robust framework for integrating Bluetooth-enabled glucometers with HealthKit, enabling users to track their glucose levels effectively. By adhering to the MVVM architecture and utilizing Apple frameworks, the module ensures a clean separation of concerns and maintainability. Developers can extend and enhance the functionality as needed, leveraging the existing structure and components.","other-glucometerwatch-watch-app-assets-xcassets":"# Other — GlucometerWatch Watch App-Assets.xcassets\n\n# GlucometerWatch Watch App - Assets Module Documentation\n\n## Overview\n\nThe **Assets Module** of the GlucometerWatch Watch App is responsible for managing the visual assets used throughout the application. This includes color definitions and the app icon, which are essential for maintaining a consistent look and feel across the user interface.\n\n## Purpose\n\nThe primary purpose of this module is to define and store the color palette and app icon for the GlucometerWatch Watch App. By centralizing these assets, the module ensures that any changes to the visual design can be easily managed and propagated throughout the application.\n\n## Key Components\n\n### 1. Accent Colors\n\nThe `AccentColor.colorset` defines a set of colors that are used for various UI elements in the app. The colors are specified in the `Contents.json` file and include different appearances based on luminosity and contrast. \n\n#### Color Definitions\n\n- **Color 1**: \n - RGB: (0.0, 0.478, 1.0)\n - Alpha: 1.0\n - Idiom: Universal\n\n- **Color 2** (Dark Appearance):\n - RGB: (0.039, 0.518, 1.0)\n - Alpha: 1.0\n - Idiom: Universal\n\n- **Color 3** (High Contrast):\n - RGB: (0.0, 0.251, 0.867)\n - Alpha: 1.0\n - Idiom: Universal\n\n- **Color 4** (Dark + High Contrast):\n - RGB: (0.251, 0.612, 1.0)\n - Alpha: 1.0\n - Idiom: Universal\n\n### 2. App Icon\n\nThe `AppIcon.appiconset` contains the app icon used for the GlucometerWatch Watch App. The icon is defined in the `Contents.json` file and is specified for the watchOS platform.\n\n#### Icon Definition\n\n- **Filename**: Glucozy-Icon.png\n- **Size**: 1024x1024\n- **Idiom**: Universal\n- **Platform**: watchOS\n\n### 3. General Information\n\nThe `Contents.json` file at the root of the Assets.xcassets directory provides general information about the asset catalog, including the author and version.\n\n## How It Works\n\nThe Assets Module does not contain any executable code or logic; instead, it serves as a resource for the rest of the application. The defined colors and app icon are referenced throughout the UI components of the GlucometerWatch Watch App, ensuring a cohesive design.\n\n### Integration with the Codebase\n\n- **Color Usage**: The defined colors can be accessed in the UI components using the appropriate color references. For example, a button might use the primary accent color for its background.\n \n- **App Icon**: The app icon is automatically used by the watchOS system when the app is installed on a device, ensuring that the branding is consistent with the design specifications.\n\n## Conclusion\n\nThe Assets Module is a crucial part of the GlucometerWatch Watch App, providing the necessary visual elements that contribute to the overall user experience. By managing colors and icons in a centralized manner, the module simplifies the process of maintaining and updating the app's visual identity. \n\nThis module is designed to be easily extendable, allowing developers to add new colors or update the app icon as needed without affecting the overall architecture of the application.","other-glucometerwatch-watch-app-de-lproj":"# Other — GlucometerWatch Watch App-de.lproj\n\n# GlucometerWatch Watch App - Localization Module\n\n## Overview\n\nThe **GlucometerWatch Watch App-de.lproj** module is responsible for providing localized strings for the German language version of the Glucometer Watch app. This module enhances user experience by ensuring that all user-facing text is appropriately translated and formatted for German-speaking users.\n\n## Purpose\n\nThe primary purpose of this module is to store and manage localized strings that are displayed in the Glucometer Watch app. By using a dedicated localization file, the app can easily switch between different languages, allowing for broader accessibility and usability.\n\n## Key Components\n\n### Localizable.strings\n\nThe core component of this module is the `Localizable.strings` file, which contains key-value pairs for all the strings used in the app's user interface. Each key corresponds to a specific text element, and the value is the translated string in German.\n\n#### Example Entries\n\n- `\"watch.lastReading\"`: Displays the last reading taken by the glucometer.\n- `\"watch.unit.mgdl\"`: Represents the unit of measurement for blood glucose levels.\n- `\"watch.noReadings\"`: Informs the user that there are no readings available.\n- `\"watch.recent\"`: Indicates the most recent reading.\n- `\"watch.readingsSingular\"`: Formats the string for a single reading.\n- `\"watch.readingsPlural\"`: Formats the string for multiple readings.\n- `\"watch.allInRange\"`: Indicates that all readings are within the target range.\n- `\"watch.low\"`: Notifies the user of low readings.\n- `\"watch.high\"`: Notifies the user of high readings.\n\n### String Formatting\n\nThe module uses string interpolation for dynamic content. For example, the keys `watch.readingsSingular` and `watch.readingsPlural` utilize the `%d` placeholder to insert the number of readings dynamically based on the app's state.\n\n## Integration with the Codebase\n\nThis localization module does not have direct internal calls, outgoing calls, or incoming calls, as it serves as a static resource for the app. The strings defined in `Localizable.strings` are accessed throughout the app using the standard localization methods provided by the WatchKit framework.\n\n### Accessing Localized Strings\n\nTo access the localized strings in the app, developers can use the following pattern:\n\n```swift\nlet lastReadingText = NSLocalizedString(\"watch.lastReading\", comment: \"Last reading label\")\n```\n\nThis method retrieves the appropriate string based on the user's language settings, ensuring that the app displays the correct language without additional logic.\n\n## Conclusion\n\nThe **GlucometerWatch Watch App-de.lproj** module is a crucial part of the Glucometer Watch app, enabling localization for German-speaking users. By managing all user-facing strings in a single file, it simplifies the process of maintaining and updating translations, ensuring a consistent and user-friendly experience across different languages.","other-glucometerwatch-watch-app-en-lproj":"# Other — GlucometerWatch Watch App-en.lproj\n\n# GlucometerWatch Watch App Localization Module\n\n## Overview\n\nThe **GlucometerWatch Watch App Localization Module** is responsible for providing localized string resources for the GlucometerWatch app on watchOS. This module contains key user interface strings that are displayed to users, ensuring that the app can present information in a user-friendly manner based on the user's language preferences.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate internationalization (i18n) by providing localized strings that can be used throughout the watch app. This allows the app to support multiple languages and enhance the user experience for a diverse audience.\n\n## Key Components\n\n### Localizable Strings\n\nThe module consists of a single file, `Localizable.strings`, which contains key-value pairs for various user interface elements. Below are the key strings defined in this module:\n\n- **\"watch.lastReading\"**: Displays the label for the last reading.\n- **\"watch.unit.mgdl\"**: Represents the unit of measurement for blood glucose levels (milligrams per deciliter).\n- **\"watch.noReadings\"**: Message shown when there are no readings available.\n- **\"watch.recent\"**: Label for recent readings.\n- **\"watch.readingsSingular\"**: Format string for displaying a single reading (e.g., \"1 reading today\").\n- **\"watch.readingsPlural\"**: Format string for displaying multiple readings (e.g., \"5 readings today\").\n- **\"watch.allInRange\"**: Indicates that all readings are within the acceptable range.\n- **\"watch.low\"**: Format string for displaying the number of low readings (e.g., \"2 low\").\n- **\"watch.high\"**: Format string for displaying the number of high readings (e.g., \"1 high\").\n\n### String Format\n\nThe strings for readings use format specifiers to dynamically insert values. For example:\n- **\"%d reading today\"** and **\"%d readings today\"** utilize the `%d` specifier to insert the number of readings.\n\n## Integration with the Codebase\n\nThis localization module is integrated into the GlucometerWatch app's user interface components. The strings defined in `Localizable.strings` are accessed using the `NSLocalizedString` function, which retrieves the appropriate string based on the user's current locale settings.\n\n### Example Usage\n\nIn the watch app's view controllers, you might see code like the following to display the last reading:\n\n```swift\nlet lastReadingLabel = NSLocalizedString(\"watch.lastReading\", comment: \"Label for the last glucose reading\")\n```\n\nThis line retrieves the localized string for \"Last reading\" and assigns it to the `lastReadingLabel`.\n\n## Conclusion\n\nThe **GlucometerWatch Watch App Localization Module** is a crucial component for ensuring that the app is accessible to users in different languages. By maintaining a clear and organized set of localized strings, the module supports the app's internationalization efforts and enhances the overall user experience. \n\nNo execution flows or internal calls are present in this module, as it solely serves as a resource for string localization.","other-glucometerwatch-watch-app-fr-lproj":"# Other — GlucometerWatch Watch App-fr.lproj\n\n# GlucometerWatch Watch App - French Localization Module\n\n## Overview\n\nThe **GlucometerWatch Watch App/fr.lproj** module is responsible for providing localized strings for the French language in the GlucometerWatch watchOS application. This module ensures that all user-facing text is appropriately translated, enhancing the user experience for French-speaking users.\n\n## Purpose\n\nThe primary purpose of this module is to store and manage localized strings that are displayed in the watch app. By using a dedicated localization file, the app can easily switch between different languages, allowing for broader accessibility and usability.\n\n## Key Components\n\n### Localizable.strings\n\nThe core component of this module is the `Localizable.strings` file, which contains key-value pairs for all the strings used in the watch app. Each key corresponds to a specific text element in the app, and the value is the French translation of that text.\n\n#### String Definitions\n\nHere are the key strings defined in the `Localizable.strings` file:\n\n- **\"watch.lastReading\"**: Displays the last glucose reading.\n- **\"watch.unit.mgdl\"**: Represents the unit of measurement (mg/dL).\n- **\"watch.noReadings\"**: Message shown when there are no readings available.\n- **\"watch.recent\"**: Label for recent readings.\n- **\"watch.readingsSingular\"**: Format string for displaying a single reading.\n- **\"watch.readingsPlural\"**: Format string for displaying multiple readings.\n- **\"watch.allInRange\"**: Indicates that all readings are within the acceptable range.\n- **\"watch.low\"**: Format string for displaying low readings.\n- **\"watch.high\"**: Format string for displaying high readings.\n\n### Example Usage\n\nThe localized strings can be accessed in the watch app code using the `NSLocalizedString` function. For example:\n\n```swift\nlet lastReadingText = NSLocalizedString(\"watch.lastReading\", comment: \"Last glucose reading label\")\n```\n\nThis retrieves the French translation for the last reading label, ensuring that the app displays the correct text based on the user's language preference.\n\n## Integration with the Codebase\n\nThis localization module is integrated into the GlucometerWatch watch app through the standard localization mechanisms provided by iOS and watchOS. The app automatically selects the appropriate localization file based on the user's device language settings.\n\n### Localization Flow\n\n```mermaid\ngraph TD;\n A[User Device Language] --> B{Localization Check}\n B -->|French| C[Localizable.strings]\n B -->|Other| D[Default Localizable.strings]\n C --> E[Display French Strings]\n D --> F[Display Default Strings]\n```\n\n1. The app checks the user's device language.\n2. If the language is French, it loads the `Localizable.strings` from the `fr.lproj` directory.\n3. If the language is not French, it defaults to the standard localization file.\n4. The app then displays the appropriate strings based on the loaded localization.\n\n## Conclusion\n\nThe **GlucometerWatch Watch App/fr.lproj** module plays a crucial role in providing a localized experience for French-speaking users. By managing all French translations in a single file, it simplifies the process of maintaining and updating the app's user interface text. Developers contributing to this module should ensure that any new strings added to the app are also included in the localization files to maintain consistency across different languages.","other-glucometerwatch-watch-app":"# Other — GlucometerWatch Watch App\n\n# GlucometerWatch Watch App Module Documentation\n\n## Overview\n\nThe **GlucometerWatch Watch App** module serves as the primary interface for displaying glucose readings on the Apple Watch. It manages data retrieval from HealthKit, computes statistics, and updates the UI in real-time. The module is designed to ensure that the watch app remains responsive and up-to-date with the latest glucose data, even when the app is not in the foreground.\n\n## Key Components\n\n### GlucoseWatchViewModel\n\nThe `GlucoseWatchViewModel` class is the core of this module. It conforms to `ObservableObject`, allowing SwiftUI views to bind to its published properties. The view model handles:\n\n- **Data Retrieval**: Fetches glucose readings from HealthKit.\n- **Data Processing**: Computes statistics such as daily averages and time in range.\n- **UI Updates**: Publishes changes to properties that the UI observes.\n\n#### Properties\n\n- `@Published var currentEntry: WatchGlucoseEntry?`: The most recent glucose reading.\n- `@Published var historyEntries: [WatchGlucoseEntry]`: An array of the last 10 glucose readings.\n- `@Published var dailyAverage: Double?`: The average glucose level for the current day.\n- `@Published var timeInRange: Double?`: The fraction of the last 7 days that the glucose readings were within the target range.\n- `@Published var todayReadingCount: Int`: Count of today's readings.\n- `@Published var todayLowCount: Int`: Count of today's low readings.\n- `@Published var todayHighCount: Int`: Count of today's high readings.\n- `@Published var isLoading: Bool`: Indicates if data is currently being loaded.\n\n### Initialization\n\nThe view model initializes by setting up observers for both WatchConnectivity and HealthKit:\n\n```swift\ninit() {\n setupPushObserver()\n setupHKObserver()\n}\n```\n\n### Data Staleness Check\n\nThe `isDataStale` computed property determines if the data is outdated, based on the timestamp of the last reading:\n\n```swift\nvar isDataStale: Bool {\n guard let date = lastReadingDate else { return true }\n return Date.now.timeIntervalSince(date) > 8 * 3600\n}\n```\n\n### Data Reloading\n\nThe `reload()` method triggers an asynchronous data reload, while `reloadAsync()` performs the actual data fetching and processing:\n\n```swift\nfunc reload() {\n Task { await reloadAsync() }\n}\n```\n\n#### Asynchronous Data Fetching\n\nThe `reloadAsync()` method handles:\n\n1. **Authorization**: Requests read access to HealthKit data.\n2. **Data Fetching**: Retrieves glucose samples from the last 7 days.\n3. **Statistics Calculation**: Computes daily averages and counts.\n4. **UI Updates**: Updates published properties and writes data for complications.\n\n### Observers\n\n#### Push Observer\n\nThe `setupPushObserver()` method subscribes to notifications from the iPhone, allowing immediate updates to the UI when new glucose data is pushed:\n\n```swift\nprivate func setupPushObserver() {\n pushObserver = NotificationCenter.default.addObserver(\n forName: .glucoseDataPushed, object: nil, queue: .main\n ) { [weak self] notification in\n // Handle incoming glucose data\n }\n}\n```\n\n#### HealthKit Observer\n\nThe `setupHKObserver()` method sets up an `HKObserverQuery` to listen for changes in HealthKit data, ensuring the app updates even when in the background:\n\n```swift\nprivate func setupHKObserver() {\n // Configure HKObserverQuery\n}\n```\n\n### Complication and Widget Updates\n\nThe `writeComplicationData()` method updates the shared App Group with the latest glucose reading, prompting WidgetKit to refresh any associated complications:\n\n```swift\nprivate func writeComplicationData() {\n // Write data to UserDefaults and reload WidgetKit timelines\n}\n```\n\n### Helper Methods\n\n- `trendSymbol(from:)`: Maps a rate of change to a Unicode trend arrow.\n- `fetchSamplesInDateRange(type:days:)`: Fetches glucose samples from HealthKit for a specified number of days.\n\n## Architecture Diagram\n\n```mermaid\ngraph TD;\n A[GlucometerWatch Watch App] --> B[GlucoseWatchViewModel]\n B --> C[HealthKit]\n B --> D[WatchConnectivity]\n B --> E[WidgetKit]\n B --> F[UserDefaults]\n```\n\n## Conclusion\n\nThe **GlucometerWatch Watch App** module is a well-structured component that efficiently manages glucose data for the Apple Watch. By leveraging HealthKit and WatchConnectivity, it ensures that users receive timely and accurate information about their glucose levels, enhancing the overall user experience. Developers contributing to this module should focus on maintaining the responsiveness of the UI and ensuring data integrity across updates.","other-glucometerwatchcomplication-assets-xcassets":"# Other — GlucometerWatchComplication-Assets.xcassets\n\n# GlucometerWatchComplication - Assets Module Documentation\n\n## Overview\n\nThe **GlucometerWatchComplication-Assets.xcassets** module is responsible for managing the visual assets used in the Glucometer Watch Complication application. This module includes color sets and app icons that are essential for the user interface, ensuring a consistent and visually appealing design across different appearances and device settings.\n\n## Purpose\n\nThe primary purpose of this module is to define and store the color schemes and app icons that the Glucometer Watch Complication uses. This allows for easy updates and maintenance of visual assets without altering the underlying codebase. The assets are defined in a structured format that is compatible with Xcode's asset catalog system.\n\n## Key Components\n\n### 1. AccentColor.colorset\n\nThe **AccentColor.colorset** defines a set of colors used throughout the application. It includes variations for different appearances, such as light and dark modes, as well as high contrast settings. The colors are defined in the sRGB color space and include the following components:\n\n- **Universal Color Variants**:\n - **Default Color**: A bright green color.\n - **Dark Appearance**: A slightly darker green.\n - **High Contrast**: A vibrant orange color.\n - **Dark & High Contrast**: A yellowish-green color.\n\n#### Example Structure\n\n```json\n{\n \"colors\": [\n {\n \"color\": {\n \"color-space\": \"srgb\",\n \"components\": {\n \"alpha\": \"1.000\",\n \"blue\": \"1.000\",\n \"green\": \"0.478\",\n \"red\": \"0.000\"\n }\n },\n \"idiom\": \"universal\"\n },\n ...\n ]\n}\n```\n\n### 2. AppIcon.appiconset\n\nThe **AppIcon.appiconset** contains the app icon used for the Glucometer Watch Complication. This icon is essential for branding and user recognition on the watchOS platform.\n\n- **Icon Details**:\n - **Filename**: Glucozy-Icon.png\n - **Size**: 1024x1024 pixels\n - **Platform**: watchOS\n\n#### Example Structure\n\n```json\n{\n \"images\": [\n {\n \"filename\": \"Glucozy-Icon.png\",\n \"idiom\": \"universal\",\n \"platform\": \"watchos\",\n \"size\": \"1024x1024\"\n }\n ]\n}\n```\n\n### 3. WidgetBackground.colorset\n\nThe **WidgetBackground.colorset** is designed to define the background color for the widget. Currently, it is set to a universal idiom without specific color definitions, allowing for flexibility in future updates.\n\n#### Example Structure\n\n```json\n{\n \"colors\": [\n {\n \"idiom\": \"universal\"\n }\n ]\n}\n```\n\n### 4. Contents.json\n\nEach asset set includes a **Contents.json** file that provides metadata about the assets, including the author and version. This file is crucial for maintaining the integrity of the asset catalog.\n\n#### Example Structure\n\n```json\n{\n \"info\": {\n \"author\": \"xcode\",\n \"version\": 1\n }\n}\n```\n\n## Integration with the Codebase\n\nThe assets defined in this module are utilized throughout the Glucometer Watch Complication application. The colors and icons are referenced in the UI components, ensuring that the application adheres to the design guidelines and provides a cohesive user experience.\n\n### Usage Example\n\nIn SwiftUI, you can reference the colors defined in the asset catalog as follows:\n\n```swift\nlet accentColor = Color(\"AccentColor\")\n```\n\nThis allows developers to easily apply the defined colors in their views, ensuring consistency across the application.\n\n## Conclusion\n\nThe **GlucometerWatchComplication-Assets.xcassets** module plays a vital role in the visual presentation of the Glucometer Watch Complication. By organizing colors and icons in a structured manner, it simplifies the process of maintaining and updating the application's visual assets. Developers can easily reference these assets in their code, promoting a consistent and user-friendly interface.","other-glucometerwatchcomplication-de-lproj":"# Other — GlucometerWatchComplication-de.lproj\n\n# GlucometerWatchComplication Module Documentation\n\n## Overview\n\nThe **GlucometerWatchComplication** module is responsible for providing localized strings for the watch complication that displays glucose measurements from a glucometer. This module is designed to enhance the user experience by presenting relevant data in a concise and understandable format on the Apple Watch interface.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate the display of glucose measurement data in a localized manner, ensuring that users can easily interpret their glucose levels. The strings defined in this module are used by the watch complication to present real-time information about the user's glucose readings.\n\n## Key Components\n\n### Localizable Strings\n\nThe module contains a single file, `Localizable.strings`, which defines various strings used in the watch complication. Below is a breakdown of the key strings included in this file:\n\n- **\"complication.now\"**: Displays the word \"jetzt\" (now) to indicate the most recent measurement.\n- **\"complication.minutesAgo\"**: A format string that shows how many minutes ago the last measurement was taken, represented as \"%dm\".\n- **\"complication.hoursAgo\"**: A format string that shows how many hours ago the last measurement was taken, represented as \"%dh\".\n- **\"complication.noData\"**: Displays \"Keine Daten\" (No Data) when there is no available glucose measurement.\n- **\"complication.stale\"**: Indicates that the data is outdated with the message \"Veraltet\" (Stale).\n- **\"complication.name\"**: The name of the complication, which is \"Blutzucker\" (Blood Sugar).\n- **\"complication.description\"**: A description of the complication, which reads \"Aktuelle Messung von deinem Glukosemessgerät.\" (Current measurement from your glucometer).\n\n### Localization\n\nThe strings are localized for German (`de.lproj`), allowing the complication to present information in the user's preferred language. This is crucial for accessibility and user engagement, as it ensures that users can understand their health data without language barriers.\n\n## Integration with the Codebase\n\nThe **GlucometerWatchComplication** module does not have any direct internal calls, outgoing calls, or incoming calls, indicating that it serves as a standalone resource for localization. The strings defined in this module are likely referenced by the watch complication's rendering logic, which formats and displays the data based on the user's glucose readings.\n\n### Usage Example\n\nWhen the watch complication needs to display the time since the last glucose measurement, it would utilize the `complication.minutesAgo` or `complication.hoursAgo` strings, formatting them with the appropriate time values. For instance:\n\n```swift\nlet minutesAgo = String(format: NSLocalizedString(\"complication.minutesAgo\", comment: \"\"), minutes)\n```\n\nThis line retrieves the localized string for minutes ago and formats it with the actual number of minutes since the last measurement.\n\n## Conclusion\n\nThe **GlucometerWatchComplication** module plays a vital role in ensuring that users receive timely and understandable glucose measurement data on their Apple Watch. By providing localized strings, it enhances the overall user experience and promotes better health management through clear communication of critical information. \n\nThis module is essential for developers working on the watch complication, as it provides the necessary localization support to ensure that users can effectively interpret their glucose data.","other-glucometerwatchcomplication-en-lproj":"# Other — GlucometerWatchComplication-en.lproj\n\n# GlucometerWatchComplication Module Documentation\n\n## Overview\n\nThe **GlucometerWatchComplication** module is designed to provide localized strings for the watch complication that displays blood glucose readings from a glucometer. This module is part of a larger application that integrates health monitoring features, specifically focusing on diabetes management.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate the display of relevant information regarding blood glucose levels on a smartwatch interface. It ensures that users receive timely and understandable data about their health metrics, enhancing the user experience and promoting better health management.\n\n## Key Components\n\n### Localizable Strings\n\nThe module contains a single file, `Localizable.strings`, which defines various strings used in the watch complication. These strings are localized for English and are essential for presenting information to the user in a clear and concise manner.\n\n#### Defined Strings\n\n- **\"complication.now\"**: Displays the current time indicator.\n- **\"complication.minutesAgo\"**: Formats the time elapsed since the last reading in minutes (e.g., \"5m\").\n- **\"complication.hoursAgo\"**: Formats the time elapsed since the last reading in hours (e.g., \"2h\").\n- **\"complication.noData\"**: Indicates that there is no available data to display.\n- **\"complication.stale\"**: Indicates that the data displayed is outdated.\n- **\"complication.name\"**: The title of the complication, which is \"Blood Glucose\".\n- **\"complication.description\"**: A brief description of the complication, stating \"Latest reading from your glucometer.\"\n\n### Localization\n\nThe strings are structured to support localization, allowing for easy translation into other languages if needed. This is crucial for applications that aim to reach a global audience.\n\n## Integration with the Codebase\n\nWhile this module does not have any direct internal or outgoing calls, it is utilized by the watch complication interface of the application. The strings defined in this module are referenced by the watch complication's view components to present the latest blood glucose readings to the user.\n\n### Usage Example\n\nIn the watch complication's view code, the strings can be accessed as follows:\n\n```swift\nlet nowString = NSLocalizedString(\"complication.now\", comment: \"Current time indicator\")\nlet minutesAgoString = String(format: NSLocalizedString(\"complication.minutesAgo\", comment: \"Minutes ago\"), minutes)\nlet hoursAgoString = String(format: NSLocalizedString(\"complication.hoursAgo\", comment: \"Hours ago\"), hours)\nlet noDataString = NSLocalizedString(\"complication.noData\", comment: \"No data available\")\n```\n\n## Conclusion\n\nThe **GlucometerWatchComplication** module plays a vital role in ensuring that users receive accurate and timely information regarding their blood glucose levels on their smartwatches. By providing localized strings, it enhances the user experience and supports the overall functionality of the health monitoring application. Future contributions to this module may include adding additional languages or enhancing the string definitions to support more complex data presentations.","other-glucometerwatchcomplication-fr-lproj":"# Other — GlucometerWatchComplication-fr.lproj\n\n# GlucometerWatchComplication Module Documentation\n\n## Overview\n\nThe **GlucometerWatchComplication** module is responsible for providing localized strings used in the watch complication for displaying glucose meter data. This module is specifically designed for the French localization of the application, ensuring that users can view relevant information in their native language.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate the display of glucose meter readings and related information on a smartwatch complication. It provides a set of localized strings that are used to inform users about their glucose levels, the recency of the data, and the status of the readings.\n\n## Key Components\n\n### Localizable Strings\n\nThe module contains a single file, `Localizable.strings`, which includes the following key-value pairs:\n\n- **\"complication.now\"**: Displays the current time in French (\"maintenant\").\n- **\"complication.minutesAgo\"**: A placeholder string for displaying how many minutes ago the last reading was taken (e.g., \"5m\" for 5 minutes).\n- **\"complication.hoursAgo\"**: A placeholder string for displaying how many hours ago the last reading was taken (e.g., \"2h\" for 2 hours).\n- **\"complication.noData\"**: Indicates that there is no available data (\"Aucune donnée\").\n- **\"complication.stale\"**: Indicates that the data is outdated (\"Obsolète\").\n- **\"complication.name\"**: The name of the complication, which is \"Glycémie\" (French for \"Blood Sugar\").\n- **\"complication.description\"**: A description of the complication, stating \"Dernière mesure de votre glucomètre\" (Last measurement from your glucometer).\n\n### Localization\n\nThis module is part of the localization strategy for the application, allowing for easy adaptation of the user interface to different languages. The strings defined in this module are used by the watch complication to present information in a user-friendly manner.\n\n## Integration with the Codebase\n\nThe **GlucometerWatchComplication** module does not have any internal calls, outgoing calls, or incoming calls, indicating that it is a standalone localization resource. It is typically accessed by the watch complication component of the application, which retrieves the localized strings to display relevant glucose meter information.\n\n### Usage Example\n\nWhen the watch complication is rendered, it will utilize the strings defined in this module to present the latest glucose reading. For instance, if the last reading was taken 10 minutes ago and the reading is available, the complication might display:\n\n```\nGlycémie: 5.6 mmol/L\nDernière mesure: 10m\n```\n\nIf there is no data available, it will display:\n\n```\nGlycémie: Aucune donnée\n```\n\n## Conclusion\n\nThe **GlucometerWatchComplication** module is a crucial part of the user experience for French-speaking users of the glucose monitoring application. By providing localized strings, it ensures that users can easily understand their glucose levels and the recency of their readings. This module is designed to be simple and effective, focusing solely on localization without any complex execution flows or dependencies.","other-glucometerwatchcomplication":"# Other — GlucometerWatchComplication\n\n# GlucometerWatchComplication Module Documentation\n\n## Overview\n\nThe **GlucometerWatchComplication** module is designed to provide a watchOS complication that displays glucose level readings from a connected glucometer. This module leverages the WidgetKit framework to create a seamless integration with the Apple Watch interface, allowing users to monitor their glucose levels at a glance.\n\n## Purpose\n\nThe primary purpose of the GlucometerWatchComplication module is to enhance user experience by providing real-time glucose monitoring directly on the Apple Watch. This functionality is crucial for users managing diabetes, as it allows for quick access to vital health information without needing to interact with their primary device.\n\n## Key Components\n\n### 1. Info.plist\n\nThe `Info.plist` file is a crucial component of the GlucometerWatchComplication module. It defines the module's metadata and configuration settings necessary for the watchOS extension to function correctly.\n\n#### Key Entries:\n- **NSExtension**: This key specifies the extension point identifier, which in this case is set to `com.apple.widgetkit-extension`. This indicates that the module is a WidgetKit extension, allowing it to be displayed as a complication on the watch face.\n\n### 2. Complication Configuration\n\nWhile the source code does not provide specific implementation details for the complication itself, the following components are typically involved in a watchOS complication:\n\n- **Complication Controller**: This class manages the data and timeline for the complication. It is responsible for providing the current glucose level and updating the complication when new data is available.\n- **Timeline Entries**: These entries represent the data points that the complication will display over time. The complication controller will generate these entries based on the glucose readings received from the glucometer.\n\n### 3. Data Source\n\nThe GlucometerWatchComplication module is expected to interact with a data source that provides glucose readings. This could be a Bluetooth-connected glucometer or a health data repository. The module should implement a mechanism to fetch and update glucose levels periodically.\n\n## Integration with the Codebase\n\nThe GlucometerWatchComplication module is designed to work in conjunction with other modules that handle data collection and processing. Here’s how it connects to the rest of the codebase:\n\n1. **Data Retrieval**: The complication will likely rely on a data management module that interfaces with the glucometer. This module should provide an API to fetch the latest glucose readings.\n2. **User Interface**: The complication will be displayed on the watch face, and it should adhere to the design guidelines set forth by Apple for watchOS applications.\n3. **Notifications**: If the glucose levels fall outside of a predefined range, the module may need to trigger notifications or alerts, which would require integration with the notification handling components of the application.\n\n## Execution Flow\n\nCurrently, there are no detected execution flows or internal calls within the GlucometerWatchComplication module. This indicates that the module is primarily a configuration layer that relies on external data sources and the watchOS framework for functionality.\n\n## Conclusion\n\nThe GlucometerWatchComplication module serves as a vital component for users needing quick access to their glucose levels on their Apple Watch. By leveraging WidgetKit, it provides a user-friendly interface that integrates seamlessly with the watchOS environment. Future enhancements may include implementing the complication controller and data retrieval mechanisms to fully realize its potential.","other-glucometerwidget-assets-xcassets":"# Other — GlucometerWidget-Assets.xcassets\n\n# GlucometerWidget-Assets.xcassets Module Documentation\n\n## Overview\n\nThe **GlucometerWidget-Assets.xcassets** module is a collection of asset catalogs used in the Glucometer Widget application. This module primarily contains color definitions that are utilized throughout the widget's user interface. The assets are defined in JSON format, which is compatible with Xcode's asset management system, allowing for easy integration and management of visual resources.\n\n## Purpose\n\nThe purpose of this module is to provide a centralized location for color assets that can be referenced throughout the Glucometer Widget. By defining colors in asset catalogs, the application can maintain a consistent look and feel while also supporting different appearances and themes, such as light and dark modes.\n\n## Key Components\n\n### 1. AccentColor.colorset\n\nThe `AccentColor.colorset` defines a set of colors that are used for accentuating UI elements. It includes multiple color variations based on different appearances:\n\n- **Default Color**: \n - RGB: (0.0, 0.478, 1.0)\n - Alpha: 1.0\n\n- **Dark Appearance**: \n - RGB: (0.039, 0.518, 1.0)\n - Alpha: 1.0\n\n- **High Contrast**: \n - RGB: (0.0, 0.251, 0.867)\n - Alpha: 1.0\n\n- **Dark and High Contrast**: \n - RGB: (0.251, 0.612, 1.0)\n - Alpha: 1.0\n\nEach color is defined with its respective color space (sRGB) and can be used universally across the widget.\n\n### 2. WidgetBackground.colorset\n\nThe `WidgetBackground.colorset` is defined with a universal idiom but does not specify any colors in the provided JSON. This indicates that the background color may be set programmatically or is intended to be defined elsewhere in the application.\n\n### 3. Contents.json Files\n\nEach colorset includes a `Contents.json` file that provides metadata about the asset, including the author and version. This information is useful for tracking changes and maintaining the asset catalog.\n\n## Integration with the Codebase\n\nThe assets defined in this module are referenced throughout the Glucometer Widget's UI components. The colors can be accessed programmatically using the `UIColor` class in Swift, allowing developers to apply these colors to various UI elements such as buttons, labels, and backgrounds.\n\n### Example Usage\n\nTo use the accent color in a Swift file, you can access it as follows:\n\n```swift\nlet accentColor = UIColor(named: \"AccentColor\")\n```\n\nThis retrieves the appropriate color based on the current appearance settings (light or dark mode).\n\n## Conclusion\n\nThe **GlucometerWidget-Assets.xcassets** module plays a crucial role in defining the visual identity of the Glucometer Widget. By centralizing color definitions, it enhances maintainability and consistency across the application. Developers should ensure that any new colors or modifications to existing colors are reflected in this module to maintain a cohesive user experience.","other-glucometerwidget-de-lproj":"# Other — GlucometerWidget-de.lproj\n\n# GlucometerWidget-de.lproj Module Documentation\n\n## Overview\n\nThe **GlucometerWidget-de.lproj** module is responsible for providing localized strings for the Glucometer widget in the German language. This module is part of the user interface that displays blood glucose levels and related information to users. The strings defined in this module are used to present data in a user-friendly manner, ensuring that users can easily understand their glucose readings and related metrics.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate localization for the Glucometer widget, allowing it to present information in German. This enhances the user experience for German-speaking users by providing clear and contextually relevant messages.\n\n## Key Components\n\n### Localizable.strings\n\nThe core component of this module is the `Localizable.strings` file, which contains key-value pairs for various strings used in the Glucometer widget. Below is a breakdown of the key strings defined in this file:\n\n| Key | Value | Description |\n|------------------------|-----------------------------------------------|--------------------------------------------------|\n| `widget.justNow` | \"Gerade eben\" | Indicates a recent measurement. |\n| `widget.minutesAgo` | \"vor %d Min.\" | Displays time elapsed in minutes. |\n| `widget.hoursAgo` | \"vor %d Std.\" | Displays time elapsed in hours. |\n| `widget.unit.mgdl` | \"mg/dl\" | Unit of measurement for blood glucose levels. |\n| `widget.inRange` | \"Im Bereich\" | Indicates that the glucose level is within the target range. |\n| `widget.low` | \"Niedrig\" | Indicates a low glucose level. |\n| `widget.high` | \"Hoch\" | Indicates a high glucose level. |\n| `widget.a1c` | \"Gesch. HbA1c\" | Refers to the average blood glucose level over time (HbA1c). |\n| `widget.noData` | \"Keine Daten — zuerst synchronisieren\" | Message displayed when no data is available. |\n| `widget.name` | \"Glucozy\" | The name of the widget. |\n| `widget.description` | \"Aktueller Blutzuckerwert und Zeit im Zielbereich.\" | Description of the widget's functionality. |\n\n## Usage\n\nThe strings defined in this module are utilized by the Glucometer widget to present information to the user. When the widget is rendered, it will reference these localized strings to display the appropriate messages based on the current state of the glucose data.\n\n### Example Usage\n\nIn the widget's code, you might see references to these strings as follows:\n\n```swift\nlet lastMeasurementTime = String(format: NSLocalizedString(\"widget.minutesAgo\", comment: \"\"), minutesAgo)\nlet glucoseUnit = NSLocalizedString(\"widget.unit.mgdl\", comment: \"\")\n```\n\nThis ensures that the widget displays the correct localized text based on the user's language settings.\n\n## Integration with the Codebase\n\nThe **GlucometerWidget-de.lproj** module does not have any direct outgoing or incoming calls, nor does it have any execution flows. It serves as a static resource that is accessed by the Glucometer widget's code. The localization mechanism in the application will automatically load the appropriate strings based on the user's language preference.\n\n### Localization Mechanism\n\nThe localization is typically handled by the `NSLocalizedString` function in Swift, which looks up the appropriate string in the `Localizable.strings` file based on the current locale. This allows for seamless integration of localized content into the widget without requiring additional logic for language handling.\n\n## Conclusion\n\nThe **GlucometerWidget-de.lproj** module plays a crucial role in enhancing the user experience for German-speaking users of the Glucometer widget. By providing localized strings, it ensures that users can easily understand their blood glucose readings and related information. This module is a key part of the overall localization strategy for the application, contributing to its accessibility and usability across different languages.","other-glucometerwidget-en-lproj":"# Other — GlucometerWidget-en.lproj\n\n# GlucometerWidget Localization Module\n\n## Overview\n\nThe **GlucometerWidget-en.lproj** module is responsible for providing localized strings for the Glucometer widget in English. This module is part of the user interface that displays the latest blood glucose readings and related information. It ensures that the widget presents text in a user-friendly manner, adapting to the user's language preferences.\n\n## Purpose\n\nThe primary purpose of this module is to define and manage the localized strings used within the Glucometer widget. This includes labels, messages, and descriptions that enhance the user experience by providing clear and concise information about blood glucose levels.\n\n## Key Components\n\n### Localizable.strings\n\nThe core component of this module is the `Localizable.strings` file, which contains key-value pairs for all the strings used in the Glucometer widget. Below is a breakdown of the key strings defined in this file:\n\n- **widget.justNow**: Displays \"Just now\" when the latest reading was taken immediately.\n- **widget.minutesAgo**: Displays the time elapsed since the last reading in minutes (e.g., \"5m ago\").\n- **widget.hoursAgo**: Displays the time elapsed since the last reading in hours (e.g., \"2h ago\").\n- **widget.unit.mgdl**: Represents the unit of measurement for blood glucose, \"mg/dL\".\n- **widget.inRange**: Indicates that the blood glucose level is within the normal range.\n- **widget.low**: Indicates that the blood glucose level is low.\n- **widget.high**: Indicates that the blood glucose level is high.\n- **widget.a1c**: Displays the estimated A1c value.\n- **widget.noData**: Informs the user that there is no data available and prompts them to sync first.\n- **widget.name**: The name of the widget, \"Glucozy\".\n- **widget.description**: A brief description of the widget's functionality, \"Latest blood glucose reading and time-in-range.\"\n\n### Example Usage\n\nThe strings defined in `Localizable.strings` are typically accessed within the Glucometer widget's code using a localization function. For example, in Swift, you might see:\n\n```swift\nlet lastReadingTime = String(format: NSLocalizedString(\"widget.minutesAgo\", comment: \"\"), minutesElapsed)\n```\n\nThis line retrieves the localized string for the time elapsed since the last reading and formats it with the appropriate value.\n\n## Integration with the Codebase\n\nThe Glucometer widget utilizes these localized strings to present information to the user. While there are no direct internal or outgoing calls associated with this module, it is essential for the overall functionality of the widget. The localization module connects seamlessly with the widget's UI components, ensuring that all text displayed is appropriately localized based on the user's language settings.\n\n### Execution Flow\n\nThere are no specific execution flows or internal calls within this module, as it solely serves as a repository for localized strings. The strings are accessed as needed by the Glucometer widget's UI components.\n\n## Conclusion\n\nThe **GlucometerWidget-en.lproj** module plays a crucial role in enhancing the user experience by providing localized text for the Glucometer widget. By managing the strings in a centralized manner, it allows for easy updates and modifications, ensuring that users receive clear and relevant information regarding their blood glucose readings.","other-glucometerwidget-fr-lproj":"# Other — GlucometerWidget-fr.lproj\n\n# GlucometerWidget-fr.lproj Module Documentation\n\n## Overview\n\nThe **GlucometerWidget-fr.lproj** module is responsible for providing localized strings for the Glucometer Widget in French. This module is part of the user interface that displays blood glucose measurements and related information to users. The strings defined in this module are used to present data in a user-friendly manner, ensuring that French-speaking users can easily understand the information displayed.\n\n## Purpose\n\nThe primary purpose of this module is to facilitate localization for the Glucometer Widget, allowing it to present relevant information in French. This enhances user experience by providing contextually appropriate messages and labels that are essential for interpreting blood glucose data.\n\n## Key Components\n\n### Localizable.strings\n\nThe core component of this module is the `Localizable.strings` file, which contains key-value pairs for various strings used in the Glucometer Widget. Below are the key strings defined in this file:\n\n- **\"widget.justNow\"**: Displays \"À l'instant\" to indicate a recent measurement.\n- **\"widget.minutesAgo\"**: Displays \"il y a %d min\" to show how many minutes ago a measurement was taken.\n- **\"widget.hoursAgo\"**: Displays \"il y a %d h\" to indicate how many hours ago a measurement was recorded.\n- **\"widget.unit.mgdl\"**: Represents the unit of measurement for blood glucose, \"mg/dL\".\n- **\"widget.inRange\"**: Indicates that the glucose level is within the acceptable range.\n- **\"widget.low\"**: Indicates that the glucose level is low.\n- **\"widget.high\"**: Indicates that the glucose level is high.\n- **\"widget.a1c\"**: Refers to the HbA1c measurement.\n- **\"widget.noData\"**: Alerts the user that there is no data available and prompts them to sync first.\n- **\"widget.name\"**: The name of the widget, \"Glucozy\".\n- **\"widget.description\"**: A brief description of the widget's functionality, \"Dernière mesure de glycémie et temps dans la plage.\"\n\n## Integration with the Codebase\n\nThe **GlucometerWidget-fr.lproj** module does not have any direct internal calls, outgoing calls, or incoming calls, as it solely provides localized strings. The integration occurs when the Glucometer Widget accesses these strings to display information to the user. The widget will reference these localized strings based on the user's language settings, ensuring that the appropriate French translations are used.\n\n### Usage Example\n\nWhen the Glucometer Widget needs to display the time since the last measurement, it will retrieve the corresponding string from the `Localizable.strings` file. For instance, if the last measurement was taken 5 minutes ago, the widget will format the string as follows:\n\n```swift\nlet minutesAgo = String(format: NSLocalizedString(\"widget.minutesAgo\", comment: \"\"), 5)\n```\n\nThis will result in the output: \"il y a 5 min\".\n\n## Conclusion\n\nThe **GlucometerWidget-fr.lproj** module plays a crucial role in localizing the Glucometer Widget for French-speaking users. By providing a set of well-defined strings, it ensures that users can easily interpret their blood glucose data. This module is a vital part of the overall user experience, contributing to the accessibility and usability of the application for a diverse audience.","other-glucometerwidget":"# Other — GlucometerWidget\n\n# GlucometerWidget Module Documentation\n\n## Overview\n\nThe **GlucometerWidget** module is designed as a widget extension for iOS applications, specifically tailored to display and interact with glucose level data. This module leverages the WidgetKit framework to provide users with a quick and accessible way to monitor their glucose levels directly from their device's home screen.\n\n## Purpose\n\nThe primary purpose of the GlucometerWidget is to present real-time glucose readings and historical data in a user-friendly format. It aims to enhance user engagement by providing essential health information at a glance, thereby promoting better diabetes management.\n\n## Key Components\n\n### 1. Info.plist\n\nThe `Info.plist` file is a crucial component of the GlucometerWidget module. It defines the widget's configuration and capabilities. The key elements include:\n\n- **NSExtension**: This key specifies that the module is an extension.\n - **NSExtensionPointIdentifier**: Set to `com.apple.widgetkit-extension`, indicating that this module is a WidgetKit extension.\n\n### 2. Widget Configuration\n\nWhile the source code does not provide specific implementation details, the widget typically includes the following components:\n\n- **Timeline Provider**: Responsible for supplying the widget with data at specified intervals. This component fetches the latest glucose readings and prepares them for display.\n- **View**: The user interface of the widget, which presents the glucose data in a visually appealing manner. This may include graphs, numbers, and other relevant health metrics.\n- **Entry**: A data structure that holds the information to be displayed in the widget. This includes the current glucose level, time of the last reading, and any other pertinent details.\n\n### 3. Data Handling\n\nAlthough there are no explicit outgoing or incoming calls defined in the current implementation, the widget is expected to interact with a data source, such as a health data API or a local database, to retrieve glucose readings. This interaction typically occurs through:\n\n- **Network Requests**: To fetch the latest glucose data from a remote server.\n- **Local Storage Access**: To retrieve historical data stored on the device.\n\n## Execution Flow\n\nCurrently, there are no detected execution flows within the GlucometerWidget module. However, the expected flow for a typical widget would involve:\n\n1. **Initialization**: The widget is loaded and initialized by the system.\n2. **Data Fetching**: The timeline provider fetches the latest glucose data.\n3. **Rendering**: The view component renders the data for display.\n4. **User Interaction**: Users can tap on the widget to open the main application for more detailed information.\n\n## Integration with the Codebase\n\nThe GlucometerWidget module is designed to be integrated with the main application that handles glucose data. The main application should provide the necessary APIs or data access methods that the widget can utilize to fetch and display glucose readings.\n\n### Example Integration\n\nTo integrate the GlucometerWidget with the main application, developers should ensure that:\n\n- The main application exposes a method to retrieve the latest glucose readings.\n- The widget is configured to call this method at regular intervals to update its display.\n\n## Conclusion\n\nThe GlucometerWidget module serves as a vital component for users managing diabetes, providing them with immediate access to their glucose levels. By leveraging WidgetKit, it enhances user experience and encourages proactive health management. Future enhancements may include more detailed data visualization and user interaction capabilities.","other-glucozywatchcomplicationextension-entitlements":"# Other — GlucozyWatchComplicationExtension.entitlements\n\n# GlucozyWatchComplicationExtension.entitlements\n\n## Overview\n\nThe `GlucozyWatchComplicationExtension.entitlements` file is a property list (plist) that defines the entitlements for the Glucozy Watch Complication Extension. Entitlements are key-value pairs that grant specific permissions to an app or extension, allowing it to access certain system resources or services. This file is crucial for ensuring that the Glucozy Watch Complication Extension can interact with HealthKit and share data securely with other components of the Glucozy application.\n\n## Purpose\n\nThe primary purpose of this entitlements file is to:\n\n1. **Enable HealthKit Access**: Grant the extension permission to read and write health-related data.\n2. **Support App Group Sharing**: Allow the extension to share data with other parts of the Glucozy application through a defined app group.\n\n## Key Components\n\n### Entitlement Keys\n\nThe entitlements file contains the following keys:\n\n- **`com.apple.developer.healthkit`**: \n - **Type**: Boolean\n - **Value**: `true`\n - **Description**: This key enables the extension to access HealthKit, allowing it to read and write health data such as glucose levels.\n\n- **`com.apple.security.application-groups`**: \n - **Type**: Array\n - **Value**: `[\"group.glucozy.shared\"]`\n - **Description**: This key specifies the app group that the extension belongs to. The `group.glucozy.shared` identifier allows the extension to share data with the main Glucozy app and other extensions that are part of the same app group.\n\n### Structure of the Entitlements File\n\nThe entitlements file is structured in XML format, following the Property List (plist) format. Below is a simplified representation of the file structure:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>com.apple.developer.healthkit<\/key>\n <true/>\n <key>com.apple.security.application-groups<\/key>\n <array>\n <string>group.glucozy.shared<\/string>\n <\/array>\n<\/dict>\n<\/plist>\n```\n\n## Integration with the Codebase\n\nThe entitlements defined in this file are essential for the Glucozy Watch Complication Extension to function correctly within the broader Glucozy application ecosystem. The extension relies on these entitlements to:\n\n- Access HealthKit data, which is critical for displaying real-time glucose levels on the watch face.\n- Share data seamlessly with the main Glucozy app, ensuring that users have a consistent experience across devices.\n\n### Data Flow\n\nWhile there are no direct execution flows or internal calls associated with this entitlements file, it plays a vital role in the overall architecture by enabling the necessary permissions for data access and sharing.\n\n```mermaid\ngraph TD;\n A[Glucozy Watch Complication Extension] -->|Accesses| B[HealthKit];\n A -->|Shares Data| C[Glucozy App];\n B -->|Provides| D[Health Data];\n C -->|Receives| D;\n```\n\n## Conclusion\n\nThe `GlucozyWatchComplicationExtension.entitlements` file is a critical component that ensures the Glucozy Watch Complication Extension has the necessary permissions to operate effectively. By enabling HealthKit access and facilitating data sharing through app groups, this entitlements file supports the core functionality of the Glucozy application, enhancing the user experience for those managing their glucose levels.","other-glucozywatchcomplicationextensiondebug-entitlements":"# Other — GlucozyWatchComplicationExtensionDebug.entitlements\n\n# GlucozyWatchComplicationExtensionDebug Entitlements\n\n## Overview\n\nThe `GlucozyWatchComplicationExtensionDebug.entitlements` file is a property list (plist) that defines the entitlements for the Glucozy Watch Complication Extension in debug mode. Entitlements are key-value pairs that grant specific capabilities to an app, allowing it to access certain system resources or services. This file is crucial for ensuring that the Glucozy Watch Complication can interact with HealthKit and share data securely across app groups.\n\n## Purpose\n\nThe primary purpose of this entitlements file is to:\n\n1. **Enable HealthKit Access**: Grant the application permission to read and write health-related data.\n2. **Support App Group Sharing**: Allow the Glucozy app and its extensions to share data through a common app group.\n\n## Key Components\n\n### 1. HealthKit Entitlement\n\n```xml\n<key>com.apple.developer.healthkit<\/key>\n<true/>\n```\n\n- This key enables the HealthKit capability for the Glucozy Watch Complication Extension. By setting this to `true`, the extension can access health data, such as glucose levels, which is essential for its functionality.\n\n### 2. Application Groups Entitlement\n\n```xml\n<key>com.apple.security.application-groups<\/key>\n<array>\n <string>group.glucozy.shared<\/string>\n<\/array>\n```\n\n- This key specifies the application group that the Glucozy app and its extensions belong to. The `group.glucozy.shared` identifier allows for secure data sharing between the main app and the complication extension, facilitating a seamless user experience.\n\n## How It Works\n\nWhen the Glucozy Watch Complication Extension is launched, the system checks the entitlements defined in this plist file. If the entitlements are correctly configured, the extension can:\n\n- Access HealthKit data to display relevant health metrics on the watch face.\n- Share data with the main Glucozy app, ensuring that both components are synchronized and can operate cohesively.\n\n## Integration with the Codebase\n\nThe entitlements file is integrated into the build process of the Glucozy Watch Complication Extension. It is referenced in the Xcode project settings under the target's entitlements configuration. This ensures that the necessary permissions are granted when the app is installed on a device.\n\n### Example Integration\n\nIn the Xcode project, ensure that the entitlements file is linked to the Glucozy Watch Complication Extension target:\n\n1. Open the project navigator.\n2. Select the Glucozy Watch Complication Extension target.\n3. Navigate to the \"Signing & Capabilities\" tab.\n4. Ensure that the entitlements file is specified under \"Entitlements File\".\n\n## Conclusion\n\nThe `GlucozyWatchComplicationExtensionDebug.entitlements` file is a critical component for enabling HealthKit access and facilitating data sharing between the Glucozy app and its watch extension. Proper configuration of this file ensures that the extension can function correctly and provide users with timely health information. \n\nBy understanding the purpose and structure of this entitlements file, developers can effectively contribute to the Glucozy project and ensure compliance with Apple's security and privacy guidelines.","other-glucozywidgetextension-entitlements":"# Other — GlucozyWidgetExtension.entitlements\n\n# GlucozyWidgetExtension.entitlements Module Documentation\n\n## Overview\n\nThe `GlucozyWidgetExtension.entitlements` module is an XML-based property list (plist) file that defines the entitlements for the Glucozy Widget Extension. Entitlements are a mechanism used by Apple to grant specific permissions to an app or extension, allowing it to access certain system resources or capabilities.\n\n## Purpose\n\nThe primary purpose of this entitlements file is to specify the application groups that the Glucozy Widget Extension can access. This is crucial for sharing data between the main app and its extensions, ensuring that they can communicate and share resources securely.\n\n## Key Components\n\n### Entitlements Structure\n\nThe entitlements file is structured as a plist, which is a standard format used by macOS and iOS applications. Below is a breakdown of the key components within the `GlucozyWidgetExtension.entitlements` file:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>com.apple.security.application-groups<\/key>\n\t<array>\n\t\t<string>group.glucozy.shared<\/string>\n\t<\/array>\n<\/dict>\n<\/plist>\n```\n\n- **Root Element**: The root element is `<plist>`, which indicates that this is a property list.\n- **Dictionary**: The `<dict>` element contains key-value pairs that define the entitlements.\n- **Application Groups Key**: The key `com.apple.security.application-groups` specifies the application groups that the extension can access.\n- **Shared Group**: The value `group.glucozy.shared` is the identifier for the shared application group, allowing the main app and the widget extension to share data.\n\n## How It Works\n\nWhen the Glucozy Widget Extension is executed, the system checks the entitlements defined in this plist file. The specified application group (`group.glucozy.shared`) allows the extension to access shared resources, such as user defaults or files, that are stored in a common container.\n\nThis setup is essential for maintaining a seamless user experience, as it enables the widget to display and update data that is consistent with the main application.\n\n## Integration with the Codebase\n\nThe entitlements file is linked to the Glucozy Widget Extension and the main Glucozy application. The shared application group allows both components to interact with shared data. For example, if the main app updates user settings or health data, the widget can retrieve this information from the shared container.\n\n### Data Sharing Example\n\n1. **Main App**: The main Glucozy app writes data to the shared user defaults using the `UserDefaults(suiteName: \"group.glucozy.shared\")` initializer.\n2. **Widget Extension**: The Glucozy Widget Extension reads the same data from the shared user defaults, ensuring that the information displayed is up-to-date.\n\n## Conclusion\n\nThe `GlucozyWidgetExtension.entitlements` module is a critical component for enabling data sharing between the Glucozy main application and its widget extension. By defining the necessary entitlements, it ensures that both components can operate cohesively, providing a better user experience. Understanding this module is essential for developers looking to maintain or extend the functionality of the Glucozy application and its associated extensions.","other-glucozywidgetextensiondebug-entitlements":"# Other — GlucozyWidgetExtensionDebug.entitlements\n\n# GlucozyWidgetExtensionDebug.entitlements Module Documentation\n\n## Overview\n\nThe `GlucozyWidgetExtensionDebug.entitlements` module is an entitlements file used in the Glucozy application, specifically for the widget extension. Entitlements are a way to define the capabilities and permissions that an app or extension can access. This module is crucial for ensuring that the widget extension can share data securely with other parts of the Glucozy application.\n\n## Purpose\n\nThe primary purpose of this entitlements file is to grant the widget extension access to shared resources, specifically through the use of application groups. This allows the widget to communicate and share data with the main Glucozy application and other extensions that belong to the same application group.\n\n## Key Components\n\n### Entitlements Structure\n\nThe entitlements file is structured in XML format and follows the Property List (plist) format used by Apple. The key components of this file include:\n\n- **com.apple.security.application-groups**: This key defines the application groups that the extension is a part of. It is an array that can contain multiple strings, each representing a different application group.\n\n#### Example Structure\n\n```xml\n<dict>\n <key>com.apple.security.application-groups<\/key>\n <array>\n <string>group.glucozy.shared<\/string>\n <\/array>\n<\/dict>\n```\n\nIn this example, the widget extension is part of the `group.glucozy.shared` application group, which allows it to share data with other components of the Glucozy application that are also part of this group.\n\n## How It Works\n\nWhen the Glucozy widget extension is launched, the system checks the entitlements defined in this file. If the entitlements are correctly configured, the extension gains access to the shared resources defined by the application group. This includes shared user defaults, files, and other data that can be accessed by both the main application and the widget.\n\n### Data Sharing Mechanism\n\nThe data sharing mechanism relies on the application group identifier. Both the main application and the widget extension can read from and write to the same shared container, allowing for seamless data synchronization.\n\n## Integration with the Codebase\n\nThe `GlucozyWidgetExtensionDebug.entitlements` file is integrated into the Glucozy application as follows:\n\n1. **Widget Extension**: The widget extension uses the entitlements to access shared data. This is typically done through the `UserDefaults` API, where the shared suite is specified using the application group identifier.\n\n2. **Main Application**: The main Glucozy application can also access the same shared data, ensuring that any updates made by the widget are reflected in the main app and vice versa.\n\n### Example Code Snippet\n\nHere is an example of how the shared user defaults might be accessed in the widget extension:\n\n```swift\nif let sharedDefaults = UserDefaults(suiteName: \"group.glucozy.shared\") {\n // Access shared data\n let sharedValue = sharedDefaults.string(forKey: \"someKey\")\n}\n```\n\n## Conclusion\n\nThe `GlucozyWidgetExtensionDebug.entitlements` module is a critical component for enabling data sharing between the Glucozy widget extension and the main application. By defining the necessary entitlements, it ensures that both components can operate cohesively, providing a better user experience through synchronized data. Proper understanding and management of this entitlements file are essential for developers working on the Glucozy application and its extensions.","other-graphify-out":"# Other — graphify-out\n\n# Other — graphify-out Module Documentation\n\n## Overview\n\nThe **graphify-out** module is designed to analyze and visualize the relationships between various components in the codebase. It generates a graph report that summarizes the connections between nodes (components) and edges (relationships), providing insights into the structure and interdependencies of the code. This module is particularly useful for understanding complex systems, identifying key components, and detecting potential knowledge gaps.\n\n## Purpose\n\nThe primary purpose of the **graphify-out** module is to:\n- Generate a comprehensive graph report of the codebase.\n- Identify and visualize the most connected nodes (god nodes).\n- Highlight surprising connections and hyperedges that represent group relationships.\n- Detect communities within the codebase to understand how components are organized.\n- Provide insights into knowledge gaps and suggest questions for further exploration.\n\n## Key Components\n\n### 1. Graph Report Generation\n\nThe module generates a graph report that includes:\n- **Corpus Check**: Analyzes the size of the corpus and determines if a graph is necessary.\n- **Summary Statistics**: Provides an overview of the number of nodes, edges, and communities detected.\n- **God Nodes**: Lists the most connected nodes, which are critical for understanding the core abstractions in the codebase.\n- **Surprising Connections**: Highlights unexpected relationships between nodes that may not be immediately apparent.\n- **Hyperedges**: Represents group relationships among nodes, indicating how they are interconnected.\n- **Communities**: Identifies clusters of nodes that are closely related, providing insights into the organization of the codebase.\n\n### 2. Data Structures\n\nThe module utilizes various data structures to represent nodes, edges, and communities:\n- **Nodes**: Represent components in the codebase (e.g., classes, structs).\n- **Edges**: Represent relationships between nodes, indicating how they interact or depend on each other.\n- **Communities**: Group nodes that are closely related, allowing for a better understanding of the code's architecture.\n\n### 3. Knowledge Gaps\n\nThe module identifies isolated nodes and thin communities, which may indicate areas of the codebase that lack documentation or connections. This information is crucial for developers looking to improve the codebase's structure and documentation.\n\n## Execution Flow\n\nThe **graphify-out** module does not have any internal calls, outgoing calls, or incoming calls. It operates independently to generate the graph report based on the existing codebase structure.\n\n## Integration with the Codebase\n\nThe **graphify-out** module connects to the rest of the codebase by analyzing the relationships between components. It can be integrated into the development workflow to provide ongoing insights into the codebase's structure, helping developers make informed decisions about refactoring, documentation, and feature development.\n\n### Example of a God Node Connection\n\n```mermaid\ngraph TD;\n A[GlucozyViewModel] -->|37 edges| B[GlucoseSparklineView];\n A -->|14 edges| C[BLE];\n A -->|10 edges| D[L10n];\n```\n\n## Conclusion\n\nThe **graphify-out** module is a powerful tool for visualizing and understanding the relationships within a codebase. By generating detailed reports and highlighting key components, it aids developers in identifying areas for improvement and enhancing the overall architecture of the system. This module is essential for maintaining a well-structured and documented codebase, ultimately leading to better collaboration and more efficient development processes.","other-spec-md":"# Other — Spec.md\n\n# Glucozy — Technical Specification for Claude Code\n\n## Overview\n\nGlucozy is a privacy-first blood glucose viewer designed for iOS and watchOS, focusing on reading glucose data from Apple HealthKit. The application is built with Swift 5.9+ and utilizes SwiftUI for its user interface, following the MVVM architecture pattern. The app is designed to operate without any network access, ensuring that all data remains on the device.\n\n## Architecture\n\n### Current State\n\n- **Architecture**: The current implementation uses UIKit and MVC, with the entry point defined in `AppDelegate` and UI managed through storyboards. The app does not utilize SwiftUI or the MVVM pattern as specified.\n- **Concurrency**: The app does not leverage Swift Concurrency (async/await) for HealthKit interactions, relying instead on callback-based methods.\n\n### Future State\n\nThe intended architecture aims to transition to a SwiftUI-based interface with MVVM, utilizing async/await for asynchronous operations. This will enhance code readability and maintainability.\n\n```mermaid\ngraph TD;\n A[AppDelegate] --> B[ViewController]\n B --> C[HealthKitManager]\n C --> D[GlucoseProcessor]\n D --> E[DashboardViewModel]\n E --> F[DashboardView]\n```\n\n## Project Structure\n\nThe project is organized into several key directories, each serving a specific purpose:\n\n- **App**: Contains the main application entry point and the AppDelegate for HealthKit background delivery registration.\n- **Models**: Defines data structures such as `GlucoseReading`, `GlucoseUnit`, and `TargetRange`.\n- **Services**: Manages interactions with HealthKit and processes glucose data.\n- **ViewModels**: Holds the state for various views, including the dashboard and settings.\n- **Views**: Contains SwiftUI views for the dashboard, settings, and onboarding.\n- **Widgets**: Implements home screen and lock screen widgets.\n- **Extensions**: Provides utility extensions for common types.\n- **Resources**: Includes assets and localization files.\n\n## Key Components\n\n### Data Models\n\n#### GlucoseReading\n\nThe `GlucoseReading` struct represents a single glucose measurement, including methods for displaying values in user-preferred units and determining range status.\n\n```swift\nstruct GlucoseReading: Identifiable, Codable, Comparable {\n let id: UUID\n let value: Double\n let date: Date\n let source: String?\n\n func displayValue(unit: GlucoseUnit) -> Double { ... }\n func rangeStatus(target: TargetRange) -> RangeStatus { ... }\n}\n```\n\n#### GlucoseUnit\n\nAn enum representing the units of measurement for glucose readings, supporting both mg/dL and mmol/L.\n\n```swift\nenum GlucoseUnit: String, Codable, CaseIterable {\n case mgdL = \"mg/dL\"\n case mmolL = \"mmol/L\"\n}\n```\n\n#### TargetRange\n\nA struct that defines the user's target glucose range, including validation for clinically reasonable bounds.\n\n```swift\nstruct TargetRange: Codable {\n var low: Double\n var high: Double\n}\n```\n\n### HealthKit Integration\n\n#### HealthKitManager\n\nThe `HealthKitManager` class is responsible for all interactions with HealthKit, including requesting authorization, fetching readings, and enabling background delivery.\n\n```swift\n@MainActor\nclass HealthKitManager: ObservableObject {\n private let healthStore = HKHealthStore()\n private let glucoseType = HKQuantityType(.bloodGlucose)\n\n func requestAuthorization() async throws { ... }\n func fetchReadings(for period: TimePeriod) async throws -> [GlucoseReading] { ... }\n}\n```\n\n### Glucose Processing\n\n#### GlucoseProcessor\n\nThis struct contains methods for calculating trends, estimating A1C, and determining time in range for glucose readings.\n\n```swift\nstruct GlucoseProcessor {\n static func calculateTrend(from readings: [GlucoseReading]) -> TrendDirection { ... }\n static func estimatedA1C(from readings: [GlucoseReading]) -> Double? { ... }\n}\n```\n\n### User Preferences\n\n#### UserPreferences\n\nA class that manages user preferences using `@AppStorage`, allowing for easy access to settings like glucose unit and target range.\n\n```swift\nclass UserPreferences: ObservableObject {\n @AppStorage(\"glucoseUnit\") var glucoseUnit: GlucoseUnit = .mgdL\n @AppStorage(\"targetRangeLow\") var targetRangeLow: Double = 70.0\n}\n```\n\n## User Interface\n\n### Dashboard View\n\nThe dashboard serves as the main screen, displaying the current glucose reading, trend graph, and statistics. It is designed to be simple and intuitive, with a focus on immediate access to critical information.\n\n### Settings View\n\nThe settings view allows users to configure their preferred glucose unit and target range. It is minimalistic, ensuring that users can quickly adjust their preferences.\n\n### Onboarding Flow\n\nThe onboarding process consists of a maximum of three screens, guiding users through the initial setup, including HealthKit permission requests and target range configuration.\n\n## Watch Connectivity\n\nThe app uses `WCSession` to sync user preferences between the iPhone and Apple Watch. However, it does not sync glucose data, as the watch should independently query HealthKit.\n\n## PDF Report Generation\n\nA feature for generating a PDF report summarizing glucose data is planned but not yet implemented. This report will include statistics and trend graphs for user convenience during doctor visits.\n\n## Testing Requirements\n\nUnit tests are required for critical functions, including trend calculations and A1C estimations. A manual testing checklist is also provided to ensure the app functions correctly across various scenarios.\n\n## Conclusion\n\nGlucozy is designed to be a straightforward, privacy-focused application for managing blood glucose readings. While the current implementation diverges from the specified architecture and features, there is a clear path forward to align with the original vision, enhancing both functionality and user experience.","other-specs-landing-page":"# Other — specs-landing-page\n\n# Other — specs-landing-page Module Documentation\n\n## Overview\n\nThe **specs-landing-page** module is designed to create a responsive single-page landing site for the Glucozy iOS app. This page serves as a marketing tool, showcasing the app's features, benefits, and user testimonials while maintaining a design language consistent with the app's UI.\n\n## Purpose\n\nThe primary purpose of this module is to provide a visually appealing and informative landing page that encourages users to download the Glucozy app. It highlights key functionalities such as Bluetooth syncing, HealthKit integration, and user insights, all while adhering to a clean and medical-grade aesthetic.\n\n## Key Components\n\n### 1. Design Language\n\nThe landing page follows a strict design language to ensure consistency with the Glucozy app. Key design tokens include:\n\n- **Colors**: Specific hex values for backgrounds, text, and UI elements.\n- **Typography**: Defined font families and sizes for headlines, body text, and glucose values.\n- **Spacing & Radius**: Standardized spacing and border-radius values for UI elements.\n- **Motion**: Guidelines for animations and transitions to enhance user experience.\n\n### 2. Page Structure\n\nThe landing page is divided into several sections, each serving a distinct purpose:\n\n- **Hero Section**: Introduces the app with a prominent headline, subhead, and call-to-action buttons.\n- **Features Section**: Displays key features in a grid layout, using icons and brief descriptions.\n- **How It Works Section**: Outlines the app's functionality in three simple steps.\n- **App Preview Section**: Provides a visual representation of the app's interface.\n- **Testimonial Section**: (Optional) Displays user feedback to build trust.\n- **CTA Banner**: Encourages users to download the app with a clear call-to-action.\n- **Footer**: Contains essential links and legal disclaimers.\n\n### 3. Technical Requirements\n\nThe module adheres to specific technical requirements to ensure performance and accessibility:\n\n- **Single HTML File**: The entire landing page is contained within a single HTML file with embedded CSS.\n- **Dark Mode Support**: Utilizes media queries to adjust styles based on user preferences.\n- **Responsive Design**: Mobile-first approach with breakpoints at 640px and 1024px.\n- **Accessibility**: Follows semantic HTML5 practices, ensuring proper heading hierarchy and sufficient contrast.\n- **Performance**: Optimized for size and speed, with inline SVGs and a focus on system fonts.\n\n## How It Works\n\nThe landing page is structured using standard HTML and CSS practices. Each section is defined using semantic HTML elements, ensuring that the content is both accessible and SEO-friendly. The CSS is embedded within the HTML file, allowing for easy customization and maintenance.\n\n### Example Structure\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Glucozy Landing Page<\/title>\n <style>\n /* Embedded CSS for styling */\n <\/style>\n<\/head>\n<body>\n <header>\n <!-- Hero Section -->\n <\/header>\n <main>\n <!-- Features Section -->\n <!-- How It Works Section -->\n <!-- App Preview Section -->\n <!-- Testimonial Section -->\n <!-- CTA Banner -->\n <\/main>\n <footer>\n <!-- Footer Section -->\n <\/footer>\n<\/body>\n<\/html>\n```\n\n## Connection to the Codebase\n\nThis module operates independently but is designed to integrate seamlessly with the Glucozy app ecosystem. The landing page can be linked from the app or shared via marketing channels, driving traffic to the app download page.\n\n### Mermaid Diagram\n\n```mermaid\ngraph TD;\n A[Landing Page] --> B[Hero Section];\n A --> C[Features Section];\n A --> D[How It Works Section];\n A --> E[App Preview Section];\n A --> F[Testimonial Section];\n A --> G[CTA Banner];\n A --> H[Footer];\n```\n\n## Conclusion\n\nThe **specs-landing-page** module is a crucial component of the Glucozy marketing strategy, designed to attract and inform potential users. By adhering to a defined design language and technical requirements, it ensures a consistent and high-quality user experience that aligns with the Glucozy brand. Developers contributing to this module should focus on maintaining these standards while enhancing the page's functionality and aesthetics.","other-tasks":"# Other — tasks\n\n# Other — Tasks Module Documentation\n\n## Overview\n\nThe **Other — tasks** module is responsible for localizing the app into English, German, and French. It identifies hardcoded strings in the codebase, extracts them into localization files, and ensures that all user-facing text is properly translated and displayed according to the user's language preference. This module encompasses tasks related to the main iOS app, Watch app, Widget extension, and Watch complication.\n\n## Purpose\n\nThe primary goal of this module is to enhance the user experience by providing a fully localized application. This involves:\n- Extracting hardcoded strings from various components of the app.\n- Creating and populating localization files for different languages.\n- Ensuring that all components of the app, including extensions, are properly localized.\n\n## Key Components\n\n### 1. Localization Structure\n\nThe localization is structured using `.lproj` folders for each language, containing `Localizable.strings` files for string translations and `InfoPlist.strings` for permission-related strings. The following languages are supported:\n- English (`en`)\n- German (`de`)\n- French (`fr`)\n\n### 2. Tasks Overview\n\nThe localization process is divided into two phases, each containing specific tasks:\n\n#### Phase 1 — Extract Hardcoded Strings (English and German)\n\n- **Task 1**: Extract iOS view strings into `L10n`\n - Modifies `Strings.swift` to add new localization keys.\n - Updates `Localizable.strings` for English and German with new keys.\n - Replaces hardcoded strings in various Swift files.\n\n- **Task 2**: Watch app localization\n - Creates localization files for the Watch app.\n - Replaces hardcoded strings in Watch app views.\n\n- **Task 3**: Widget extension localization\n - Creates localization files for the Widget extension.\n - Replaces hardcoded strings in the Widget code.\n\n- **Task 4**: Watch complication localization\n - Creates localization files for the Watch complication.\n - Replaces hardcoded strings in the complication code.\n\n#### Phase 2 — Add French Localization\n\n- **Task 5**: French translations for the iOS main app\n - Creates `fr.lproj` files and populates them with French translations.\n\n- **Task 6**: French translations for Watch, Widget, and Complication\n - Creates localization files for the Watch app, Widget, and Complication in French.\n\n- **Task 7**: Register French in the project and verify\n - Updates the project configuration to include French in `knownRegions`.\n - Conducts thorough testing to ensure all languages work correctly.\n\n### 3. Dependency Graph\n\nThe tasks are interdependent, particularly in the transition from English and German to French. The following diagram illustrates the dependencies:\n\n```mermaid\ngraph TD;\n A[Task 1: Extract iOS strings] --> B[Task 5: French - main app];\n A --> C[Task 2: Watch infra + extract];\n A --> D[Task 3: Widget infra + extract];\n A --> E[Task 4: Complication infra + extract];\n C --> F[Task 6: French - Watch];\n D --> F;\n E --> F;\n A --> G[CHECKPOINT];\n G --> H[Task 7: Register fr in project + verify];\n```\n\n## Implementation Details\n\n### Localization Keys\n\nEach task involves adding specific localization keys to the `Localizable.strings` files. For example, Task 1 introduces keys such as:\n- `detail.title` = \"Reading Detail\"\n- `action.done` = \"Done\"\n- `empty.title` = \"No Readings Yet\"\n\n### Accessing Localized Strings\n\nIn SwiftUI views, use `Text(\"key\")` for automatic localization. For UIKit components, use `NSLocalizedString(\"key\", comment: \"\")` to fetch the localized string from the appropriate bundle.\n\n### Acceptance Criteria\n\nEach task has defined acceptance criteria to ensure successful implementation:\n- No hardcoded strings remain in the codebase.\n- The app builds successfully in all supported languages.\n- All user-facing strings display correctly in the respective languages.\n\n## Conclusion\n\nThe **Other — tasks** module is crucial for ensuring that the application is accessible to a wider audience through localization. By systematically extracting and translating strings, the module enhances the user experience and maintains consistency across different components of the app. Developers contributing to this module should follow the outlined tasks and adhere to the acceptance criteria to ensure a successful localization process.","other":"# Other\n\n# Other Module Overview\n\n## Purpose\n\nThe **Other** module serves as a comprehensive collection of components that support the development, localization, and deployment of the Glucozy application, which focuses on blood glucose monitoring. This module encompasses various sub-modules that facilitate project management, asset organization, localization, and continuous integration, ensuring a cohesive development experience.\n\n## Sub-module Integration\n\nThe sub-modules within the Other module work together to streamline the development process:\n\n- **[CLAUDE.md](CLAUDE.md)** provides guidelines for managing the codebase, including versioning and release notes, which are essential for maintaining project consistency.\n- **[Gemfile](Gemfile)** specifies the dependencies required for the project, ensuring that all developers work with the same library versions.\n- **[Glucometer.xcodeproj](Glucometer.xcodeproj)** and **[Glucometer.xcodeproj-project.xcworkspace](Glucometer.xcodeproj-project.xcworkspace)** organize the Xcode project structure, allowing for efficient management of the main app and its extensions.\n- **[Glucometer.xcodeproj-xcshareddata](Glucometer.xcodeproj-xcshareddata)** defines shared build configurations, ensuring that all components are built and tested consistently.\n- **[Glucometer-Assets.xcassets](Glucometer-Assets.xcassets)** and **[GlucometerWatch Watch App-Assets.xcassets](GlucometerWatch Watch App-Assets.xcassets)** manage visual assets, providing a centralized location for UI elements like colors and icons.\n- **Localization modules** such as **[Glucometer-en.lproj](Glucometer-en.lproj)**, **[Glucometer-de.lproj](Glucometer-de.lproj)**, and **[Glucometer-fr.lproj](Glucometer-fr.lproj)** ensure that the application is accessible to users in multiple languages by managing user interface text and alerts.\n- **[fastlane](fastlane)** automates the build and deployment process to TestFlight, enhancing the CI/CD pipeline.\n- **[tasks](tasks)** focuses on extracting and managing localization strings across all components, ensuring a fully localized application experience.\n\n## Key Workflows\n\n1. **Development Workflow**: Developers utilize the guidelines from CLAUDE.md and the Gemfile to set up their environments and manage dependencies. The Xcode project structure facilitates the organization of the main app and its extensions.\n\n2. **Localization Workflow**: The tasks module extracts hardcoded strings and populates localization files, allowing the app to present user-facing text in English, German, and French.\n\n3. **Deployment Workflow**: The fastlane module automates the build process, ensuring that the application is versioned and uploaded to TestFlight efficiently.\n\nBy integrating these sub-modules, the Other module enhances the overall development process, ensuring that the Glucozy application is well-structured, localized, and ready for deployment.","overview":"# Glucometer — Wiki\n\n# Glucometer\n\nWelcome to the Glucometer project! This application is designed to help users monitor their blood glucose levels effectively and conveniently. By integrating with Bluetooth-enabled glucose meters and Apple HealthKit, Glucometer provides real-time data, historical trends, and personalized insights to support users in managing their health.\n\n## Architecture Overview\n\nThe Glucometer application is structured around several key modules that work together to deliver a seamless user experience. The architecture is designed to ensure clear separation of concerns, making it easier to maintain and extend the application. Below is a high-level overview of the main modules and their interactions:\n\n```mermaid\ngraph TD;\n A[Core Application] -->|initializes| B[Services]\n A -->|manages| C[Data Models]\n A -->|provides UI| D[User Interface]\n B -->|communicates with| C\n C -->|supplies data to| D\n D -->|interacts with| E[View Models]\n D -->|displays on| F[Watch App]\n D -->|displays on| G[Widget]\n F -->|uses| H[Watch Complication]\n```\n\n### Key Modules\n\n- **[Core Application](core-application.md)**: The entry point of the Glucometer app, responsible for managing the application lifecycle and initializing critical components like Bluetooth communication and data management.\n\n- **[Services](services.md)**: Manages Bluetooth Low Energy (BLE) interactions with glucose meters and handles background synchronization of glucose readings.\n\n- **[Data Models](data-models.md)**: Responsible for parsing glucose data from BLE devices and managing interactions with HealthKit.\n\n- **[User Interface](user-interface.md)**: A framework that enhances user interaction through UIKit and SwiftUI components, ensuring a cohesive and responsive design.\n\n- **[View Models](view-models.md)**: Facilitates communication between the UI and the underlying data model, adhering to the MVVM architectural pattern.\n\n- **[Watch App](watch-app.md)**: Provides real-time glucose monitoring on Apple Watch, displaying the latest readings and statistics.\n\n- **[Widget](widget.md)**: Offers an iOS widget for displaying glucose readings on the home and lock screens.\n\n- **[Watch Complication](watch-complication.md)**: Displays real-time glucose data in various styles on the Apple Watch.\n\n## Getting Started\n\nTo set up the Glucometer project locally, follow these steps:\n\n1. **Clone the repository**:\n ```bash\n git clone https://github.com/yourusername/glucometer.git\n cd glucometer\n ```\n\n2. **Install dependencies**:\n Ensure you have the necessary dependencies installed. You can use CocoaPods or Swift Package Manager as per the project configuration.\n\n3. **Open the project**:\n Open the project in Xcode and run it on a simulator or a physical device.\n\n4. **Connect a Bluetooth glucose meter**:\n Make sure to pair your Bluetooth glucose meter with your device to start receiving data.\n\n## Conclusion\n\nThe Glucometer project is designed to empower users in managing their health through effective glucose monitoring. By leveraging modern technologies and a modular architecture, we aim to provide a reliable and user-friendly experience. For more detailed information on each module, please explore the linked documentation. Welcome aboard, and happy coding!","services":"# Services\n\n# Services Module Documentation\n\nThe **Services** module is responsible for managing Bluetooth Low Energy (BLE) interactions with glucose meters, handling background synchronization of glucose readings, and integrating with Apple HealthKit and WatchConnectivity. This module is designed to provide a seamless experience for users monitoring their glucose levels, ensuring that data is accurately collected, stored, and presented in real-time.\n\n## Overview\n\nThe Services module consists of several key components:\n\n1. **BLE**: Manages BLE connections and data transfer with glucose meters.\n2. **BackgroundSyncManager**: Handles background polling for glucose data updates.\n3. **GlucoseLiveActivity**: Manages real-time updates for glucose readings on iOS devices.\n4. **GlucoseNotificationManager**: Sends local notifications to inform users of glucose readings.\n5. **HealthKitManager**: Interfaces with Apple HealthKit to store and retrieve glucose readings.\n6. **WatchSync**: Sends glucose readings to the Apple Watch.\n\n## Key Components\n\n### 1. BLE\n\nThe `BLE` class is the core of the Services module, responsible for:\n\n- Scanning for and connecting to glucose meters that implement the Bluetooth SIG Glucose Profile.\n- Subscribing to GATT notifications for glucose measurements, context, and Record Access Control Point (RACP) characteristics.\n- Assembling raw notification bytes into structured data tuples for higher-level processing.\n- Firing delegate callbacks to notify other components (e.g., `GlucozyViewModel`, `BackgroundSyncManager`) of BLE events.\n\n#### Key Methods\n\n- `startBLE()`: Initializes the `CBCentralManager` for BLE operations.\n- `scan()`: Starts scanning for peripherals advertising the glucose service.\n- `connect(peripheral: CBPeripheral)`: Connects to a discovered peripheral.\n- `doWrite(peripheral: CBPeripheral, characteristic: CBCharacteristic, message: [UInt8])`: Sends commands to the glucose meter.\n\n### 2. BackgroundSyncManager\n\nThe `BackgroundSyncManager` class manages a polling window for glucose data updates after a meter connects. It operates in two modes:\n\n- **Foreground**: Triggers UI updates via the `GlucozyViewModel`.\n- **Headless**: Operates without a UI, directly handling BLE events and issuing RACP commands.\n\n#### Key Methods\n\n- `startPollingWindow()`: Begins the polling process for glucose data.\n- `stopPolling(scheduleReconnect: Bool)`: Stops the polling and optionally schedules reconnections.\n- `issueHeadlessSync()`: Issues a sync command when operating in headless mode.\n\n### 3. GlucoseLiveActivity\n\nThe `GlucoseLiveActivity` component manages the display of glucose readings in real-time on the iOS Dynamic Island and Lock Screen. It consists of:\n\n- `GlucoseActivityAttributes`: Defines the attributes for the live activity.\n- `GlucoseLiveActivityManager`: Singleton that starts, updates, and ends the live activity.\n\n#### Key Methods\n\n- `update(value: Double, date: Date, trend: Double)`: Updates the live activity with the latest glucose reading.\n- `end()`: Dismisses all running live activities.\n\n### 4. GlucoseNotificationManager\n\nThe `GlucoseNotificationManager` class is responsible for delivering local notifications to users after a background sync. It ensures that users are informed of their latest glucose readings even when the app is not visible.\n\n#### Key Methods\n\n- `requestPermission()`: Requests notification permissions from the user.\n- `show(count: Int, value: Double, trend: Double)`: Posts an immediate notification summarizing the sync result.\n\n### 5. HealthKitManager\n\nThe `HealthKitManager` class serves as the persistence layer for glucose readings, interfacing with Apple HealthKit. It handles:\n\n- Requesting authorization for reading and writing glucose data.\n- Writing individual or batch glucose readings to HealthKit.\n- Loading recent glucose readings for display.\n\n#### Key Methods\n\n- `requestAuthorization()`: Requests HealthKit permissions.\n- `writeBloodGlucoseToHealthKit(...)`: Writes a single glucose reading to HealthKit.\n- `batchWriteRecords(_ records: [BatchGlucoseRecord])`: Writes a batch of glucose readings to HealthKit.\n\n### 6. WatchSync\n\nThe `WatchSync` class manages the communication between the iOS app and the Apple Watch, ensuring that the latest glucose readings are sent immediately after each sync.\n\n#### Key Methods\n\n- `activate()`: Activates the WatchConnectivity session.\n- `send(value: Double, trend: Double, date: Date)`: Sends the latest glucose reading to the Apple Watch.\n\n## Architecture Overview\n\n```mermaid\ngraph TD;\n A[BLE] -->|connects to| B[Glucose Meter]\n A -->|notifies| C[BackgroundSyncManager]\n C -->|triggers| D[HealthKitManager]\n C -->|sends notifications| E[GlucoseNotificationManager]\n C -->|updates| F[GlucoseLiveActivity]\n C -->|syncs| G[WatchSync]\n```\n\n## Integration with the Codebase\n\nThe Services module interacts with other parts of the application as follows:\n\n- **GlucozyViewModel**: Receives updates from the `BLE` class and triggers UI updates.\n- **BackgroundSyncManager**: Acts as a delegate for BLE events when the app is in headless mode.\n- **HealthKitManager**: Stores glucose readings and retrieves them for display in the UI.\n- **WatchSync**: Sends glucose readings to the Apple Watch for real-time updates.\n\n## Conclusion\n\nThe Services module is a critical component of the Glucometer application, providing robust management of BLE interactions, background data synchronization, and integration with health monitoring systems. Understanding its structure and functionality is essential for developers looking to contribute to or extend the capabilities of the application.","user-interface-uikit":"# User Interface — UIKit\n\n# User Interface — UIKit Module\n\n## Overview\n\nThe UIKit module of the Glucometer application provides a set of reusable UI components and view controllers that facilitate user interaction with the application. This module is designed to present information about glucometers, manage user onboarding, and visualize glucose data through various UI elements. It leverages UIKit for building the interface, ensuring a consistent and responsive user experience.\n\n## Key Components\n\n### 1. BadgeLabel\n\n**File:** `BadgeLabel.swift`\n\n**Purpose:** \n`BadgeLabel` is a reusable UI component that displays a colored capsule badge with centered text. It is primarily used in table cells to indicate status or classification.\n\n**Key Features:**\n- Configurable text and color via the `configure(text:color:)` method.\n- Automatically sizes based on content with padding defined by the design system.\n\n**Usage Example:**\n```swift\nlet badge = BadgeLabel()\nbadge.configure(text: \"Connected\", color: .systemGreen)\n```\n\n### 2. DeviceManagerViewController\n\n**File:** `DeviceManagerViewController.swift`\n\n**Purpose:** \n`DeviceManagerViewController` is a table view controller that lists all paired glucometers. It provides functionalities for managing devices, including scanning for new devices, renaming, and forgetting devices.\n\n**Key Features:**\n- Displays device name, connection status, last sync information, and timestamps.\n- Supports swipe-to-delete and context menus for additional actions.\n- Integrates with `DeviceStore` for persistent storage of device information.\n\n**Lifecycle:**\n- `viewDidLoad()`: Initializes the view, sets up the navigation bar, and loads devices.\n- `reload()`: Fetches devices from `DeviceStore` and refreshes the table view.\n\n**Usage Example:**\n```swift\nlet deviceManagerVC = DeviceManagerViewController()\ndeviceManagerVC.onScanRequested = { /* Handle scan request */ }\n```\n\n### 3. GlucoseSparklineView\n\n**File:** `GlucoseSparklineView.swift`\n\n**Purpose:** \n`GlucoseSparklineView` is a custom UIView that visualizes a time-series line chart of blood glucose readings. It provides an interactive experience with features like a crosshair for displaying data points.\n\n**Key Features:**\n- Adaptive Y-axis with \"nice\" round tick values.\n- Target-range band visualization and per-point markers.\n- Interactive crosshair that shows values and timestamps on tap or pan gestures.\n\n**Drawing Logic:**\n- The view uses Core Graphics to render the chart in the `draw(_:)` method, calculating positions based on the data provided.\n\n**Usage Example:**\n```swift\nlet sparklineView = GlucoseSparklineView()\nsparklineView.values = [90, 110, 130, 150]\nsparklineView.dates = [Date(), Date().addingTimeInterval(-3600), Date().addingTimeInterval(-7200)]\n```\n\n### 4. OnboardingViewController\n\n**File:** `OnboardingViewController.swift`\n\n**Purpose:** \n`OnboardingViewController` manages the onboarding process for first-time users. It guides users through necessary permissions and device pairing steps.\n\n**Key Features:**\n- Step-by-step onboarding with customizable steps.\n- Integrates SwiftUI for the pairing step using `OnboardingPairingView`.\n- Handles user actions for permissions and device pairing.\n\n**Step Management:**\n- Each step is represented by a `Step` struct containing relevant information (icon, title, body text).\n- The `apply(step:animated:)` method transitions between steps with optional animations.\n\n**Usage Example:**\n```swift\nlet onboardingVC = OnboardingViewController()\nonboardingVC.onComplete = { /* Handle completion */ }\n```\n\n## Architecture Overview\n\nThe UIKit module is structured to provide a clear separation of concerns, with each component handling specific responsibilities. The following diagram illustrates the relationships between the key components:\n\n```mermaid\ngraph TD;\n A[OnboardingViewController] -->|navigates to| B[DeviceManagerViewController];\n B -->|displays| C[BadgeLabel];\n B -->|uses| D[GlucoseSparklineView];\n A -->|contains| D;\n```\n\n## Integration with the Codebase\n\n- **Device Management:** The `DeviceManagerViewController` interacts with the `DeviceStore` to manage device data, ensuring that the UI reflects the current state of paired devices.\n- **Data Visualization:** The `GlucoseSparklineView` is used in various contexts to visualize glucose data, providing users with insights into their readings.\n- **User Onboarding:** The onboarding process is crucial for first-time users, ensuring they grant necessary permissions and understand how to use the app effectively.\n\n## Conclusion\n\nThe UIKit module is a vital part of the Glucometer application, providing essential UI components and controllers that enhance user interaction and data visualization. By adhering to the principles of modular design, this module allows for easy maintenance and extensibility, enabling developers to contribute effectively to the codebase.","user-interface-views":"# User Interface — Views\n\n# User Interface — Views Module\n\nThe **User Interface — Views** module is a collection of SwiftUI views designed for the Glucometer application. This module provides a cohesive user interface for displaying glucose readings, managing device connections, and presenting insights into user data. The views are structured to enhance user experience through intuitive design and responsive interactions.\n\n## Overview\n\nThe module consists of various views that serve different purposes within the application. These include:\n\n- **CollapsibleSection**: A reusable component for creating collapsible sections in the UI.\n- **ConnectionBannerView**: Displays the connection status of the Bluetooth device.\n- **ContentView**: The root view that manages navigation and displays different screens based on the application state.\n- **DataListView**: Presents a list of glucose readings and insights.\n- **EmptyStateView**: Shown when there are no glucose readings available.\n- **GlucoseDetailView**: A detailed view for a single glucose reading.\n- **SettingsView**: Allows users to configure application settings.\n- **TargetRangeSheet**: A modal sheet for setting glucose target ranges.\n\n## Key Components\n\n### 1. CollapsibleSection\n\n```swift\nstruct CollapsibleSection<Content: View>: View {\n // Properties\n let title: String\n let infoText: String?\n let collapsedSummary: String?\n let content: Content\n @State private var isExpanded: Bool\n // ...\n}\n```\n\n- **Purpose**: Provides a collapsible section that can show or hide additional content.\n- **Usage**: Can be used to group related information, such as statistics or insights, allowing users to expand or collapse sections as needed.\n\n### 2. ConnectionBannerView\n\n```swift\nstruct ConnectionBannerView: View {\n let text: String?\n // ...\n}\n```\n\n- **Purpose**: Displays a banner at the top of the screen indicating the current Bluetooth connection status.\n- **Behavior**: The banner slides in and out based on the connection state.\n\n### 3. ContentView\n\n```swift\nstruct ContentView: View {\n @ObservedObject var vm: GlucozyViewModel\n // ...\n}\n```\n\n- **Purpose**: The main entry point for the user interface, managing navigation between different views.\n- **Components**: It conditionally displays the `ScannerView`, `DataListView`, or `EmptyStateView` based on the application's state.\n\n### 4. DataListView\n\n```swift\nstruct DataListView: View {\n @ObservedObject var vm: GlucozyViewModel\n // ...\n}\n```\n\n- **Purpose**: Displays a list of glucose readings, insights, and statistics.\n- **Features**: Includes filtering options and collapsible sections for insights.\n\n### 5. EmptyStateView\n\n```swift\nstruct EmptyStateView: View {\n @ObservedObject var vm: GlucozyViewModel\n // ...\n}\n```\n\n- **Purpose**: Shown when there are no glucose readings available, encouraging users to connect their device.\n- **Components**: Includes a button to initiate scanning for devices.\n\n### 6. GlucoseDetailView\n\n```swift\nstruct GlucoseDetailView: View {\n @ObservedObject var vm: GlucozyViewModel\n // ...\n}\n```\n\n- **Purpose**: Provides detailed information about a specific glucose reading, including options to add notes and share the reading.\n- **Components**: Displays a hero card with the glucose value and additional metadata.\n\n### 7. SettingsView\n\n```swift\nstruct SettingsView: View {\n @ObservedObject var vm: GlucozyViewModel\n // ...\n}\n```\n\n- **Purpose**: Allows users to configure application settings, including glucose units and target ranges.\n- **Components**: Includes buttons to manage devices and review permissions.\n\n### 8. TargetRangeSheet\n\n```swift\nstruct TargetRangeSheet: View {\n let onSave: (Int, Int) -> Void\n // ...\n}\n```\n\n- **Purpose**: A modal sheet for users to set their glucose target ranges.\n- **Validation**: Ensures that the input values are within acceptable limits.\n\n## Interaction Flow\n\nThe views in this module interact with the `GlucozyViewModel`, which manages the application's state and data. The `ContentView` serves as the main hub, directing users to different views based on their actions and the current state of the application.\n\n```mermaid\ngraph TD;\n A[ContentView] -->|Navigates to| B[ScannerView]\n A -->|Displays| C[DataListView]\n A -->|Shows| D[EmptyStateView]\n C -->|Shows details for| E[GlucoseDetailView]\n A -->|Opens| F[SettingsView]\n F -->|Opens| G[TargetRangeSheet]\n```\n\n## Conclusion\n\nThe **User Interface — Views** module is essential for providing a user-friendly experience in the Glucometer application. By leveraging SwiftUI's capabilities, the module ensures that users can easily navigate through their glucose data, manage device connections, and configure settings. Each component is designed to be reusable and maintainable, allowing for future enhancements and scalability.","user-interface":"# User Interface\n\n# User Interface Module\n\n## Overview\n\nThe User Interface module of the Glucometer application is a comprehensive framework designed to enhance user interaction through a combination of UIKit and SwiftUI components. This module is divided into two primary sub-modules: [UIKit](#user-interface-uikit) and [Views](#user-interface-views), each serving distinct yet complementary roles in delivering a seamless user experience.\n\n### Sub-modules\n\n- **[User Interface — UIKit](#user-interface-uikit)**: This sub-module provides reusable UI components and view controllers built with UIKit. It focuses on presenting information about glucometers, managing user onboarding, and visualizing glucose data. Key components like `BadgeLabel` are utilized to indicate status or classification within the app's interface.\n\n- **[User Interface — Views](#user-interface-views)**: This sub-module consists of SwiftUI views that create a cohesive interface for displaying glucose readings and managing device connections. Components such as `CollapsibleSection` and `ConnectionBannerView` enhance the user experience by providing intuitive navigation and real-time feedback on device status.\n\n### Integration and Workflows\n\nThe integration of UIKit and SwiftUI within the User Interface module allows for a flexible and responsive design. The UIKit components can be embedded within SwiftUI views, enabling developers to leverage the strengths of both frameworks. For instance, the `ContentView` in the Views module serves as the main navigation hub, orchestrating the display of various UIKit components and SwiftUI views to create a unified experience.\n\nKey workflows include:\n- User onboarding facilitated by UIKit components, guiding users through initial setup.\n- Real-time visualization of glucose data using SwiftUI views, ensuring users can easily interpret their readings.\n- Device connection management, where the `ConnectionBannerView` provides immediate feedback on Bluetooth status, enhancing user confidence in device functionality.\n\nThis modular approach not only streamlines development but also ensures that the user interface remains consistent and engaging across different functionalities of the Glucometer application.","utilities":"# Utilities\n\n# Utilities Module Documentation\n\nThe **Utilities** module provides essential functionalities for managing blood glucose data within the Glucometer application. It encompasses App Intents for Siri and Shortcuts integration, UserDefaults-backed storage for user notes and meal overrides, and shared utility functions for glucose data processing.\n\n## Overview\n\nThe Utilities module is divided into three main components:\n\n1. **GlucoseIntents.swift**: Defines App Intents for retrieving the latest glucose readings and glucose statistics.\n2. **GlucoseStorage.swift**: Manages user notes and meal overrides using UserDefaults.\n3. **GlucoseUtils.swift**: Contains shared utility functions for glucose data calculations and conversions.\n\n## Key Components\n\n### 1. GlucoseIntents.swift\n\nThis file exposes two App Intents:\n\n- **GetLatestGlucoseIntent**: Fetches the most recent blood glucose reading, including trend and status.\n- **GetGlucoseStatsIntent**: Provides a time-in-range (TIR) breakdown and estimated A1c for a specified number of days.\n\n#### Fetching Glucose Data\n\nBoth intents utilize the `fetchRecentSamples(limit:)` function to retrieve blood glucose samples from HealthKit. This function ensures that the app has the necessary authorization to access HealthKit data and returns the most recent samples sorted by date.\n\n```swift\nprivate func fetchRecentSamples(limit: Int) async -> [HKQuantitySample]\n```\n\n#### Error Handling\n\nThe `GlucoseIntentError` enum defines potential errors that can occur when fetching glucose data, specifically the `noData` case, which provides a user-friendly message.\n\n### 2. GlucoseStorage.swift\n\nThis file manages user-specific notes and meal overrides for glucose readings. It uses UserDefaults for persistent storage and caches data in memory for efficient access.\n\n#### Key Functions\n\n- **glucoseNote(forSequence:)**: Retrieves a user-authored note for a specific glucose reading.\n- **setGlucoseNote(_:forSequence:)**: Saves or removes a note for a given sequence number.\n- **glucoseMealOverride(forSequence:)**: Fetches the meal label override for a specific reading.\n- **setGlucoseMealOverride(_:forSequence:)**: Saves a meal override or clears it.\n\n### 3. GlucoseUtils.swift\n\nThis file contains utility functions for glucose data processing, including trend calculations and A1c estimations.\n\n#### Key Functions\n\n- **trendSymbol(rate:)**: Converts a rate of change in glucose levels to a directional arrow symbol.\n- **tirBreakdown(_ values:low:high:)**: Computes the percentage of readings that fall within specified low and high thresholds.\n- **estimatedA1c(_ values:)**: Estimates the A1c value based on the mean glucose over a specified period.\n\n### App Shortcuts Integration\n\nThe `GlucoseShortcuts` struct registers the App Intents with Siri and Shortcuts, providing phrases that users can use to invoke the intents. This integration enhances user experience by allowing quick access to glucose data.\n\n```swift\nstruct GlucoseShortcuts: AppShortcutsProvider {\n static var appShortcuts: [AppShortcut] { ... }\n}\n```\n\n## Architecture Overview\n\n```mermaid\ngraph TD;\n A[GlucoseIntents] -->|uses| B[fetchRecentSamples]\n A -->|returns| C[GetLatestGlucoseIntent]\n A -->|returns| D[GetGlucoseStatsIntent]\n E[GlucoseStorage] -->|manages| F[UserDefaults]\n E -->|caches| G[notesCache]\n E -->|caches| H[overridesCache]\n I[GlucoseUtils] -->|provides| J[trendSymbol]\n I -->|provides| K[estimatedA1c]\n I -->|provides| L[tirBreakdown]\n```\n\n## How It Connects to the Rest of the Codebase\n\nThe Utilities module is integral to the Glucometer application, providing essential functionalities that support both the main app and its extensions. The App Intents defined in `GlucoseIntents.swift` allow users to interact with their glucose data through Siri and Shortcuts, enhancing accessibility and usability.\n\nThe storage functionalities in `GlucoseStorage.swift` ensure that user-specific data is preserved across app sessions, while the utility functions in `GlucoseUtils.swift` facilitate data processing and calculations needed for accurate glucose management.\n\n## Conclusion\n\nThe Utilities module serves as a foundational component of the Glucometer application, enabling seamless integration with HealthKit, efficient data storage, and essential calculations for glucose management. Developers contributing to this module should focus on maintaining the integrity of data access patterns and ensuring that user interactions remain smooth and intuitive.","view-models":"# View Models\n\n# View Models Module Documentation\n\n## Overview\n\nThe **View Models** module is a central component of the Glucozy app, designed to manage the application's state and facilitate communication between the user interface (UI) and the underlying data model. It adheres to the MVVM (Model-View-ViewModel) architectural pattern, ensuring a clear separation of concerns. The `GlucozyViewModel` class is the primary class in this module, responsible for handling data related to glucose readings, Bluetooth interactions, and user preferences.\n\n## Key Components\n\n### GlucozyViewModel\n\nThe `GlucozyViewModel` class is marked as `@MainActor` and conforms to `ObservableObject`, allowing it to publish changes to its properties, which can be observed by SwiftUI views. It implements several delegate protocols to handle Bluetooth events and glucose data updates.\n\n#### Properties\n\n- **Dependencies**\n - `glucoseDataset`: An instance of `GlucoseData` that manages glucose records.\n - `bluetoothHandle`: An instance of `BLE` that manages Bluetooth Low Energy (BLE) interactions.\n - `backgroundSyncManager`: A weak reference to `BackgroundSyncManager` to avoid retain cycles.\n\n- **State Management**\n - `pairingState`: Tracks the current state of Bluetooth pairing.\n - `isOnboardingComplete`: Indicates if the onboarding process is complete.\n - `showScanner`: Controls the visibility of the scanner UI.\n - `allLogEntries`: Stores all glucose log entries.\n - `logEntries`: A filtered list of log entries for display.\n - `avgGlucose`, `inRangePct`, `stdDevGlucose`, etc.: Various statistics related to glucose readings.\n\n- **User Preferences**\n - `isMmolL`: A user preference for glucose unit display (mmol/L or mg/dL).\n\n#### Methods\n\n- **Initialization**\n - `init(glucoseDataset: GlucoseData, bluetoothHandle: BLE)`: Initializes the view model and sets up Bluetooth delegates if onboarding is complete.\n\n- **Onboarding**\n - `onboardingCompleted()`: Finalizes the onboarding process and sets up Bluetooth.\n\n- **Data Handling**\n - `setFilter(days: Int?)`: Sets the filter for log entries based on the number of days.\n - `refreshFromHealthKit()`: Refreshes data from HealthKit.\n - `recompute()`: Triggers a background computation of statistics based on log entries.\n\n- **Bluetooth Interaction**\n - `syncTapped()`: Initiates a sync operation to fetch new glucose records.\n - `connectPeripheral(_:)`: Connects to a selected Bluetooth peripheral.\n\n- **CSV Export**\n - `buildCSVURL()`: Generates a CSV file containing glucose readings for export.\n\n### ComputedSnapshot\n\nThe `ComputedSnapshot` struct encapsulates the results of a statistics computation pass, including averages, ranges, and meal summaries. It is produced off-thread to avoid blocking the main UI thread.\n\n### MealAverageSummary\n\nThe `MealAverageSummary` struct represents aggregated meal-bucket averages, providing insights into glucose readings associated with specific meals.\n\n## Architecture\n\nThe `GlucozyViewModel` serves as the bridge between the UI and the data model, handling user interactions and updating the UI based on changes in the underlying data. It listens for events from the BLE and glucose data sources, processes this data, and publishes updates to the UI.\n\n```mermaid\ngraph TD;\n A[GlucozyViewModel] -->|uses| B[GlucoseData]\n A -->|uses| C[BLE]\n A -->|communicates| D[SwiftUI Views]\n A -->|triggers| E[BackgroundSyncManager]\n A -->|produces| F[ComputedSnapshot]\n A -->|aggregates| G[MealAverageSummary]\n```\n\n## Interaction with Other Modules\n\nThe `GlucozyViewModel` interacts with several other modules:\n\n- **GlucoseData**: Manages the storage and retrieval of glucose readings, providing data to the view model.\n- **BLE**: Handles Bluetooth communication, allowing the app to connect to glucose monitoring devices and receive data.\n- **BackgroundSyncManager**: Manages background synchronization tasks, ensuring that data is kept up-to-date even when the app is not in the foreground.\n- **SwiftUI Views**: The view model publishes state changes that SwiftUI views observe, allowing for dynamic UI updates based on user interactions and data changes.\n\n## Conclusion\n\nThe View Models module is a critical part of the Glucozy app, providing a robust framework for managing application state, handling user interactions, and ensuring a responsive user interface. By adhering to the MVVM pattern, it promotes maintainability and scalability, making it easier for developers to extend and enhance the application in the future.","watch-app":"# Watch App\n\n# Watch App Module Documentation\n\n## Overview\n\nThe **Watch App** module is designed to provide users with real-time glucose monitoring on their Apple Watch. It displays the most recent glucose readings, statistics, and historical data, while also ensuring that the information is updated efficiently without requiring constant HealthKit reloads. The module leverages SwiftUI for its user interface and WatchConnectivity for communication with the iPhone.\n\n## Key Components\n\n### 1. **App Entry Point**\n\n- **`GlucometerWatchApp`**: This is the main entry point of the watchOS application. It initializes the `WatchSessionManager` to ensure that the app is ready to receive glucose data from the iPhone as soon as it launches.\n\n```swift\n@main\nstruct GlucometerWatchApp: App {\n init() {\n WatchSessionManager.shared.activate()\n }\n var body: some Scene {\n WindowGroup {\n ContentView()\n }\n }\n}\n```\n\n### 2. **User Interface**\n\n- **`ContentView`**: The root view of the Watch app, which composes various sections including the hero reading, statistics, today's summary, and a scrollable history list. It manages a timer to keep the relative time labels updated.\n\n```swift\nstruct ContentView: View {\n @StateObject private var viewModel = GlucoseWatchViewModel()\n @State private var now = Date.now\n // ...\n}\n```\n\n- **`GlucoseHeroSectionView`**: Displays the most recent glucose reading prominently, along with a trend indicator. It handles different states such as loading, data available, and no data.\n\n```swift\nstruct GlucoseHeroSectionView: View {\n let entry: WatchGlucoseEntry?\n let isLoading: Bool\n let isDataStale: Bool\n let now: Date\n // ...\n}\n```\n\n- **`GlucoseStatsRowView`**: A compact view that shows today's average glucose and the percentage of readings within the target range.\n\n```swift\nstruct GlucoseStatsRowView: View {\n let dailyAverage: Double?\n let timeInRange: Double?\n // ...\n}\n```\n\n- **`GlucoseTodayCountsView`**: Summarizes today's reading counts, indicating how many readings were low, high, or in range.\n\n```swift\nstruct GlucoseTodayCountsView: View {\n let readingCount: Int\n let lowCount: Int\n let highCount: Int\n // ...\n}\n```\n\n- **`GlucoseHistoryListView`**: Displays a list of recent glucose readings, excluding the most recent one shown in the hero section.\n\n```swift\nstruct GlucoseHistoryListView: View {\n let entries: [WatchGlucoseEntry]\n let now: Date\n // ...\n}\n```\n\n### 3. **Data Model**\n\n- **`WatchGlucoseEntry`**: Represents a single glucose reading, including its value, trend, timestamp, and whether it falls within the target range. It provides methods for formatting the time since the reading and determining the appropriate color for the glucose value.\n\n```swift\nstruct WatchGlucoseEntry: Identifiable {\n let id: UUID\n let value: Double\n let trend: String\n let readingDate: Date\n let isInRange: Bool\n let mealContext: String\n // ...\n}\n```\n\n### 4. **Data Management**\n\n- **`GlucoseWatchViewModel`**: This view model (not fully shown in the provided code) is responsible for managing the state of the glucose readings, including loading data from HealthKit and handling updates from the `WatchSessionManager`.\n\n### 5. **Communication with iPhone**\n\n- **`WatchSessionManager`**: A singleton class that manages the WatchConnectivity session. It receives glucose data from the iPhone and posts notifications to update the UI immediately.\n\n```swift\nfinal class WatchSessionManager: NSObject, WCSessionDelegate {\n static let shared = WatchSessionManager()\n // ...\n}\n```\n\n## Execution Flow\n\n1. **App Launch**: The `GlucometerWatchApp` initializes and activates the `WatchSessionManager`.\n2. **Data Reception**: When the iPhone sends glucose data, `WatchSessionManager` receives it and posts a notification.\n3. **UI Update**: The `GlucoseWatchViewModel` listens for this notification and updates its state, which in turn refreshes the UI components in `ContentView`.\n\n```mermaid\ngraph TD;\n A[GlucometerWatchApp] -->|activates| B[WatchSessionManager]\n B -->|receives data| C[Notification Center]\n C -->|notifies| D[GlucoseWatchViewModel]\n D -->|updates| E[ContentView]\n```\n\n## Conclusion\n\nThe Watch App module is a cohesive unit that integrates various components to provide a seamless user experience for glucose monitoring. By utilizing SwiftUI for the UI and WatchConnectivity for data management, it ensures that users receive timely and accurate information about their glucose levels. Developers contributing to this module should focus on maintaining the responsiveness of the UI and the accuracy of the data presented.","watch-complication":"# Watch Complication\n\n# Watch Complication Module Documentation\n\n## Overview\n\nThe **Watch Complication** module provides a WidgetKit complication for watchOS that displays the latest glucose readings from a shared App Group. It is designed to show real-time glucose data in various complication styles, including accessoryCircular, accessoryRectangular, accessoryInline, and accessoryCorner. The module ensures timely updates and accurate representation of glucose data, including staleness indicators.\n\n## Purpose\n\nThe primary purpose of this module is to present glucose readings from a connected glucometer on the Apple Watch. It reads data from the shared App Group, which is updated by the `GlucoseWatchViewModel`. The complication updates every 15 minutes, ensuring that users have access to the most recent glucose information.\n\n## Key Components\n\n### 1. **Timeline Entry**\n\nThe `GlucoseComplicationEntry` struct represents a single timeline entry for the complication. It contains the following properties:\n\n- `date`: The date and time of the entry.\n- `value`: The glucose value (optional, can be nil).\n- `trend`: A string representing the trend of the glucose reading (e.g., \"↑\", \"↓\").\n- `readingDate`: The timestamp of the glucose reading (optional, can be nil).\n- `isInRange`: A boolean indicating if the glucose value is within the acceptable range.\n- `isStale`: A boolean indicating if the data is stale (older than 8 hours).\n\n#### Methods\n\n- `timeAgo`: Computes a relative time string based on the `readingDate`.\n- `glucoseColor`: Determines the color of the glucose value based on its staleness and range.\n\n### 2. **Timeline Provider**\n\nThe `GlucoseComplicationProvider` struct implements the `TimelineProvider` protocol. It is responsible for fetching the latest glucose data and constructing the timeline entries.\n\n#### Key Methods\n\n- `placeholder(in:)`: Returns a placeholder entry for the complication.\n- `getSnapshot(in:completion:)`: Fetches the latest glucose sample and provides a snapshot for the complication.\n- `getTimeline(in:completion:)`: Constructs a timeline with two entries: a fresh entry and a stale entry if applicable.\n\n#### Internal Methods\n\n- `fetchLatestSample()`: Reads the latest glucose data from UserDefaults in the shared App Group. Returns a `FetchedSample` struct containing the glucose value, trend, reading date, and range status.\n\n### 3. **Complication Views**\n\nThe module includes several SwiftUI views for rendering the complication in different styles:\n\n- `CircularComplicationView`: Displays the glucose value and trend in a circular format.\n- `RectangularComplicationView`: Displays the glucose value, trend, and staleness indicator in a rectangular format.\n- `InlineComplicationView`: Displays a compact view of the glucose value and trend.\n- `CornerComplicationView`: Displays the glucose value in a corner complication style.\n\n### 4. **Entry View**\n\nThe `GlucometerWatchComplicationEntryView` struct serves as the entry point for rendering the complication based on the selected family. It switches between the different complication views based on the `widgetFamily` environment value.\n\n### 5. **Widget Declaration**\n\nThe `GlucometerWatchComplicationWidget` struct defines the widget configuration. It specifies the widget kind, provider, and supported families. The `kind` must remain stable across installs to avoid invalidating existing complications.\n\n### 6. **Widget Bundle**\n\nThe `GlucometerWatchComplicationBundle` struct serves as the entry point for the watchOS complication extension, registering the widget types provided by this target.\n\n## Execution Flow\n\nThe execution flow of the module is straightforward. The `GlucometerWatchComplicationWidget` is instantiated, which triggers the `GlucoseComplicationProvider` to fetch the latest glucose data. The provider constructs the timeline entries and passes them to the `GlucometerWatchComplicationEntryView`, which renders the appropriate view based on the complication style.\n\n```mermaid\ngraph TD;\n A[GlucometerWatchComplicationWidget] --> B[GlucoseComplicationProvider]\n B --> C[fetchLatestSample()]\n B --> D[getSnapshot()]\n B --> E[getTimeline()]\n E --> F[GlucoseComplicationEntry]\n F --> G[CircularComplicationView]\n F --> H[RectangularComplicationView]\n F --> I[InlineComplicationView]\n F --> J[CornerComplicationView]\n```\n\n## Integration with the Codebase\n\nThis module connects with the rest of the codebase through the shared App Group, where the `GlucoseWatchViewModel` writes the glucose data. The complication reads this data to provide real-time updates to the user. The use of WidgetKit allows for seamless integration with watchOS, providing a native experience for users monitoring their glucose levels.\n\n## Conclusion\n\nThe Watch Complication module is a critical component for displaying glucose data on watchOS. Its design ensures timely updates and accurate representation of glucose readings, enhancing the user experience for individuals managing their health. Developers can extend this module by adding more complication styles or enhancing the data fetching logic as needed.","widget":"# Widget\n\n# Widget Module Documentation\n\n## Overview\n\nThe **Widget** module provides an iOS widget for displaying glucose readings from a connected glucometer. It supports both home screen and lock screen widgets, utilizing the WidgetKit framework to present real-time data. The widget reads a `GlucoseWidgetData` blob from a shared App Group, which is updated by the main Glucometer app after each sync.\n\n### Supported Widget Families\n- **Home Screen**: `systemSmall`, `systemMedium`\n- **Lock Screen**: `accessoryCircular`, `accessoryRectangular` (iOS 16+)\n\n## Architecture\n\nThe module is structured around the WidgetKit framework, which manages the lifecycle and rendering of the widget. The key components include:\n\n- **Timeline Provider**: Manages the data and updates for the widget.\n- **Widget Views**: Defines how the data is presented in different widget sizes.\n- **Data Model**: Represents the glucose data shared between the main app and the widget.\n\n```mermaid\ngraph TD;\n A[GlucometerWidget] --> B[GlucoseProvider]\n B --> C[GlucoseEntry]\n B --> D[loadWidgetData]\n D --> E[GlucoseWidgetData]\n A --> F[GlucometerWidgetEntryView]\n F --> G[SmallWidgetView]\n F --> H[MediumWidgetView]\n F --> I[AccessoryCircularView]\n F --> J[AccessoryRectangularView]\n```\n\n## Key Components\n\n### 1. GlucoseProvider\n\nThe `GlucoseProvider` conforms to `TimelineProvider` and is responsible for providing the timeline entries for the widget.\n\n- **Methods**:\n - `placeholder(in:)`: Returns a placeholder entry for the widget.\n - `getSnapshot(in:completion:)`: Fetches a snapshot of the current data for quick rendering.\n - `getTimeline(in:completion:)`: Creates a timeline with a single entry, which is refreshed every 15 minutes.\n\n### 2. GlucoseEntry\n\nThe `GlucoseEntry` struct conforms to `TimelineEntry` and represents a single entry in the widget's timeline. It contains:\n- `date`: The date of the entry.\n- `data`: An optional `GlucoseWidgetData` object.\n\n### 3. GlucoseWidgetData\n\nThis struct is a Codable representation of the glucose data shared between the main app and the widget. It includes:\n- `latestValue`: The most recent glucose reading.\n- `latestDate`: The timestamp of the latest reading.\n- `trend`: The rate of change in glucose levels.\n- `estimatedA1c`: Estimated HbA1c value.\n- `lowPct`, `inRangePct`, `highPct`: Percentages of readings over the last week.\n- `targetLow`, `targetHigh`: User-defined thresholds for glucose levels.\n\n#### Methods:\n- `trendSymbol`: Returns a Unicode arrow representing the trend of glucose levels.\n- `isInRange`: Checks if the latest reading is within the target range.\n- `placeholder()`: Provides a sample data instance for previews.\n\n### 4. Widget Views\n\nThe widget views are responsible for rendering the data in different formats based on the widget family.\n\n- **GlucometerWidgetEntryView**: The main entry view that dispatches to the appropriate sub-view based on the widget family and iOS version.\n- **SmallWidgetView**: Displays the latest glucose value, trend, and time since the last reading.\n- **MediumWidgetView**: Provides a more detailed view, including statistics on glucose readings.\n- **AccessoryCircularView** and **AccessoryRectangularView**: Specialized views for lock screen widgets on iOS 16 and above.\n\n### 5. TIRBar\n\nThe `TIRBar` view visually represents the time-in-range for glucose readings, using color-coded segments to indicate low, in-range, and high percentages.\n\n### 6. NoDataView\n\nDisplays a placeholder when no data is available, ensuring a user-friendly experience.\n\n## Data Management\n\nThe widget relies on shared data stored in UserDefaults under the key `\"glucoseWidgetData\"`. The main app writes the data after each sync, and the widget reads it to populate its views.\n\n### Functions:\n- `saveWidgetData(_:)`: Serializes and saves `GlucoseWidgetData` to UserDefaults.\n- `loadWidgetData() -> GlucoseWidgetData?`: Reads and deserializes the most recent glucose data.\n\n## Widget Configuration\n\nThe `GlucometerWidget` struct defines the widget configuration, including its kind, supported families, and display name. It ensures that the widget remains stable across updates.\n\n### Key Properties:\n- `kind`: A unique identifier for the widget.\n- `supportedFamilies`: Specifies which widget families are supported based on the iOS version.\n\n## Conclusion\n\nThe **Widget** module is a comprehensive solution for displaying glucose data on iOS devices. By leveraging WidgetKit and a shared data model, it provides users with timely and relevant information about their glucose levels, enhancing the overall user experience of the Glucometer app. Developers can extend and modify this module to accommodate additional features or data visualizations as needed."};
var TREE = [{"name":"Core Application","slug":"core-application","files":["Glucometer/App/AppDelegate.swift","Glucometer/App/SceneDelegate.swift","Glucometer/App/ViewController.swift"]},{"name":"Design System","slug":"design-system","files":["Glucometer/DesignSystem/GlucozyDesignSystem.swift","Glucometer/DesignSystem/Strings.swift","Glucometer/DesignSystem/Theme.swift"]},{"name":"Data Models","slug":"data-models","files":["Glucometer/Model/GlucoseDataDelegate.swift","Glucometer/Model/GlucoseRecord.swift","Glucometer/Model/GlucoseWidgetData.swift","Glucometer/Model/LogEntry.swift","Glucometer/Model/SavedDevice.swift"]},{"name":"Services","slug":"services","files":["Glucometer/Services/BLE.swift","Glucometer/Services/BackgroundSyncManager.swift","Glucometer/Services/GlucoseLiveActivity.swift","Glucometer/Services/GlucoseNotificationManager.swift","Glucometer/Services/HealthKitManager.swift","Glucometer/Services/WatchSync.swift"]},{"name":"Utilities","slug":"utilities","files":["Glucometer/Utilities/GlucoseIntents.swift","Glucometer/Utilities/GlucoseStorage.swift","Glucometer/Utilities/GlucoseUtils.swift"]},{"name":"View Models","slug":"view-models","files":["Glucometer/ViewModel/GlucozyViewModel.swift"]},{"name":"User Interface","slug":"user-interface","files":[],"children":[{"name":"User Interface — UIKit","slug":"user-interface-uikit","files":["Glucometer/UIKit/BadgeLabel.swift","Glucometer/UIKit/DeviceManagerViewController.swift","Glucometer/UIKit/GlucoseSparklineView.swift","Glucometer/UIKit/OnboardingViewController.swift"]},{"name":"User Interface — Views","slug":"user-interface-views","files":["Glucometer/Views/CollapsibleSection.swift","Glucometer/Views/ConnectionBannerView.swift","Glucometer/Views/ContentView.swift","Glucometer/Views/DataListView.swift","Glucometer/Views/EmptyStateView.swift","Glucometer/Views/GlucoseDetailView.swift","Glucometer/Views/GlucoseReadingCard.swift","Glucometer/Views/GlucoseRowView.swift","Glucometer/Views/HeroCardView.swift","Glucometer/Views/InfoButton.swift","Glucometer/Views/InsightsCardView.swift","Glucometer/Views/OnboardingPairingView.swift","Glucometer/Views/ScannerView.swift","Glucometer/Views/SettingsView.swift","Glucometer/Views/SparklineWrapper.swift","Glucometer/Views/TIRBarView.swift","Glucometer/Views/TIRRingView.swift","Glucometer/Views/TargetRangeInputField.swift","Glucometer/Views/TargetRangePresetChip.swift","Glucometer/Views/TargetRangeSheet.swift","Glucometer/Views/TargetRangeTrackView.swift"]}]},{"name":"Watch App","slug":"watch-app","files":["GlucometerWatch Watch App/ContentView.swift","GlucometerWatch Watch App/GlucometerWatchApp.swift","GlucometerWatch Watch App/GlucoseHeroSectionView.swift","GlucometerWatch Watch App/GlucoseHistoryListView.swift","GlucometerWatch Watch App/GlucoseStatsRowView.swift","GlucometerWatch Watch App/GlucoseTodayCountsView.swift","GlucometerWatch Watch App/GlucozyWatch.entitlements","GlucometerWatch Watch App/GlucozyWatchDebug.entitlements","GlucometerWatch Watch App/WatchGlucoseEntry.swift","GlucometerWatch Watch App/WatchSessionManager.swift"]},{"name":"Watch Complication","slug":"watch-complication","files":["GlucometerWatchComplication/GlucometerWatchComplication.swift","GlucometerWatchComplication/GlucometerWatchComplicationBundle.swift"]},{"name":"Widget","slug":"widget","files":["GlucometerWidget/GlucometerWidget.swift","GlucometerWidget/GlucometerWidgetBundle.swift","GlucometerWidget/GlucoseLiveActivityView.swift","GlucometerWidget/GlucoseWidgetData.swift"]},{"name":"Other","slug":"other","files":[],"children":[{"name":"Other — CLAUDE.md","slug":"other-claude-md","files":["CLAUDE.md"]},{"name":"Other — Gemfile","slug":"other-gemfile","files":["Gemfile"]},{"name":"Other — Glucometer.xcodeproj","slug":"other-glucometer-xcodeproj","files":["Glucometer.xcodeproj/project.pbxproj"]},{"name":"Other — Glucometer.xcodeproj-project.xcworkspace","slug":"other-glucometer-xcodeproj-project-xcworkspace","files":["Glucometer.xcodeproj/project.xcworkspace/contents.xcworkspacedata"]},{"name":"Other — Glucometer.xcodeproj-xcshareddata","slug":"other-glucometer-xcodeproj-xcshareddata","files":["Glucometer.xcodeproj/xcshareddata/xcschemes/Glucometer.xcscheme","Glucometer.xcodeproj/xcshareddata/xcschemes/GlucometerWidgetExtension.xcscheme"]},{"name":"Other — Glucometer-Assets.xcassets","slug":"other-glucometer-assets-xcassets","files":["Glucometer/Assets.xcassets/AccentColor.colorset/Contents.json","Glucometer/Assets.xcassets/AppIcon.appiconset/Contents.json","Glucometer/Assets.xcassets/Contents.json"]},{"name":"Other — Glucometer-Base.lproj","slug":"other-glucometer-base-lproj","files":["Glucometer/Base.lproj/LaunchScreen.storyboard"]},{"name":"Other — Glucometer","slug":"other-glucometer","files":["Glucometer/CLAUDE.md","Glucometer/Glucozy.entitlements","Glucometer/GlucozyDebug.entitlements","Glucometer/Info.plist","Glucometer/Main.storyboard","Glucometer/README.md"]},{"name":"Other — Glucometer-de.lproj","slug":"other-glucometer-de-lproj","files":["Glucometer/de.lproj/InfoPlist.strings","Glucometer/de.lproj/Localizable.strings"]},{"name":"Other — Glucometer-en.lproj","slug":"other-glucometer-en-lproj","files":["Glucometer/en.lproj/InfoPlist.strings","Glucometer/en.lproj/Localizable.strings"]},{"name":"Other — Glucometer-fr.lproj","slug":"other-glucometer-fr-lproj","files":["Glucometer/fr.lproj/InfoPlist.strings","Glucometer/fr.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatch Watch App-Assets.xcassets","slug":"other-glucometerwatch-watch-app-assets-xcassets","files":["GlucometerWatch Watch App/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/Contents.json"]},{"name":"Other — GlucometerWatch Watch App","slug":"other-glucometerwatch-watch-app","files":["GlucometerWatch Watch App/GlucoseWatchViewModel.swift"]},{"name":"Other — GlucometerWatch Watch App-de.lproj","slug":"other-glucometerwatch-watch-app-de-lproj","files":["GlucometerWatch Watch App/de.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatch Watch App-en.lproj","slug":"other-glucometerwatch-watch-app-en-lproj","files":["GlucometerWatch Watch App/en.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatch Watch App-fr.lproj","slug":"other-glucometerwatch-watch-app-fr-lproj","files":["GlucometerWatch Watch App/fr.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatchComplication-Assets.xcassets","slug":"other-glucometerwatchcomplication-assets-xcassets","files":["GlucometerWatchComplication/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatchComplication/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatchComplication/Assets.xcassets/Contents.json","GlucometerWatchComplication/Assets.xcassets/WidgetBackground.colorset/Contents.json"]},{"name":"Other — GlucometerWatchComplication","slug":"other-glucometerwatchcomplication","files":["GlucometerWatchComplication/Info.plist"]},{"name":"Other — GlucometerWatchComplication-de.lproj","slug":"other-glucometerwatchcomplication-de-lproj","files":["GlucometerWatchComplication/de.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatchComplication-en.lproj","slug":"other-glucometerwatchcomplication-en-lproj","files":["GlucometerWatchComplication/en.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatchComplication-fr.lproj","slug":"other-glucometerwatchcomplication-fr-lproj","files":["GlucometerWatchComplication/fr.lproj/Localizable.strings"]},{"name":"Other — GlucometerWidget-Assets.xcassets","slug":"other-glucometerwidget-assets-xcassets","files":["GlucometerWidget/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWidget/Assets.xcassets/Contents.json","GlucometerWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json"]},{"name":"Other — GlucometerWidget","slug":"other-glucometerwidget","files":["GlucometerWidget/Info.plist"]},{"name":"Other — GlucometerWidget-de.lproj","slug":"other-glucometerwidget-de-lproj","files":["GlucometerWidget/de.lproj/Localizable.strings"]},{"name":"Other — GlucometerWidget-en.lproj","slug":"other-glucometerwidget-en-lproj","files":["GlucometerWidget/en.lproj/Localizable.strings"]},{"name":"Other — GlucometerWidget-fr.lproj","slug":"other-glucometerwidget-fr-lproj","files":["GlucometerWidget/fr.lproj/Localizable.strings"]},{"name":"Other — GlucozyWatchComplicationExtension.entitlements","slug":"other-glucozywatchcomplicationextension-entitlements","files":["GlucozyWatchComplicationExtension.entitlements"]},{"name":"Other — GlucozyWatchComplicationExtensionDebug.entitlements","slug":"other-glucozywatchcomplicationextensiondebug-entitlements","files":["GlucozyWatchComplicationExtensionDebug.entitlements"]},{"name":"Other — GlucozyWidgetExtension.entitlements","slug":"other-glucozywidgetextension-entitlements","files":["GlucozyWidgetExtension.entitlements"]},{"name":"Other — GlucozyWidgetExtensionDebug.entitlements","slug":"other-glucozywidgetextensiondebug-entitlements","files":["GlucozyWidgetExtensionDebug.entitlements"]},{"name":"Other — Spec.md","slug":"other-spec-md","files":["Spec.md"]},{"name":"Other — docs-superpowers","slug":"other-docs-superpowers","files":["docs/superpowers/specs/2026-04-01-watch-app-glucose-display-design.md"]},{"name":"Other — fastlane","slug":"other-fastlane","files":["fastlane/Appfile","fastlane/Fastfile","fastlane/README.md"]},{"name":"Other — graphify-out","slug":"other-graphify-out","files":["graphify-out/GRAPH_REPORT.md","graphify-out/cost.json","graphify-out/graph.html","graphify-out/graph.json","graphify-out/manifest.json"]},{"name":"Other — specs-landing-page","slug":"other-specs-landing-page","files":["specs/landing-page/prompt.md"]},{"name":"Other — tasks","slug":"other-tasks","files":["tasks/plan.md","tasks/todo.md"]}]}];
var META = {"fromCommit":"292372ee44f933c87b720bbbf8dd8156a420c17a","generatedAt":"2026-04-16T05:38:35.716Z","model":"gpt-4o-mini","moduleFiles":{"Core Application":["Glucometer/App/AppDelegate.swift","Glucometer/App/SceneDelegate.swift","Glucometer/App/ViewController.swift"],"Design System":["Glucometer/DesignSystem/GlucozyDesignSystem.swift","Glucometer/DesignSystem/Strings.swift","Glucometer/DesignSystem/Theme.swift"],"Data Models":["Glucometer/Model/GlucoseDataDelegate.swift","Glucometer/Model/GlucoseRecord.swift","Glucometer/Model/GlucoseWidgetData.swift","Glucometer/Model/LogEntry.swift","Glucometer/Model/SavedDevice.swift"],"Services":["Glucometer/Services/BLE.swift","Glucometer/Services/BackgroundSyncManager.swift","Glucometer/Services/GlucoseLiveActivity.swift","Glucometer/Services/GlucoseNotificationManager.swift","Glucometer/Services/HealthKitManager.swift","Glucometer/Services/WatchSync.swift"],"Utilities":["Glucometer/Utilities/GlucoseIntents.swift","Glucometer/Utilities/GlucoseStorage.swift","Glucometer/Utilities/GlucoseUtils.swift"],"View Models":["Glucometer/ViewModel/GlucozyViewModel.swift"],"User Interface":["Glucometer/UIKit/BadgeLabel.swift","Glucometer/UIKit/DeviceManagerViewController.swift","Glucometer/UIKit/GlucoseSparklineView.swift","Glucometer/UIKit/OnboardingViewController.swift","Glucometer/Views/CollapsibleSection.swift","Glucometer/Views/ConnectionBannerView.swift","Glucometer/Views/ContentView.swift","Glucometer/Views/DataListView.swift","Glucometer/Views/EmptyStateView.swift","Glucometer/Views/GlucoseDetailView.swift","Glucometer/Views/GlucoseReadingCard.swift","Glucometer/Views/GlucoseRowView.swift","Glucometer/Views/HeroCardView.swift","Glucometer/Views/InfoButton.swift","Glucometer/Views/InsightsCardView.swift","Glucometer/Views/OnboardingPairingView.swift","Glucometer/Views/ScannerView.swift","Glucometer/Views/SettingsView.swift","Glucometer/Views/SparklineWrapper.swift","Glucometer/Views/TIRBarView.swift","Glucometer/Views/TIRRingView.swift","Glucometer/Views/TargetRangeInputField.swift","Glucometer/Views/TargetRangePresetChip.swift","Glucometer/Views/TargetRangeSheet.swift","Glucometer/Views/TargetRangeTrackView.swift"],"User Interface — UIKit":["Glucometer/UIKit/BadgeLabel.swift","Glucometer/UIKit/DeviceManagerViewController.swift","Glucometer/UIKit/GlucoseSparklineView.swift","Glucometer/UIKit/OnboardingViewController.swift"],"User Interface — Views":["Glucometer/Views/CollapsibleSection.swift","Glucometer/Views/ConnectionBannerView.swift","Glucometer/Views/ContentView.swift","Glucometer/Views/DataListView.swift","Glucometer/Views/EmptyStateView.swift","Glucometer/Views/GlucoseDetailView.swift","Glucometer/Views/GlucoseReadingCard.swift","Glucometer/Views/GlucoseRowView.swift","Glucometer/Views/HeroCardView.swift","Glucometer/Views/InfoButton.swift","Glucometer/Views/InsightsCardView.swift","Glucometer/Views/OnboardingPairingView.swift","Glucometer/Views/ScannerView.swift","Glucometer/Views/SettingsView.swift","Glucometer/Views/SparklineWrapper.swift","Glucometer/Views/TIRBarView.swift","Glucometer/Views/TIRRingView.swift","Glucometer/Views/TargetRangeInputField.swift","Glucometer/Views/TargetRangePresetChip.swift","Glucometer/Views/TargetRangeSheet.swift","Glucometer/Views/TargetRangeTrackView.swift"],"Watch App":["GlucometerWatch Watch App/ContentView.swift","GlucometerWatch Watch App/GlucometerWatchApp.swift","GlucometerWatch Watch App/GlucoseHeroSectionView.swift","GlucometerWatch Watch App/GlucoseHistoryListView.swift","GlucometerWatch Watch App/GlucoseStatsRowView.swift","GlucometerWatch Watch App/GlucoseTodayCountsView.swift","GlucometerWatch Watch App/GlucozyWatch.entitlements","GlucometerWatch Watch App/GlucozyWatchDebug.entitlements","GlucometerWatch Watch App/WatchGlucoseEntry.swift","GlucometerWatch Watch App/WatchSessionManager.swift"],"Watch Complication":["GlucometerWatchComplication/GlucometerWatchComplication.swift","GlucometerWatchComplication/GlucometerWatchComplicationBundle.swift"],"Widget":["GlucometerWidget/GlucometerWidget.swift","GlucometerWidget/GlucometerWidgetBundle.swift","GlucometerWidget/GlucoseLiveActivityView.swift","GlucometerWidget/GlucoseWidgetData.swift"],"Other":["CLAUDE.md","Gemfile","Glucometer.xcodeproj/project.pbxproj","Glucometer.xcodeproj/project.xcworkspace/contents.xcworkspacedata","Glucometer.xcodeproj/xcshareddata/xcschemes/Glucometer.xcscheme","Glucometer.xcodeproj/xcshareddata/xcschemes/GlucometerWidgetExtension.xcscheme","Glucometer/Assets.xcassets/AccentColor.colorset/Contents.json","Glucometer/Assets.xcassets/AppIcon.appiconset/Contents.json","Glucometer/Assets.xcassets/Contents.json","Glucometer/Base.lproj/LaunchScreen.storyboard","Glucometer/CLAUDE.md","Glucometer/Glucozy.entitlements","Glucometer/GlucozyDebug.entitlements","Glucometer/Info.plist","Glucometer/Main.storyboard","Glucometer/README.md","Glucometer/de.lproj/InfoPlist.strings","Glucometer/de.lproj/Localizable.strings","Glucometer/en.lproj/InfoPlist.strings","Glucometer/en.lproj/Localizable.strings","Glucometer/fr.lproj/InfoPlist.strings","Glucometer/fr.lproj/Localizable.strings","GlucometerWatch Watch App/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/Contents.json","GlucometerWatch Watch App/GlucoseWatchViewModel.swift","GlucometerWatch Watch App/de.lproj/Localizable.strings","GlucometerWatch Watch App/en.lproj/Localizable.strings","GlucometerWatch Watch App/fr.lproj/Localizable.strings","GlucometerWatchComplication/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatchComplication/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatchComplication/Assets.xcassets/Contents.json","GlucometerWatchComplication/Assets.xcassets/WidgetBackground.colorset/Contents.json","GlucometerWatchComplication/Info.plist","GlucometerWatchComplication/de.lproj/Localizable.strings","GlucometerWatchComplication/en.lproj/Localizable.strings","GlucometerWatchComplication/fr.lproj/Localizable.strings","GlucometerWidget/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWidget/Assets.xcassets/Contents.json","GlucometerWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json","GlucometerWidget/Info.plist","GlucometerWidget/de.lproj/Localizable.strings","GlucometerWidget/en.lproj/Localizable.strings","GlucometerWidget/fr.lproj/Localizable.strings","GlucozyWatchComplicationExtension.entitlements","GlucozyWatchComplicationExtensionDebug.entitlements","GlucozyWidgetExtension.entitlements","GlucozyWidgetExtensionDebug.entitlements","Spec.md","docs/superpowers/specs/2026-04-01-watch-app-glucose-display-design.md","fastlane/Appfile","fastlane/Fastfile","fastlane/README.md","graphify-out/GRAPH_REPORT.md","graphify-out/cost.json","graphify-out/graph.html","graphify-out/graph.json","graphify-out/manifest.json","specs/landing-page/prompt.md","tasks/plan.md","tasks/todo.md"],"Other — CLAUDE.md":["CLAUDE.md"],"Other — Gemfile":["Gemfile"],"Other — Glucometer.xcodeproj":["Glucometer.xcodeproj/project.pbxproj"],"Other — Glucometer.xcodeproj-project.xcworkspace":["Glucometer.xcodeproj/project.xcworkspace/contents.xcworkspacedata"],"Other — Glucometer.xcodeproj-xcshareddata":["Glucometer.xcodeproj/xcshareddata/xcschemes/Glucometer.xcscheme","Glucometer.xcodeproj/xcshareddata/xcschemes/GlucometerWidgetExtension.xcscheme"],"Other — Glucometer-Assets.xcassets":["Glucometer/Assets.xcassets/AccentColor.colorset/Contents.json","Glucometer/Assets.xcassets/AppIcon.appiconset/Contents.json","Glucometer/Assets.xcassets/Contents.json"],"Other — Glucometer-Base.lproj":["Glucometer/Base.lproj/LaunchScreen.storyboard"],"Other — Glucometer":["Glucometer/CLAUDE.md","Glucometer/Glucozy.entitlements","Glucometer/GlucozyDebug.entitlements","Glucometer/Info.plist","Glucometer/Main.storyboard","Glucometer/README.md"],"Other — Glucometer-de.lproj":["Glucometer/de.lproj/InfoPlist.strings","Glucometer/de.lproj/Localizable.strings"],"Other — Glucometer-en.lproj":["Glucometer/en.lproj/InfoPlist.strings","Glucometer/en.lproj/Localizable.strings"],"Other — Glucometer-fr.lproj":["Glucometer/fr.lproj/InfoPlist.strings","Glucometer/fr.lproj/Localizable.strings"],"Other — GlucometerWatch Watch App-Assets.xcassets":["GlucometerWatch Watch App/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/Contents.json"],"Other — GlucometerWatch Watch App":["GlucometerWatch Watch App/GlucoseWatchViewModel.swift"],"Other — GlucometerWatch Watch App-de.lproj":["GlucometerWatch Watch App/de.lproj/Localizable.strings"],"Other — GlucometerWatch Watch App-en.lproj":["GlucometerWatch Watch App/en.lproj/Localizable.strings"],"Other — GlucometerWatch Watch App-fr.lproj":["GlucometerWatch Watch App/fr.lproj/Localizable.strings"],"Other — GlucometerWatchComplication-Assets.xcassets":["GlucometerWatchComplication/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatchComplication/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatchComplication/Assets.xcassets/Contents.json","GlucometerWatchComplication/Assets.xcassets/WidgetBackground.colorset/Contents.json"],"Other — GlucometerWatchComplication":["GlucometerWatchComplication/Info.plist"],"Other — GlucometerWatchComplication-de.lproj":["GlucometerWatchComplication/de.lproj/Localizable.strings"],"Other — GlucometerWatchComplication-en.lproj":["GlucometerWatchComplication/en.lproj/Localizable.strings"],"Other — GlucometerWatchComplication-fr.lproj":["GlucometerWatchComplication/fr.lproj/Localizable.strings"],"Other — GlucometerWidget-Assets.xcassets":["GlucometerWidget/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWidget/Assets.xcassets/Contents.json","GlucometerWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json"],"Other — GlucometerWidget":["GlucometerWidget/Info.plist"],"Other — GlucometerWidget-de.lproj":["GlucometerWidget/de.lproj/Localizable.strings"],"Other — GlucometerWidget-en.lproj":["GlucometerWidget/en.lproj/Localizable.strings"],"Other — GlucometerWidget-fr.lproj":["GlucometerWidget/fr.lproj/Localizable.strings"],"Other — GlucozyWatchComplicationExtension.entitlements":["GlucozyWatchComplicationExtension.entitlements"],"Other — GlucozyWatchComplicationExtensionDebug.entitlements":["GlucozyWatchComplicationExtensionDebug.entitlements"],"Other — GlucozyWidgetExtension.entitlements":["GlucozyWidgetExtension.entitlements"],"Other — GlucozyWidgetExtensionDebug.entitlements":["GlucozyWidgetExtensionDebug.entitlements"],"Other — Spec.md":["Spec.md"],"Other — docs-superpowers":["docs/superpowers/specs/2026-04-01-watch-app-glucose-display-design.md"],"Other — fastlane":["fastlane/Appfile","fastlane/Fastfile","fastlane/README.md"],"Other — graphify-out":["graphify-out/GRAPH_REPORT.md","graphify-out/cost.json","graphify-out/graph.html","graphify-out/graph.json","graphify-out/manifest.json"],"Other — specs-landing-page":["specs/landing-page/prompt.md"],"Other — tasks":["tasks/plan.md","tasks/todo.md"]},"moduleTree":[{"name":"Core Application","slug":"core-application","files":["Glucometer/App/AppDelegate.swift","Glucometer/App/SceneDelegate.swift","Glucometer/App/ViewController.swift"]},{"name":"Design System","slug":"design-system","files":["Glucometer/DesignSystem/GlucozyDesignSystem.swift","Glucometer/DesignSystem/Strings.swift","Glucometer/DesignSystem/Theme.swift"]},{"name":"Data Models","slug":"data-models","files":["Glucometer/Model/GlucoseDataDelegate.swift","Glucometer/Model/GlucoseRecord.swift","Glucometer/Model/GlucoseWidgetData.swift","Glucometer/Model/LogEntry.swift","Glucometer/Model/SavedDevice.swift"]},{"name":"Services","slug":"services","files":["Glucometer/Services/BLE.swift","Glucometer/Services/BackgroundSyncManager.swift","Glucometer/Services/GlucoseLiveActivity.swift","Glucometer/Services/GlucoseNotificationManager.swift","Glucometer/Services/HealthKitManager.swift","Glucometer/Services/WatchSync.swift"]},{"name":"Utilities","slug":"utilities","files":["Glucometer/Utilities/GlucoseIntents.swift","Glucometer/Utilities/GlucoseStorage.swift","Glucometer/Utilities/GlucoseUtils.swift"]},{"name":"View Models","slug":"view-models","files":["Glucometer/ViewModel/GlucozyViewModel.swift"]},{"name":"User Interface","slug":"user-interface","files":[],"children":[{"name":"User Interface — UIKit","slug":"user-interface-uikit","files":["Glucometer/UIKit/BadgeLabel.swift","Glucometer/UIKit/DeviceManagerViewController.swift","Glucometer/UIKit/GlucoseSparklineView.swift","Glucometer/UIKit/OnboardingViewController.swift"]},{"name":"User Interface — Views","slug":"user-interface-views","files":["Glucometer/Views/CollapsibleSection.swift","Glucometer/Views/ConnectionBannerView.swift","Glucometer/Views/ContentView.swift","Glucometer/Views/DataListView.swift","Glucometer/Views/EmptyStateView.swift","Glucometer/Views/GlucoseDetailView.swift","Glucometer/Views/GlucoseReadingCard.swift","Glucometer/Views/GlucoseRowView.swift","Glucometer/Views/HeroCardView.swift","Glucometer/Views/InfoButton.swift","Glucometer/Views/InsightsCardView.swift","Glucometer/Views/OnboardingPairingView.swift","Glucometer/Views/ScannerView.swift","Glucometer/Views/SettingsView.swift","Glucometer/Views/SparklineWrapper.swift","Glucometer/Views/TIRBarView.swift","Glucometer/Views/TIRRingView.swift","Glucometer/Views/TargetRangeInputField.swift","Glucometer/Views/TargetRangePresetChip.swift","Glucometer/Views/TargetRangeSheet.swift","Glucometer/Views/TargetRangeTrackView.swift"]}]},{"name":"Watch App","slug":"watch-app","files":["GlucometerWatch Watch App/ContentView.swift","GlucometerWatch Watch App/GlucometerWatchApp.swift","GlucometerWatch Watch App/GlucoseHeroSectionView.swift","GlucometerWatch Watch App/GlucoseHistoryListView.swift","GlucometerWatch Watch App/GlucoseStatsRowView.swift","GlucometerWatch Watch App/GlucoseTodayCountsView.swift","GlucometerWatch Watch App/GlucozyWatch.entitlements","GlucometerWatch Watch App/GlucozyWatchDebug.entitlements","GlucometerWatch Watch App/WatchGlucoseEntry.swift","GlucometerWatch Watch App/WatchSessionManager.swift"]},{"name":"Watch Complication","slug":"watch-complication","files":["GlucometerWatchComplication/GlucometerWatchComplication.swift","GlucometerWatchComplication/GlucometerWatchComplicationBundle.swift"]},{"name":"Widget","slug":"widget","files":["GlucometerWidget/GlucometerWidget.swift","GlucometerWidget/GlucometerWidgetBundle.swift","GlucometerWidget/GlucoseLiveActivityView.swift","GlucometerWidget/GlucoseWidgetData.swift"]},{"name":"Other","slug":"other","files":[],"children":[{"name":"Other — CLAUDE.md","slug":"other-claude-md","files":["CLAUDE.md"]},{"name":"Other — Gemfile","slug":"other-gemfile","files":["Gemfile"]},{"name":"Other — Glucometer.xcodeproj","slug":"other-glucometer-xcodeproj","files":["Glucometer.xcodeproj/project.pbxproj"]},{"name":"Other — Glucometer.xcodeproj-project.xcworkspace","slug":"other-glucometer-xcodeproj-project-xcworkspace","files":["Glucometer.xcodeproj/project.xcworkspace/contents.xcworkspacedata"]},{"name":"Other — Glucometer.xcodeproj-xcshareddata","slug":"other-glucometer-xcodeproj-xcshareddata","files":["Glucometer.xcodeproj/xcshareddata/xcschemes/Glucometer.xcscheme","Glucometer.xcodeproj/xcshareddata/xcschemes/GlucometerWidgetExtension.xcscheme"]},{"name":"Other — Glucometer-Assets.xcassets","slug":"other-glucometer-assets-xcassets","files":["Glucometer/Assets.xcassets/AccentColor.colorset/Contents.json","Glucometer/Assets.xcassets/AppIcon.appiconset/Contents.json","Glucometer/Assets.xcassets/Contents.json"]},{"name":"Other — Glucometer-Base.lproj","slug":"other-glucometer-base-lproj","files":["Glucometer/Base.lproj/LaunchScreen.storyboard"]},{"name":"Other — Glucometer","slug":"other-glucometer","files":["Glucometer/CLAUDE.md","Glucometer/Glucozy.entitlements","Glucometer/GlucozyDebug.entitlements","Glucometer/Info.plist","Glucometer/Main.storyboard","Glucometer/README.md"]},{"name":"Other — Glucometer-de.lproj","slug":"other-glucometer-de-lproj","files":["Glucometer/de.lproj/InfoPlist.strings","Glucometer/de.lproj/Localizable.strings"]},{"name":"Other — Glucometer-en.lproj","slug":"other-glucometer-en-lproj","files":["Glucometer/en.lproj/InfoPlist.strings","Glucometer/en.lproj/Localizable.strings"]},{"name":"Other — Glucometer-fr.lproj","slug":"other-glucometer-fr-lproj","files":["Glucometer/fr.lproj/InfoPlist.strings","Glucometer/fr.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatch Watch App-Assets.xcassets","slug":"other-glucometerwatch-watch-app-assets-xcassets","files":["GlucometerWatch Watch App/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatch Watch App/Assets.xcassets/Contents.json"]},{"name":"Other — GlucometerWatch Watch App","slug":"other-glucometerwatch-watch-app","files":["GlucometerWatch Watch App/GlucoseWatchViewModel.swift"]},{"name":"Other — GlucometerWatch Watch App-de.lproj","slug":"other-glucometerwatch-watch-app-de-lproj","files":["GlucometerWatch Watch App/de.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatch Watch App-en.lproj","slug":"other-glucometerwatch-watch-app-en-lproj","files":["GlucometerWatch Watch App/en.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatch Watch App-fr.lproj","slug":"other-glucometerwatch-watch-app-fr-lproj","files":["GlucometerWatch Watch App/fr.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatchComplication-Assets.xcassets","slug":"other-glucometerwatchcomplication-assets-xcassets","files":["GlucometerWatchComplication/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWatchComplication/Assets.xcassets/AppIcon.appiconset/Contents.json","GlucometerWatchComplication/Assets.xcassets/Contents.json","GlucometerWatchComplication/Assets.xcassets/WidgetBackground.colorset/Contents.json"]},{"name":"Other — GlucometerWatchComplication","slug":"other-glucometerwatchcomplication","files":["GlucometerWatchComplication/Info.plist"]},{"name":"Other — GlucometerWatchComplication-de.lproj","slug":"other-glucometerwatchcomplication-de-lproj","files":["GlucometerWatchComplication/de.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatchComplication-en.lproj","slug":"other-glucometerwatchcomplication-en-lproj","files":["GlucometerWatchComplication/en.lproj/Localizable.strings"]},{"name":"Other — GlucometerWatchComplication-fr.lproj","slug":"other-glucometerwatchcomplication-fr-lproj","files":["GlucometerWatchComplication/fr.lproj/Localizable.strings"]},{"name":"Other — GlucometerWidget-Assets.xcassets","slug":"other-glucometerwidget-assets-xcassets","files":["GlucometerWidget/Assets.xcassets/AccentColor.colorset/Contents.json","GlucometerWidget/Assets.xcassets/Contents.json","GlucometerWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json"]},{"name":"Other — GlucometerWidget","slug":"other-glucometerwidget","files":["GlucometerWidget/Info.plist"]},{"name":"Other — GlucometerWidget-de.lproj","slug":"other-glucometerwidget-de-lproj","files":["GlucometerWidget/de.lproj/Localizable.strings"]},{"name":"Other — GlucometerWidget-en.lproj","slug":"other-glucometerwidget-en-lproj","files":["GlucometerWidget/en.lproj/Localizable.strings"]},{"name":"Other — GlucometerWidget-fr.lproj","slug":"other-glucometerwidget-fr-lproj","files":["GlucometerWidget/fr.lproj/Localizable.strings"]},{"name":"Other — GlucozyWatchComplicationExtension.entitlements","slug":"other-glucozywatchcomplicationextension-entitlements","files":["GlucozyWatchComplicationExtension.entitlements"]},{"name":"Other — GlucozyWatchComplicationExtensionDebug.entitlements","slug":"other-glucozywatchcomplicationextensiondebug-entitlements","files":["GlucozyWatchComplicationExtensionDebug.entitlements"]},{"name":"Other — GlucozyWidgetExtension.entitlements","slug":"other-glucozywidgetextension-entitlements","files":["GlucozyWidgetExtension.entitlements"]},{"name":"Other — GlucozyWidgetExtensionDebug.entitlements","slug":"other-glucozywidgetextensiondebug-entitlements","files":["GlucozyWidgetExtensionDebug.entitlements"]},{"name":"Other — Spec.md","slug":"other-spec-md","files":["Spec.md"]},{"name":"Other — docs-superpowers","slug":"other-docs-superpowers","files":["docs/superpowers/specs/2026-04-01-watch-app-glucose-display-design.md"]},{"name":"Other — fastlane","slug":"other-fastlane","files":["fastlane/Appfile","fastlane/Fastfile","fastlane/README.md"]},{"name":"Other — graphify-out","slug":"other-graphify-out","files":["graphify-out/GRAPH_REPORT.md","graphify-out/cost.json","graphify-out/graph.html","graphify-out/graph.json","graphify-out/manifest.json"]},{"name":"Other — specs-landing-page","slug":"other-specs-landing-page","files":["specs/landing-page/prompt.md"]},{"name":"Other — tasks","slug":"other-tasks","files":["tasks/plan.md","tasks/todo.md"]}]}]};
(function() {
var activePage = 'overview';
document.addEventListener('DOMContentLoaded', function() {
mermaid.initialize({ startOnLoad: false, theme: 'neutral', securityLevel: 'loose' });
renderMeta();
renderNav();
document.getElementById('menu-toggle').addEventListener('click', function() {
document.getElementById('sidebar').classList.toggle('open');
});
if (location.hash && location.hash.length > 1) {
activePage = decodeURIComponent(location.hash.slice(1));
}
navigateTo(activePage);
});
function renderMeta() {
if (!META) return;
var el = document.getElementById('meta-info');
var parts = [];
if (META.generatedAt) {
parts.push(new Date(META.generatedAt).toLocaleDateString());
}
if (META.model) parts.push(META.model);
if (META.fromCommit) parts.push(META.fromCommit.slice(0, 8));
el.textContent = parts.join(' \u00b7 ');
}
function renderNav() {
var container = document.getElementById('nav-tree');
var html = '<div class="nav-section">';
html += '<a class="nav-item overview" data-page="overview" href="#overview">Overview</a>';
html += '</div>';
if (TREE.length > 0) {
html += '<div class="nav-group-label">Modules</div>';
html += buildNavTree(TREE);
}
container.innerHTML = html;
container.addEventListener('click', function(e) {
var target = e.target;
while (target && !target.dataset.page) { target = target.parentElement; }
if (target && target.dataset.page) {
e.preventDefault();
navigateTo(target.dataset.page);
}
});
}
function buildNavTree(nodes) {
var html = '';
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
html += '<div class="nav-section">';
html += '<a class="nav-item" data-page="' + escH(node.slug) + '" href="#' + encodeURIComponent(node.slug) + '">' + escH(node.name) + '</a>';
if (node.children && node.children.length > 0) {
html += '<div class="nav-children">' + buildNavTree(node.children) + '</div>';
}
html += '</div>';
}
return html;
}
function escH(s) {
var d = document.createElement('div');
d.textContent = s;
return d.innerHTML;
}
function navigateTo(page) {
activePage = page;
location.hash = encodeURIComponent(page);
var items = document.querySelectorAll('.nav-item');
for (var i = 0; i < items.length; i++) {
if (items[i].dataset.page === page) {
items[i].classList.add('active');
} else {
items[i].classList.remove('active');
}
}
var contentEl = document.getElementById('content');
var md = PAGES[page];
if (!md) {
contentEl.innerHTML = '<div class="empty-state"><h2>Page not found</h2><p>' + escH(page) + '.md does not exist.</p></div>';
return;
}
contentEl.innerHTML = marked.parse(md);
// Rewrite .md links to hash navigation
var links = contentEl.querySelectorAll('a[href]');
for (var i = 0; i < links.length; i++) {
var href = links[i].getAttribute('href');
if (href && href.endsWith('.md') && href.indexOf('://') === -1) {
var slug = href.replace(/\.md$/, '');
links[i].setAttribute('href', '#' + encodeURIComponent(slug));
(function(s) {
links[i].addEventListener('click', function(e) {
e.preventDefault();
navigateTo(s);
});
})(slug);
}
}
// Convert mermaid code blocks into mermaid divs
var mermaidBlocks = contentEl.querySelectorAll('pre code.language-mermaid');
for (var i = 0; i < mermaidBlocks.length; i++) {
var pre = mermaidBlocks[i].parentElement;
var div = document.createElement('div');
div.className = 'mermaid';
div.textContent = mermaidBlocks[i].textContent;
pre.parentNode.replaceChild(div, pre);
}
try { mermaid.run({ querySelector: '.mermaid' }); } catch(e) {}
window.scrollTo(0, 0);
document.getElementById('sidebar').classList.remove('open');
}
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment