Skip to content

adding grade's passage documentation to the app #1

@dynamikdev

Description

@dynamikdev

Track: Curriculum Integration

Overview

This feature integrates the HEMA curriculum documents (extracted as images from PDFs) into the application. It allows users to browse and read the "Passage de Grade" requirements directly within the tool, replacing the main training area when active.

Functional Requirements

  • Sidebar Navigation: Add a new "Curriculum" tab or section to the settings sidebar.
  • Grade & Document Selection: Users can select the Grade Level (e.g., Niveau 1.1) and specific documents from the sidebar.
  • Document Visualisation: When a document is selected, the central training circle is replaced by the document viewer (displaying the extracted JPEG pages).
  • Page Navigation:
    • Visual Buttons: "Previous" and "Next" buttons in the UI.
    • Keyboard Shortcuts: Use Left and Right arrow keys to flip pages.
  • Training Interruption: Opening the curriculum view automatically pauses any active training sequence (SequenceState.running = false).

UI Design

  • Main View Replacement: The document page (JPEG) should scale to fill the primary training area (the left side of the screen) while maintaining its aspect ratio.
  • Sidebar Integration: Navigation controls for grades, documents, and page numbers integrated into the right-hand settings panel.

Acceptance Criteria

  • Users can browse all grade levels found in assets/Grades Escrime.
  • Selecting a document successfully loads and displays the first page.
  • Page navigation (Prev/Next) works via UI buttons and keyboard arrows.
  • Opening the curriculum pauses the trainer.
  • Transitioning back to "Training" restores the training circle.

Out of Scope

  • Native PDF/DOCX rendering (using extracted images instead).
  • Video playback for curriculum videos (only documents are integrated in this track).
  • Full-screen modal overlay (using main area replacement instead).

Implementation Plan: Curriculum Integration

Phase 1: Data Structures and State

  • Task: Define CurriculumState resource in src/resources.rs to track visibility, selected grade/document, and current page.
  • Task: Create a static CurriculumManifest in src/constants.rs mapping the assets/Grades Escrime folder structure.
  • Task: Implement TDD for CurriculumState initialization and basic state transitions in src/resources_test.rs.
  • Task: Conductor - User Manual Verification 'Phase 1: Data Structures and State' (Protocol in workflow.md)

Phase 2: Sidebar UI Integration

  • Task: Add a "Curriculum" tab/button to the settings sidebar in src/ui/settings.rs.
  • Task: Implement logic to toggle CurriculumState.is_visible and pause training when opened.
  • Task: Add dropdowns/buttons for selecting Grade and Document within the sidebar.
  • Task: Write tests for sidebar interaction and state synchronization in src/ui/setup_test.rs or a new src/ui/settings_test.rs.
  • Task: Conductor - User Manual Verification 'Phase 2: Sidebar UI Integration' (Protocol in workflow.md)

Phase 3: Main View Replacement & Navigation

  • Task: Create src/ui/curriculum.rs to handle the document viewer UI logic.
  • Task: Implement a system to swap the Training Circle with the Document Image when curriculum is active.
  • Task: Add "Previous" and "Next" page navigation buttons to the sidebar or a bottom overlay.
  • Task: Map Left/Right arrow keys to page navigation in src/logic.rs or src/ui/systems.rs.
  • Task: Write tests for page navigation logic and image loading in a new src/ui/curriculum_test.rs.
  • Task: Conductor - User Manual Verification 'Phase 3: Main View Replacement & Navigation' (Protocol in workflow.md)

Phase 4: Dynamic Asset Loading

  • Task: Implement a system to dynamically load all page-XX.jpg handles for a selected document into CurriculumState.pages.
  • Task: Ensure smooth transitions between pages with proper asset handle management.
  • Task: Verify that switching back to "Training" correctly restores the training circle and sequence logic.
  • Task: Conductor - User Manual Verification 'Phase 4: Dynamic Asset Loading' (Protocol in workflow.md)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions