fix(ui): condense add-entry to a compact disclosure trigger
Every section used to end with a wide horizontal add form (name
input, amount input, button, notes input spanning the row). It took
up more horizontal real estate than the entries themselves. Now the
form is wrapped in a <details class="add-entry"> whose summary is a
small tracked-caps link ("+ add fixed amount bills"). Click to
reveal the same form below; HTMX submission still resets and hides
on success.
Same treatment on the budget page sections and the month page
sections.
Refs #19
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2f571b236e
commit
1384fae5e4
3 changed files with 64 additions and 24 deletions
|
|
@ -421,6 +421,40 @@ tr.add-row td {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add-entry disclosure: collapsed trigger, expanded form */
|
||||||
|
details.add-entry { margin: 0; }
|
||||||
|
details.add-entry > summary {
|
||||||
|
list-style: none;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0.1rem 0.25rem;
|
||||||
|
}
|
||||||
|
details.add-entry > summary::-webkit-details-marker { display: none; }
|
||||||
|
details.add-entry .add-trigger {
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-size: 0.78rem;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--muted);
|
||||||
|
letter-spacing: 0.18em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
border-bottom: 1px dashed transparent;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
transition: color 0.12s ease, border-color 0.12s ease;
|
||||||
|
}
|
||||||
|
details.add-entry > summary:hover .add-trigger {
|
||||||
|
color: var(--ink);
|
||||||
|
border-bottom-color: var(--rule);
|
||||||
|
}
|
||||||
|
details.add-entry[open] > summary .add-trigger {
|
||||||
|
color: var(--ink);
|
||||||
|
border-bottom-color: var(--ink);
|
||||||
|
}
|
||||||
|
details.add-entry > .add-form,
|
||||||
|
details.add-entry > .month-add-form {
|
||||||
|
margin-top: 0.45rem;
|
||||||
|
}
|
||||||
|
|
||||||
.entry-name {
|
.entry-name {
|
||||||
font-family: var(--sans);
|
font-family: var(--sans);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,8 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if editable %}
|
{% if editable %}
|
||||||
<div class="add-row">
|
<div class="add-row">
|
||||||
|
<details class="add-entry">
|
||||||
|
<summary><span class="add-trigger">+ add {{ section.label|lower }}</span></summary>
|
||||||
<form
|
<form
|
||||||
class="add-form month-add-form"
|
class="add-form month-add-form"
|
||||||
hx-post="/month/{{ month.year_month }}/sections/{{ section.section.value }}/entries"
|
hx-post="/month/{{ month.year_month }}/sections/{{ section.section.value }}/entries"
|
||||||
|
|
@ -215,6 +217,7 @@
|
||||||
<button type="submit">Add</button>
|
<button type="submit">Add</button>
|
||||||
<input class="notes-input add-notes" type="text" name="notes" placeholder="notes (optional)">
|
<input class="notes-input add-notes" type="text" name="notes" placeholder="notes (optional)">
|
||||||
</form>
|
</form>
|
||||||
|
</details>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<tr class="add-row">
|
<tr class="add-row">
|
||||||
<td colspan="4">
|
<td colspan="4">
|
||||||
|
<details class="add-entry">
|
||||||
|
<summary><span class="add-trigger">+ add {{ section.label|lower }}</span></summary>
|
||||||
<form
|
<form
|
||||||
class="add-form"
|
class="add-form"
|
||||||
hx-post="/sections/{{ section.section.value }}/entries"
|
hx-post="/sections/{{ section.section.value }}/entries"
|
||||||
|
|
@ -56,6 +58,7 @@
|
||||||
<button type="submit">Add</button>
|
<button type="submit">Add</button>
|
||||||
<input class="notes-input add-notes" type="text" name="notes" placeholder="notes (optional)">
|
<input class="notes-input add-notes" type="text" name="notes" placeholder="notes (optional)">
|
||||||
</form>
|
</form>
|
||||||
|
</details>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue