feat: universal reorder grip handles and compact UI density

- Add generic move_in_order() to BaseRepository for reorder support
- Add reusable reorder_arrows.html partial with grip dot handles
- Add reorder routes to all 9 list routers (tasks, notes, links, contacts, meetings, decisions, appointments, lists, focus)
- Compact row padding (6px 12px, gap 8px) on .list-row and .focus-item
- Reduce font size to 0.80rem on row titles, sidebar nav, domain tree

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 01:45:02 +00:00
parent 27e07fefe1
commit 1628a4a748
22 changed files with 300 additions and 8 deletions

View File

@@ -30,6 +30,9 @@
{% endif %}
<div class="list-row">
{% with reorder_url="/appointments/reorder", item_id=appt.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
<div style="flex-shrink: 0; min-width: 60px;">
{% if appt.all_day %}
<span class="status-badge status-active" style="font-size: 0.72rem;">All Day</span>

View File

@@ -8,6 +8,9 @@
<div class="card">
{% for item in items %}
<div class="list-row">
{% with reorder_url="/contacts/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
<span class="row-title"><a href="/contacts/{{ item.id }}">{{ item.first_name }} {{ item.last_name or '' }}</a></span>
{% if item.company %}<span class="row-tag">{{ item.company }}</span>{% endif %}
{% if item.role %}<span class="row-meta">{{ item.role }}</span>{% endif %}

View File

@@ -25,6 +25,9 @@
<div class="card mt-3">
{% for item in items %}
<div class="list-row">
{% with reorder_url="/decisions/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
<span class="row-title"><a href="/decisions/{{ item.id }}">{{ item.title }}</a></span>
<span class="status-badge status-{{ item.status }}">{{ item.status }}</span>
<span class="row-tag impact-{{ item.impact }}">{{ item.impact }}</span>

View File

@@ -16,6 +16,9 @@
{% if items %}
{% for item in items %}
<div class="focus-item {{ 'completed' if item.completed }}">
{% with reorder_url="/focus/reorder", item_id=item.id, extra_fields={"focus_date": focus_date|string} %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
<form action="/focus/{{ item.id }}/toggle" method="post" style="display:inline">
<div class="row-check">
<input type="checkbox" id="f-{{ item.id }}" {{ 'checked' if item.completed }} onchange="this.form.submit()">

View File

@@ -8,6 +8,9 @@
<div class="card">
{% for item in items %}
<div class="list-row">
{% with reorder_url="/links/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
{% if item.domain_color %}<span class="row-domain-tag" style="background:{{ item.domain_color }}22;color:{{ item.domain_color }}">{{ item.domain_name }}</span>{% endif %}
<span class="row-title"><a href="{{ item.url }}" target="_blank">{{ item.label }}</a></span>
{% if item.project_name %}<span class="row-tag">{{ item.project_name }}</span>{% endif %}

View File

@@ -46,6 +46,9 @@
<div class="card mt-2">
{% for li in list_items %}
<div class="list-row {{ 'completed' if li.completed }}">
{% with reorder_url="/lists/" ~ item.id ~ "/items/reorder", item_id=li.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
{% if item.list_type == 'checklist' %}
<div class="row-check">
<form action="/lists/{{ item.id }}/items/{{ li.id }}/toggle" method="post" style="display:inline">
@@ -68,6 +71,9 @@
<!-- Child items -->
{% for child in child_map.get(li.id|string, []) %}
<div class="list-row {{ 'completed' if child.completed }}" style="padding-left: 48px;">
{% with reorder_url="/lists/" ~ item.id ~ "/items/reorder", item_id=child.id, extra_fields={"parent_id": li.id|string} %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
{% if item.list_type == 'checklist' %}
<div class="row-check">
<form action="/lists/{{ item.id }}/items/{{ child.id }}/toggle" method="post" style="display:inline">

View File

@@ -25,6 +25,9 @@
<div class="card mt-3">
{% for item in items %}
<div class="list-row">
{% with reorder_url="/lists/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
<span class="row-title"><a href="/lists/{{ item.id }}">{{ item.name }}</a></span>
<span class="row-meta">
{{ item.completed_count }}/{{ item.item_count }} items

View File

@@ -18,6 +18,9 @@
<div class="card mt-3">
{% for item in items %}
<div class="list-row">
{% with reorder_url="/meetings/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
<span class="row-title"><a href="/meetings/{{ item.id }}">{{ item.title }}</a></span>
<span class="row-meta">{{ item.meeting_date }}</span>
{% if item.location %}

View File

@@ -8,6 +8,9 @@
<div class="card">
{% for item in items %}
<div class="list-row">
{% with reorder_url="/notes/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
{% if item.domain_color %}<span class="row-domain-tag" style="background:{{ item.domain_color }}22;color:{{ item.domain_color }}">{{ item.domain_name }}</span>{% endif %}
<span class="row-title"><a href="/notes/{{ item.id }}">{{ item.title }}</a></span>
{% if item.project_name %}<span class="row-tag">{{ item.project_name }}</span>{% endif %}

View File

@@ -0,0 +1,30 @@
{#
Reorder grip handle. Include with:
{% with reorder_url="/focus/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
Required context vars:
reorder_url - POST endpoint for the reorder action
item_id - ID of the current item
Optional:
extra_fields - dict of extra hidden fields (e.g. {"focus_date": "2026-03-03"})
#}
<span class="reorder-grip">
<form action="{{ reorder_url }}" method="post">
<input type="hidden" name="item_id" value="{{ item_id }}">
<input type="hidden" name="direction" value="up">
{% if extra_fields %}{% for k, v in extra_fields.items() %}
<input type="hidden" name="{{ k }}" value="{{ v }}">
{% endfor %}{% endif %}
<button type="submit" class="grip-btn" title="Move up"></button>
</form>
<form action="{{ reorder_url }}" method="post">
<input type="hidden" name="item_id" value="{{ item_id }}">
<input type="hidden" name="direction" value="down">
{% if extra_fields %}{% for k, v in extra_fields.items() %}
<input type="hidden" name="{{ k }}" value="{{ v }}">
{% endfor %}{% endif %}
<button type="submit" class="grip-btn" title="Move down"></button>
</form>
</span>

View File

@@ -53,6 +53,9 @@
<div class="card">
{% for item in items %}
<div class="list-row {{ 'completed' if item.status in ['done', 'cancelled'] }} {{ 'timer-active' if running_task_id and item.id|string == running_task_id }}">
{% with reorder_url="/tasks/reorder", item_id=item.id %}
{% include 'partials/reorder_arrows.html' %}
{% endwith %}
<div class="row-check">
<form action="/tasks/{{ item.id }}/toggle" method="post" style="display:inline">
<input type="checkbox" id="check-{{ item.id }}" {{ 'checked' if item.status == 'done' }}