fix(brews): lay out action icons horizontally and merge temp into recipe
Wrap the brew-again form and delete button in an inline-flex container to match the horizontal layout used in other tables. Fold water temperature into the Recipe column as desktop subtext alongside the ratio, reducing the table from 7 to 6 columns and eliminating the horizontal scrollbar. Document the Actions column pattern in CLAUDE.md.
This commit is contained in:
parent
2d27228059
commit
35e8460219
2 changed files with 51 additions and 35 deletions
15
CLAUDE.md
15
CLAUDE.md
|
|
@ -366,6 +366,21 @@ Every table has a sortable "Added" column as its **first column**, sorted by `cr
|
||||||
|
|
||||||
The `text-xs font-medium text-stone-600` classes give it a muted, compact appearance compared to the default `text-sm` body text.
|
The `text-xs font-medium text-stone-600` classes give it a muted, compact appearance compared to the default `text-sm` body text.
|
||||||
|
|
||||||
|
### Actions Column
|
||||||
|
|
||||||
|
When a row has multiple action buttons/icons, wrap them in `<div class="inline-flex items-center gap-1">` inside the `<td>` to keep them horizontal. Without this wrapper, block-level elements like `<form>` will stack vertically.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<td data-label="" class="px-4 py-3 text-right">
|
||||||
|
<div class="inline-flex items-center gap-1">
|
||||||
|
<form class="inline" ...>
|
||||||
|
<button type="submit" class="inline-flex h-8 w-8 ...">...</button>
|
||||||
|
</form>
|
||||||
|
<button type="button" class="inline-flex h-8 w-8 ...">...</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
```
|
||||||
|
|
||||||
### Responsive Table Pattern
|
### 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 `<thead>` and uses `data-label` attributes on `<td>` elements to show field labels.
|
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 `<thead>` and uses `data-label` attributes on `<td>` elements to show field labels.
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
<th scope="col" class="px-4 py-3">Coffee</th>
|
<th scope="col" class="px-4 py-3">Coffee</th>
|
||||||
<th scope="col" class="px-4 py-3">Grind</th>
|
<th scope="col" class="px-4 py-3">Grind</th>
|
||||||
<th scope="col" class="px-4 py-3">Recipe</th>
|
<th scope="col" class="px-4 py-3">Recipe</th>
|
||||||
<th scope="col" class="px-4 py-3">Temp</th>
|
|
||||||
<th scope="col" class="px-4 py-3">Brewer</th>
|
<th scope="col" class="px-4 py-3">Brewer</th>
|
||||||
{% if is_authenticated %}
|
{% if is_authenticated %}
|
||||||
<th scope="col" class="px-4 py-3 text-center">Actions</th>
|
<th scope="col" class="px-4 py-3 text-center">Actions</th>
|
||||||
|
|
@ -51,10 +50,10 @@
|
||||||
<td data-label="Grinder" class="px-4 py-3 whitespace-nowrap md:hidden">{{ brew.grinder_name }}</td>
|
<td data-label="Grinder" class="px-4 py-3 whitespace-nowrap md:hidden">{{ brew.grinder_name }}</td>
|
||||||
<td data-label="Recipe" class="px-4 py-3 whitespace-nowrap">
|
<td data-label="Recipe" class="px-4 py-3 whitespace-nowrap">
|
||||||
<div>{{ brew.coffee_weight }} / {{ brew.water_volume }}</div>
|
<div>{{ brew.coffee_weight }} / {{ brew.water_volume }}</div>
|
||||||
<div class="hidden md:block text-xs text-stone-500 font-mono">{{ brew.ratio }}</div>
|
<div class="hidden md:block text-xs text-stone-500">{{ brew.ratio }} · {{ brew.water_temp }}</div>
|
||||||
</td>
|
</td>
|
||||||
<td data-label="Ratio" class="px-4 py-3 whitespace-nowrap md:hidden">{{ brew.ratio }}</td>
|
<td data-label="Ratio" class="px-4 py-3 whitespace-nowrap md:hidden">{{ brew.ratio }}</td>
|
||||||
<td data-label="Temp" class="px-4 py-3 whitespace-nowrap">{{ brew.water_temp }}</td>
|
<td data-label="Temp" class="px-4 py-3 whitespace-nowrap md:hidden">{{ brew.water_temp }}</td>
|
||||||
<td data-label="Brewer" class="px-4 py-3 whitespace-nowrap">
|
<td data-label="Brewer" class="px-4 py-3 whitespace-nowrap">
|
||||||
<div>{{ brew.brewer_name }}</div>
|
<div>{{ brew.brewer_name }}</div>
|
||||||
{% if let Some(fp_name) = brew.filter_paper_name %}
|
{% if let Some(fp_name) = brew.filter_paper_name %}
|
||||||
|
|
@ -66,6 +65,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if is_authenticated %}
|
{% if is_authenticated %}
|
||||||
<td data-label="" class="px-4 py-3 text-right">
|
<td data-label="" class="px-4 py-3 text-right">
|
||||||
|
<div class="inline-flex items-center gap-1">
|
||||||
<form class="inline" data-on:submit="@post('/api/v1/brews?{{ navigator.query() }}', {contentType: 'form', responseOverrides: {selector: '#brew-list', mode: 'replace'}})">
|
<form class="inline" data-on:submit="@post('/api/v1/brews?{{ navigator.query() }}', {contentType: 'form', responseOverrides: {selector: '#brew-list', mode: 'replace'}})">
|
||||||
<input type="hidden" name="bag_id" value="{{ brew.bag_id }}" />
|
<input type="hidden" name="bag_id" value="{{ brew.bag_id }}" />
|
||||||
<input type="hidden" name="coffee_weight" value="{{ brew.coffee_weight_raw }}" />
|
<input type="hidden" name="coffee_weight" value="{{ brew.coffee_weight_raw }}" />
|
||||||
|
|
@ -107,6 +107,7 @@
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue