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:
@@ -73,13 +73,13 @@ async def focus_view(
|
|||||||
domain_map[dk] = {"label": dl, "color": dc, "areas": OrderedDict()}
|
domain_map[dk] = {"label": dl, "color": dc, "areas": OrderedDict()}
|
||||||
|
|
||||||
ak = item.get("effective_area_id") or "__none__"
|
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"]
|
area_map = domain_map[dk]["areas"]
|
||||||
if ak not in area_map:
|
if ak not in area_map:
|
||||||
area_map[ak] = {"label": al, "projects": OrderedDict()}
|
area_map[ak] = {"label": al, "projects": OrderedDict()}
|
||||||
|
|
||||||
pk = item.get("effective_project_id") or "__none__"
|
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"]
|
proj_map = area_map[ak]["projects"]
|
||||||
if pk not in proj_map:
|
if pk not in proj_map:
|
||||||
proj_map[pk] = {"label": pl, "rows": []}
|
proj_map[pk] = {"label": pl, "rows": []}
|
||||||
|
|||||||
@@ -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>
|
<span style="font-weight:700;font-size:0.8rem;letter-spacing:0.03em;text-transform:uppercase;color:var(--text)">{{ domain.label }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% for area in domain.areas %}
|
{% for area in domain.areas %}
|
||||||
{% if area.label %}
|
|
||||||
<!-- Area header -->
|
<!-- Area header -->
|
||||||
<div style="padding:3px 10px 3px 24px;border-bottom:1px solid var(--border);background:var(--surface2);">
|
<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>
|
<span style="font-weight:600;font-size:0.78rem;color:var(--muted)">{{ area.label }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% for project in area.projects %}
|
{% for project in area.projects %}
|
||||||
{% if project.label %}
|
|
||||||
<!-- Project header -->
|
<!-- Project header -->
|
||||||
<div style="padding:2px 10px 2px 40px;border-bottom:1px solid var(--border);">
|
<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>
|
<span style="font-weight:500;font-size:0.75rem;color:var(--muted)">{{ project.label }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
{% for item in project.rows %}
|
{% for item in project.rows %}
|
||||||
<div class="focus-item {{ 'completed' if item.completed }}" style="padding:3px 8px;min-height:0;">
|
<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} %}
|
{% with reorder_url="/focus/reorder", item_id=item.id, extra_fields={"focus_date": focus_date|string} %}
|
||||||
|
|||||||
Reference in New Issue
Block a user