Files
workout/templates/changelog/changelog.html
Peter Stockings dd82f461be feat: Add workout program management
- Create database tables: workout_program, program_session, person_program_assignment.
- Add Flask blueprint `routes/programs.py` with routes for creating, listing, viewing, and deleting programs.
- Implement program creation form (`templates/program_create.html`):
    - Allows defining program name, description, and multiple sessions.
    - Each session includes a name and dynamically added exercise selections.
    - Uses `tail.select` for searchable exercise dropdowns.
    - JavaScript handles dynamic addition/removal of sessions and exercises.
- Implement backend logic for program creation:
    - Parses form data including multiple exercises per session.
    - Automatically finds or creates non-person-specific tags based on selected exercises for each session.
    - Saves program and session data, linking sessions to appropriate tags.
- Implement program list view (`templates/program_list.html`):
    - Displays existing programs.
    - Includes HTMX-enabled delete button for each program.
    - Links program names to the view page using HTMX for dynamic loading.
- Implement program detail view (`templates/program_view.html`):
    - Displays program name, description, and sessions.
    - Parses session tag filters to retrieve and display associated exercises.
- Update changelog with details of the new feature.
2025-04-24 20:17:30 +10:00

185 lines
10 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="p-4 md:p-6"> {# Add some overall padding for the page content area #}
<div class="bg-white shadow-md rounded-lg p-6"> {# Card container #}
<h1 class="text-2xl font-semibold text-gray-900 mb-6 border-b pb-2">Changelog</h1> {# Added bottom border to
heading #}
{# Container for the actual changelog entries with prose styling #}
<div class="prose max-w-none">
<p>Updates and changes to the site will be documented here, with the most recent changes listed first.</p>
<!-- New Entry for Workout Programs -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">April 24, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Added Workout Program Management:</li>
<ul class="list-disc pl-5 space-y-1">
<li>Created new database tables (`workout_program`, `program_session`, `person_program_assignment`).
</li>
<li>Added a new section under `/programs/` to create, view, and list workout program templates.</li>
<li>Program creation allows defining multiple sessions, each with a name and a list of selected
exercises.</li>
<li>The system automatically finds or creates non-person-specific tags based on the selected
exercises for each session.</li>
<li>Added functionality to delete programs from the list view.</li>
<li>Implemented HTMX for dynamic loading of the program view page from the list page.</li>
<li>Integrated `tail.select` for searchable exercise dropdowns in the program creation form.</li>
</ul>
</ul>
<!-- New Entry for SQL Explorer SVG Plots -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">April 19, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Refactored tag management functionality:</li>
<ul class="list-disc pl-5 space-y-1">
<li>Moved tag-related routes (`add_tag`, `delete_tag`, `goto_tag`) from `app.py` to a new blueprint
`routes/tags.py`.</li>
<li>Changed `add_tag` endpoint to use `POST` and `delete_tag` to use `DELETE`.</li>
<li>Updated `add_tag` and `delete_tag` to return the updated `tags.html` partial via HTMX swap.</li>
<li>Wrapped the inclusion of `tags.html` in `dashboard.html` and `person_overview.html` with
`div#container` for correct HTMX targeting.</li>
</ul>
</ul>
<!-- New Entry for SQL Explorer SVG Plots -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">April 15, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Replaced Plotly graph generation in SQL Explorer with direct SVG rendering:</li>
<ul class="list-disc pl-5 space-y-1">
<li>Updated `plot_query` and `plot_unsaved_query` endpoints in `routes/sql_explorer.py` to fetch raw
data.</li>
<li>Added `prepare_svg_plot_data` function in `utils.py` to process data and determine plot type
(scatter, line, bar, or table fallback).</li>
<li>Created `templates/partials/sql_explorer/svg_plot.html` template to render SVG plots with axes
and basic tooltips.</li>
<li>Removes the need for Plotly library for SQL Explorer plots, reducing dependencies and
potentially improving load times.</li>
</ul>
</ul>
<!-- New Entry for Dismissible Exercise Graph -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">April 13, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Added a dismissible exercise progress graph to the workout page:</li>
<ul class="list-disc pl-5 space-y-1">
<li>Added a graph icon next to each exercise name in the topset list
(`templates/partials/topset.html`).</li>
<li>Clicking the icon loads the exercise progress graph inline using HTMX (`hx-get`, `hx-target`).
</li>
<li>Added a dismiss button (cross icon) to the loaded graph area.</li>
<li>Implemented hyperscript (`_`) logic to show the dismiss button when the graph loads and clear
the graph/hide the button when clicked.</li>
</ul>
</ul>
<!-- New Entry for Data Export -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">April 12, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Added functionality to export data from the Settings page:</li>
<ul class="list-disc pl-5 space-y-1">
<li>Export all workout set data as a CSV file.</li>
<li>Export full database schema (CREATE statements) and data (INSERT statements) as an SQL script.
</li>
</ul>
</ul>
<!-- New Entry for SQL Generation -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">April 5, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Added experimental feature to SQL Explorer to generate SQL queries from natural language using the
Gemini REST API. Requires `GEMINI_API_KEY` environment variable, set Gemni model via GEMINI_MODEL
environment variable</li>
</ul>
<!-- New Entry for Endpoints Refactoring -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 31, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Refactored endpoint listing/searching functionality into its own blueprint (`routes/endpoints.py`
with `/endpoints` prefix).</li>
<li>Updated relevant `url_for` calls in templates to use the new `endpoints.` prefix.</li>
</ul>
<!-- New Entry for SQL Explorer Refactoring -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 31, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Refactored SQL Explorer functionality into its own blueprint (`routes/sql_explorer.py` with `/sql`
prefix).</li>
<li>Moved SQL Explorer logic from `features/sql_explorer.py` into the blueprint for better
encapsulation.</li>
<li>Updated relevant `url_for` calls in templates to use the new `sql_explorer.` prefix.</li>
</ul>
<!-- New Entry for Workout Refactoring -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 31, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Refactored workout functionality (create/delete/edit workouts, topsets, tags) into its own blueprint
(`routes/workout.py`).</li>
<li>Moved workout view model logic from `features/workout.py` into the `routes/workout.py` blueprint.
</li>
<li>Updated relevant `url_for` calls in templates to use the new `workout.` prefix.</li>
</ul>
<!-- New Entry for Calendar Year View Fix -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 31, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Fixed `AttributeError` in calendar year view caused by passing a date string instead of a date
object to the template.</li>
</ul>
<!-- New Entry for Notes Refactoring -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 31, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Refactored notes functionality (viewing/editing workout notes) into its own blueprint
(`routes/notes.py`).</li>
<li>Moved notes-specific database logic from `db.py` into the `routes/notes.py` blueprint for better
encapsulation.</li>
</ul>
<!-- New Entry for Refactoring -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 30, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Refactored the calendar view and logic into its own blueprint (`routes/calendar.py`).</li>
<li>Cleaned up calendar code, removing the `Calendar` class and `pandas` dependency.</li>
<li>Fixed various bugs related to the calendar refactoring (circular imports, HTMX checks, `url_for`
build errors, date comparisons).</li>
</ul>
<!-- Example Entry Structure -->
<hr class="my-6"> {# Increased margin for HR #}
<h2 class="text-xl font-semibold mb-2">March 30, 2025</h2> {# Reduced margin-bottom for H2 #}
<ul class="list-disc pl-5 space-y-1"> {# Added space between list items #}
<li>Added the initial changelog page.</li>
<li>Fixed a minor styling issue on the dashboard.</li>
<li>Improved visual styling of the changelog page itself.</li> {# Added an entry for this change #}
<li>Refactored the calendar view and logic into its own blueprint (`routes/calendar.py`).</li>
</ul>
{# Add more entries below, following the pattern above #}
<!--
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 29, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Implemented feature X.</li>
<li>Refactored component Y.</li>
</ul>
-->
</div>
</div>
</div>
{% endblock %}