From ce4f32c63f18c8ddf9e8cd9d5505879d5d882b62 Mon Sep 17 00:00:00 2001 From: Jon Seager Date: Sat, 7 Feb 2026 22:36:48 +0000 Subject: [PATCH] feat(icons): add icon macros, remap entity types, add icons to tabs and timeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add new icon macros: coffee_bean, grinder, cup (redesigned), pencil, clipboard, check, x_mark, arrow_down_tray, arrow_up_tray - Remove orphaned building and wrench macros - Remap entity icons: roast→coffee_bean, roaster→fire, gear→grinder - Replace pill labels with entity-type icons in homepage activity rows - Add entity-type icons to timeline cards and tab buttons - Fix brew/bag card action icons (cup→beaker) - Add entity_type field to TimelineEventView, add roaster detail picks --- src/presentation/web/views/timeline.rs | 3 ++ templates/pages/home.html | 16 ++++---- templates/partials/bag_card.html | 2 +- templates/partials/brew_card.html | 2 +- templates/partials/icons.html | 56 +++++++++++++++++++++----- templates/partials/tab_bar.html | 6 +-- templates/partials/timeline_month.html | 3 +- 7 files changed, 64 insertions(+), 24 deletions(-) diff --git a/src/presentation/web/views/timeline.rs b/src/presentation/web/views/timeline.rs index 8c9d826..181ccc8 100644 --- a/src/presentation/web/views/timeline.rs +++ b/src/presentation/web/views/timeline.rs @@ -46,6 +46,7 @@ pub struct TimelineBrewDataView { #[derive(Clone)] pub struct TimelineEventView { pub id: String, + pub entity_type: String, pub kind_label: &'static str, pub date_label: String, pub relative_date_label: String, @@ -137,6 +138,7 @@ impl TimelineEventView { Self { id: id.to_string(), + entity_type, kind_label, date_label: occurred_at.format("%B %d, %Y").to_string(), relative_date_label: relative_date(occurred_at), @@ -164,6 +166,7 @@ impl TimelineEventView { let picks: &[&str] = match entity_type { "brew" => &["Roaster", "Brewer"], "roast" => &["Roaster", "Origin"], + "roaster" => &["City", "Country"], "cafe" => &["City", "Country"], "cup" => &["Roaster", "Cafe"], _ => &[], diff --git a/templates/pages/home.html b/templates/pages/home.html index 3d37dce..ea4a551 100644 --- a/templates/pages/home.html +++ b/templates/pages/home.html @@ -192,14 +192,14 @@ is_authenticated %} {% for event in recent_events %}
- {{ event.kind_label }} + + {% if event.entity_type == "brew" %}{{ icons::beaker("h-5 w-5") }}{% elif event.entity_type == "roast" %}{{ icons::coffee_bean("h-5 w-5") }}{% elif event.entity_type == "roaster" %}{{ icons::fire("h-5 w-5") }}{% elif event.entity_type == "bag" %}{{ icons::bag("h-5 w-5") }}{% elif event.entity_type == "cup" %}{{ icons::cup("h-5 w-5") }}{% elif event.entity_type == "cafe" %}{{ icons::location("h-5 w-5") }}{% elif event.entity_type == "gear" %}{{ icons::grinder("h-5 w-5") }}{% else %}{{ icons::beaker("h-5 w-5") }}{% endif %} +

{{ event.title }}{% if let Some(sub) = event.subtitle %} - · {{ sub }}{% endif %} + · {{ sub }}{% endif %}

diff --git a/templates/partials/timeline_month.html b/templates/partials/timeline_month.html index 5bd6c6e..d244bb7 100644 --- a/templates/partials/timeline_month.html +++ b/templates/partials/timeline_month.html @@ -26,7 +26,8 @@ >
{# Category — always visible #} - + + {% if event.entity_type == "brew" %}{{ icons::beaker("h-3 w-3 shrink-0") }}{% elif event.entity_type == "roast" %}{{ icons::coffee_bean("h-3 w-3 shrink-0") }}{% elif event.entity_type == "roaster" %}{{ icons::fire("h-3 w-3 shrink-0") }}{% elif event.entity_type == "bag" %}{{ icons::bag("h-3 w-3 shrink-0") }}{% elif event.entity_type == "cup" %}{{ icons::cup("h-3 w-3 shrink-0") }}{% elif event.entity_type == "cafe" %}{{ icons::location("h-3 w-3 shrink-0") }}{% elif event.entity_type == "gear" %}{{ icons::grinder("h-3 w-3 shrink-0") }}{% endif %} {{ event.kind_label }} {# Relative date — shown when collapsed #} · {{ event.relative_date_label }}