From 2d27228059296f746e7585194f1904a258b4156f Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Tue, 3 Feb 2026 13:03:43 +0000 Subject: [PATCH] refactor(tables): standardise Added column as first column across all tables Move the Added/Date column to first position in brew, gear, and bag list templates and apply consistent text-xs font-medium text-stone-600 styling. Document the pattern in CLAUDE.md. --- CLAUDE.md | 12 ++++++++++++ templates/partials/bag_list.html | 12 +++++++----- templates/partials/brew_list.html | 6 ++++-- templates/partials/gear_list.html | 8 ++++---- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f016f88..8994159 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -354,6 +354,18 @@ Three macros are available: - **`pagination_header(items, navigator, target_selector)`** — prev/next buttons, page count, rows-per-page selector; hidden on mobile via `pagination-controls hidden md:flex` - **`sortable_header(label, key, navigator, target_selector)`** — clickable column header with sort direction arrows +### "Added" Column + +Every table has a sortable "Added" column as its **first column**, sorted by `created-at`. It uses a distinct smaller style to visually separate it from content columns: + +```html + + {{ item.created_at }} + +``` + +The `text-xs font-medium text-stone-600` classes give it a muted, compact appearance compared to the default `text-sm` body text. + ### Responsive Table Pattern Tables use the `responsive-table` CSS class which converts rows to card-style layout on mobile (`max-width: 767px`). The CSS in `styles.css` hides `` and uses `data-label` attributes on `` elements to show field labels. diff --git a/templates/partials/bag_list.html b/templates/partials/bag_list.html index 9b649e2..744ab50 100644 --- a/templates/partials/bag_list.html +++ b/templates/partials/bag_list.html @@ -102,22 +102,24 @@ - {% call table::sortable_header("Roaster", "roaster", navigator, "#bag-list") %} {% - call table::sortable_header("Roast", "roast", navigator, "#bag-list") %} + {% call table::sortable_header("Added", "created-at", navigator, "#bag-list") %} + {% call table::sortable_header("Roaster", "roaster", navigator, "#bag-list") %} + {% call table::sortable_header("Roast", "roast", navigator, "#bag-list") %} - {% call table::sortable_header("Added", "created-at", navigator, "#bag-list") %} {% - call table::sortable_header("Finished", "finished-at", navigator, "#bag-list") %} + {% call table::sortable_header("Finished", "finished-at", navigator, "#bag-list") %} {% for bag in bags.items %} + - {% endfor %} diff --git a/templates/partials/brew_list.html b/templates/partials/brew_list.html index 1d2fab5..133e958 100644 --- a/templates/partials/brew_list.html +++ b/templates/partials/brew_list.html @@ -10,12 +10,12 @@
Weight
+ {{ bag.created_at }} + {{ bag.roaster_name }} {{ bag.roast_name }} {{ bag.amount }}g{{ bag.created_at }} {{ bag.finished_at }}
+ {% call table::sortable_header("Added", "created-at", navigator, "#brew-list") %} - {% call table::sortable_header("Date", "created-at", navigator, "#brew-list") %} {% if is_authenticated %} {% endif %} @@ -24,6 +24,9 @@ {% for brew in brews.items %} + {% endif %} - {% if is_authenticated %}
Coffee Grind Recipe Temp BrewerActions
+ {{ brew.created_at }} + {{ fp_name }}{{ brew.created_at }}
diff --git a/templates/partials/gear_list.html b/templates/partials/gear_list.html index 61deaea..e748184 100644 --- a/templates/partials/gear_list.html +++ b/templates/partials/gear_list.html @@ -18,10 +18,10 @@ + {% call table::sortable_header("Added", "created-at", navigator, "#gear-list") %} {% call table::sortable_header("Category", "category", navigator, "#gear-list") %} {% call table::sortable_header("Make", "make", navigator, "#gear-list") %} {% call table::sortable_header("Model", "model", navigator, "#gear-list") %} - {% call table::sortable_header("Added", "created-at", navigator, "#gear-list") %} {% if is_authenticated %} {% endif %} @@ -30,6 +30,9 @@ {% for item in gear.items %} + - {% if is_authenticated %}
Actions
+ {{ item.created_at }} + {{ item.category_label }} @@ -41,9 +44,6 @@ {{ item.model }} - {{ item.created_at }} -