fix: show "General" headers for items without area/project in focus hierarchy

Items without a project or area were missing group headers, causing them
to appear under the previous project's group visually.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-03 15:26:42 +00:00
parent 73be08e7cc
commit 4c51a1daad
2 changed files with 2 additions and 6 deletions

View File

@@ -73,13 +73,13 @@ async def focus_view(
domain_map[dk] = {"label": dl, "color": dc, "areas": OrderedDict()}
ak = item.get("effective_area_id") or "__none__"
al = item.get("area_name") or ""
al = item.get("area_name") or "General"
area_map = domain_map[dk]["areas"]
if ak not in area_map:
area_map[ak] = {"label": al, "projects": OrderedDict()}
pk = item.get("effective_project_id") or "__none__"
pl = item.get("project_name") or ""
pl = item.get("project_name") or "General"
proj_map = area_map[ak]["projects"]
if pk not in proj_map:
proj_map[pk] = {"label": pl, "rows": []}

View File

@@ -22,19 +22,15 @@
<span style="font-weight:700;font-size:0.8rem;letter-spacing:0.03em;text-transform:uppercase;color:var(--text)">{{ domain.label }}</span>
</div>
{% for area in domain.areas %}
{% if area.label %}
<!-- Area header -->
<div style="padding:3px 10px 3px 24px;border-bottom:1px solid var(--border);background:var(--surface2);">
<span style="font-weight:600;font-size:0.78rem;color:var(--muted)">{{ area.label }}</span>
</div>
{% endif %}
{% for project in area.projects %}
{% if project.label %}
<!-- Project header -->
<div style="padding:2px 10px 2px 40px;border-bottom:1px solid var(--border);">
<span style="font-weight:500;font-size:0.75rem;color:var(--muted)">{{ project.label }}</span>
</div>
{% endif %}
{% for item in project.rows %}
<div class="focus-item {{ 'completed' if item.completed }}" style="padding:3px 8px;min-height:0;">
{% with reorder_url="/focus/reorder", item_id=item.id, extra_fields={"focus_date": focus_date|string} %}