various bug fixes Sunday 20260301 5:15pm

This commit is contained in:
2026-03-01 23:44:47 +00:00
parent bcb0007217
commit 9dedf6dbf2
9 changed files with 2078 additions and 254 deletions

View File

@@ -170,15 +170,6 @@ function escHtml(s) {
} }
// ---- Mobile More Panel ----
function toggleMobileMore() {
const panel = document.getElementById('mobile-more-panel');
const btn = document.getElementById('mobile-more-btn');
if (panel) panel.classList.toggle('open');
if (btn) btn.classList.toggle('active');
}
// ---- Timer Pill (topbar running timer) ---- // ---- Timer Pill (topbar running timer) ----
let timerStartAt = null; let timerStartAt = null;
@@ -243,3 +234,19 @@ document.addEventListener('DOMContentLoaded', () => {
pollTimer(); pollTimer();
setInterval(pollTimer, 30000); setInterval(pollTimer, 30000);
}); });
// ---- Mobile More Panel ----
document.addEventListener('DOMContentLoaded', function() {
var btn = document.getElementById('mobMoreBtn');
var panel = document.getElementById('mobMore');
var overlay = document.getElementById('mobOverlay');
if (!btn || !panel || !overlay) return;
btn.addEventListener('click', function() {
panel.classList.toggle('open');
overlay.classList.toggle('open');
});
overlay.addEventListener('click', function() {
panel.classList.remove('open');
overlay.classList.remove('open');
});
});

View File

@@ -750,6 +750,25 @@ a:hover { color: var(--accent-hover); }
gap: 20px; gap: 20px;
} }
.stat-card-link {
text-decoration: none;
color: inherit;
display: block;
}
.stat-card-link .stat-card {
transition: border-color 0.15s;
}
.stat-card-link:hover .stat-card {
border-color: var(--accent);
cursor: pointer;
}
.stat-card-link:hover {
color: inherit;
}
.stat-card { .stat-card {
background: var(--surface); background: var(--surface);
border: 1px solid var(--border); border: 1px solid var(--border);
@@ -1079,129 +1098,6 @@ a:hover { color: var(--accent-hover); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; } ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); } ::-webkit-scrollbar-thumb:hover { background: var(--muted); }
/* ---- Mobile Bottom Nav ---- */
.mobile-bottom-bar {
display: none;
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 56px;
background: var(--surface);
border-top: 1px solid var(--border);
z-index: 1000;
flex-direction: row;
flex-wrap: nowrap;
overflow: hidden;
align-items: center;
justify-content: space-around;
padding: 0 4px;
padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
flex: 1;
min-width: 0;
padding: 6px 0;
color: var(--muted);
text-decoration: none;
background: none;
border: none;
font-family: var(--font-body);
cursor: pointer;
transition: color var(--transition);
-webkit-tap-highlight-color: transparent;
}
.mobile-nav-item svg {
width: 24px;
height: 24px;
flex-shrink: 0;
}
.mobile-nav-item span {
font-size: 10px;
font-weight: 500;
line-height: 1;
}
.mobile-nav-item.active {
color: var(--accent);
}
/* Mobile More Panel */
.mobile-more-panel {
display: none;
}
.mobile-more-panel.open {
display: block;
}
.mobile-more-backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 998;
}
.mobile-more-content {
position: fixed;
bottom: 56px;
left: 0;
right: 0;
background: var(--surface);
border-top: 1px solid var(--border);
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 0;
padding: 16px;
padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
z-index: 999;
}
.mobile-more-item {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
padding: 12px 4px;
min-height: 48px;
color: var(--text-secondary);
text-decoration: none;
font-size: 0.78rem;
font-weight: 500;
border-radius: var(--radius);
transition: background var(--transition);
-webkit-tap-highlight-color: transparent;
}
.mobile-more-item:hover {
background: var(--surface2);
color: var(--text);
}
.mobile-more-item svg {
width: 24px;
height: 24px;
color: var(--muted);
flex-shrink: 0;
}
.mobile-more-item span {
line-height: 1;
}
/* ---- Responsive ---- */ /* ---- Responsive ---- */
@media (max-width: 768px) { @media (max-width: 768px) {
body { padding-bottom: 60px; } body { padding-bottom: 60px; }
@@ -1210,57 +1106,77 @@ a:hover { color: var(--accent-hover); }
.form-grid { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; }
.dashboard-grid { grid-template-columns: 1fr; } .dashboard-grid { grid-template-columns: 1fr; }
.page-content { padding: 16px; padding-bottom: 72px; } .page-content { padding: 16px; padding-bottom: 72px; }
.mobile-bottom-bar { display: flex; } /* Topbar: stack vertically on mobile */
/* Topbar: allow wrapping for quick capture row */
.topbar { .topbar {
height: auto; height: auto;
min-height: var(--topbar-height); min-height: auto;
flex-wrap: wrap; flex-direction: column;
padding: 8px 16px; align-items: stretch;
padding: 8px 12px;
gap: 8px; gap: 8px;
} }
.quick-capture-form { .topbar-env {
order: 10; align-self: flex-start;
width: 100%;
flex: 0 0 100%;
} }
.quick-capture-input { .topbar-spacer {
display: none;
}
.quick-capture-form {
order: unset;
width: 100%; width: 100%;
flex: 1; flex: unset;
min-height: 44px; display: flex;
font-size: 16px; align-items: center;
padding: 10px 12px 10px 32px; gap: 8px;
padding: 0;
} }
.quick-capture-icon { .quick-capture-icon {
left: 12px; display: none;
font-size: 1rem; }
.quick-capture-input {
flex: 1;
width: auto;
height: 36px;
min-height: auto;
background: var(--surface2);
border: 1px solid var(--border);
border-left: 1px solid var(--border);
border-radius: 4px;
padding: 0 10px;
font-size: 16px;
} }
.quick-capture-submit { .quick-capture-submit {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 44px; width: 36px;
height: 44px; height: 36px;
background: var(--accent); background: var(--accent);
color: #fff; color: #fff;
border: none; border: none;
border-radius: var(--radius); border-radius: 4px;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: 700; font-weight: 700;
cursor: pointer; cursor: pointer;
margin-left: 8px;
flex-shrink: 0; flex-shrink: 0;
margin-left: 0;
} }
.quick-capture-submit:hover { .quick-capture-submit:hover {
background: var(--accent-hover); background: var(--accent-hover);
} }
.search-trigger {
width: 100%;
min-width: unset;
}
/* Capture form mobile */ /* Capture form mobile */
.capture-form-card { padding: 12px; } .capture-form-card { padding: 12px; }
.capture-form-card .form-textarea { .capture-form-card .form-textarea {
@@ -1677,3 +1593,126 @@ a:hover { color: var(--accent-hover); }
.eisenhower-x-spacer { display: none; } .eisenhower-x-spacer { display: none; }
.eisenhower-quadrant { min-height: 120px; } .eisenhower-quadrant { min-height: 120px; }
} }
/* === MOBILE NAV BAR === */
.mob-nav {
display: none !important;
}
@media (max-width: 768px) {
.mob-nav {
display: flex !important;
position: fixed !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
height: 56px !important;
background: var(--surface) !important;
border-top: 1px solid var(--border) !important;
z-index: 9999 !important;
flex-direction: row !important;
flex-wrap: nowrap !important;
align-items: center !important;
justify-content: space-around !important;
padding: 0 !important;
margin: 0 !important;
overflow: hidden !important;
}
.mob-nav__item {
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
flex: 1 1 0 !important;
min-width: 0 !important;
max-width: 20% !important;
height: 56px !important;
padding: 6px 0 !important;
margin: 0 !important;
color: var(--muted) !important;
text-decoration: none !important;
background: none !important;
border: none !important;
font-family: inherit !important;
font-size: 10px !important;
font-weight: 500 !important;
line-height: 1 !important;
cursor: pointer !important;
-webkit-tap-highlight-color: transparent !important;
gap: 2px !important;
}
.mob-nav__item svg {
width: 22px !important;
height: 22px !important;
flex-shrink: 0 !important;
}
.mob-nav__item span {
font-size: 10px !important;
line-height: 1 !important;
}
.mob-nav__item--active {
color: var(--accent) !important;
}
.mob-overlay {
display: none !important;
position: fixed !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
background: rgba(0,0,0,0.5) !important;
z-index: 10000 !important;
}
.mob-overlay.open {
display: block !important;
}
.mob-more {
display: none !important;
position: fixed !important;
bottom: 56px !important;
left: 0 !important;
right: 0 !important;
background: var(--surface) !important;
border-top: 1px solid var(--border) !important;
border-radius: 12px 12px 0 0 !important;
z-index: 10001 !important;
padding: 16px !important;
grid-template-columns: repeat(3, 1fr) !important;
gap: 8px !important;
}
.mob-more.open {
display: grid !important;
}
.mob-more__item {
display: flex !important;
flex-direction: column !important;
align-items: center !important;
justify-content: center !important;
gap: 6px !important;
padding: 12px 4px !important;
color: var(--text) !important;
text-decoration: none !important;
font-size: 0.78rem !important;
font-weight: 500 !important;
border-radius: 8px !important;
}
.mob-more__item:hover {
background: var(--surface2) !important;
}
.mob-more__item svg {
width: 22px !important;
height: 22px !important;
color: var(--muted) !important;
}
}

View File

@@ -5,6 +5,17 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ page_title or "Life OS" }} - Life OS</title> <title>{{ page_title or "Life OS" }} - Life OS</title>
<link rel="stylesheet" href="/static/style.css"> <link rel="stylesheet" href="/static/style.css">
<style>
/* Critical mob-nav positioning - inline to guarantee it loads */
.mob-nav{display:none}
@media(max-width:768px){
.mob-nav{display:flex!important;position:fixed!important;bottom:0!important;left:0!important;right:0!important;height:56px!important;background:var(--surface)!important;border-top:1px solid var(--border)!important;z-index:9999!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:space-around!important;padding:0!important;margin:0!important;overflow:hidden!important}
.mob-overlay{display:none!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;background:rgba(0,0,0,.5)!important;z-index:10000!important}
.mob-overlay.open{display:block!important}
.mob-more{display:none!important;position:fixed!important;bottom:56px!important;left:0!important;right:0!important;background:var(--surface)!important;border-top:1px solid var(--border)!important;border-radius:12px 12px 0 0!important;z-index:10001!important;padding:16px!important;grid-template-columns:repeat(3,1fr)!important;gap:8px!important}
.mob-more.open{display:grid!important}
}
</style>
</head> </head>
<body> <body>
<div class="app-layout"> <div class="app-layout">
@@ -187,69 +198,40 @@
</div> </div>
</div> </div>
<!-- Mobile Bottom Nav -->
<nav class="mobile-bottom-bar">
<a href="/" class="mobile-nav-item {% if active_nav == 'dashboard' %}active{% endif %}">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
<span>Dashboard</span>
</a>
<a href="/focus" class="mobile-nav-item {% if active_nav == 'focus' %}active{% endif %}">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>
<span>Focus</span>
</a>
<a href="/tasks" class="mobile-nav-item {% if active_nav == 'tasks' %}active{% endif %}">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>
<span>Tasks</span>
</a>
<a href="/capture" class="mobile-nav-item {% if active_nav == 'capture' %}active{% endif %}">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/></svg>
<span>Capture</span>
</a>
<button class="mobile-nav-item" id="mobile-more-btn" onclick="toggleMobileMore()">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
<span>More</span>
</button>
</nav>
<!-- Mobile More Panel -->
<div id="mobile-more-panel" class="mobile-more-panel">
<div class="mobile-more-backdrop" onclick="toggleMobileMore()"></div>
<div class="mobile-more-content">
<a href="/calendar" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>Calendar</span>
</a>
<a href="/notes" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6"/></svg>
<span>Notes</span>
</a>
<a href="/meetings" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>
<span>Meetings</span>
</a>
<a href="/decisions" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"/><path d="M9 12l2 2 4-4"/></svg>
<span>Decisions</span>
</a>
<a href="/contacts" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>Contacts</span>
</a>
<a href="/processes" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
<span>Processes</span>
</a>
<a href="/weblinks" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
<span>Weblinks</span>
</a>
<a href="/admin/trash" class="mobile-more-item">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>
<span>Admin</span>
</a>
</div>
</div>
<script src="/static/app.js"></script> <script src="/static/app.js"></script>
<div class="mob-nav" id="mobNav" style="position:fixed;bottom:0;left:0;right:0;z-index:9999">
<a href="/" class="mob-nav__item {% if request.url.path == '/' %}mob-nav__item--active{% endif %}">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/></svg>
<span>Home</span>
</a>
<a href="/focus" class="mob-nav__item {% if '/focus' in request.url.path %}mob-nav__item--active{% endif %}">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/></svg>
<span>Focus</span>
</a>
<a href="/tasks" class="mob-nav__item {% if '/tasks' in request.url.path %}mob-nav__item--active{% endif %}">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 11l3 3L22 4"/><path d="M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"/></svg>
<span>Tasks</span>
</a>
<a href="/capture" class="mob-nav__item {% if '/capture' in request.url.path %}mob-nav__item--active{% endif %}">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="16"/><line x1="8" y1="12" x2="16" y2="12"/></svg>
<span>Capture</span>
</a>
<button class="mob-nav__item" id="mobMoreBtn" type="button">
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"/><line x1="3" y1="12" x2="21" y2="12"/><line x1="3" y1="18" x2="21" y2="18"/></svg>
<span>More</span>
</button>
</div>
<div class="mob-overlay" id="mobOverlay"></div>
<div class="mob-more" id="mobMore">
<a href="/calendar" class="mob-more__item"><span>Calendar</span></a>
<a href="/notes" class="mob-more__item"><span>Notes</span></a>
<a href="/meetings" class="mob-more__item"><span>Meetings</span></a>
<a href="/decisions" class="mob-more__item"><span>Decisions</span></a>
<a href="/contacts" class="mob-more__item"><span>Contacts</span></a>
<a href="/processes" class="mob-more__item"><span>Processes</span></a>
<a href="/weblinks" class="mob-more__item"><span>Weblinks</span></a>
<a href="/admin" class="mob-more__item"><span>Admin</span></a>
</div>
</body> </body>
</html> </html>

View File

@@ -6,22 +6,30 @@
<!-- Stats --> <!-- Stats -->
<div class="dashboard-grid mb-4"> <div class="dashboard-grid mb-4">
<div class="stat-card"> <a href="/tasks/?status=open" class="stat-card-link">
<div class="stat-value">{{ stats.open_tasks or 0 }}</div> <div class="stat-card">
<div class="stat-label">Open Tasks</div> <div class="stat-value">{{ stats.open_tasks or 0 }}</div>
</div> <div class="stat-label">Open Tasks</div>
<div class="stat-card"> </div>
<div class="stat-value">{{ stats.in_progress or 0 }}</div> </a>
<div class="stat-label">In Progress</div> <a href="/tasks/?status=in_progress" class="stat-card-link">
</div> <div class="stat-card">
<div class="stat-card"> <div class="stat-value">{{ stats.in_progress or 0 }}</div>
<div class="stat-value">{{ stats.done_this_week or 0 }}</div> <div class="stat-label">In Progress</div>
<div class="stat-label">Done This Week</div> </div>
</div> </a>
<div class="stat-card"> <a href="/tasks/?status=done" class="stat-card-link">
<div class="stat-value">{{ focus_items|length }}</div> <div class="stat-card">
<div class="stat-label">Today's Focus</div> <div class="stat-value">{{ stats.done_this_week or 0 }}</div>
</div> <div class="stat-label">Done This Week</div>
</div>
</a>
<a href="/focus/" class="stat-card-link">
<div class="stat-card">
<div class="stat-value">{{ focus_items|length }}</div>
<div class="stat-label">Today's Focus</div>
</div>
</a>
</div> </div>
<div class="dashboard-grid"> <div class="dashboard-grid">

View File

@@ -21,10 +21,10 @@
<span class="detail-meta-item"><span class="priority-dot priority-{{ item.priority }}"></span> P{{ item.priority }}</span> <span class="detail-meta-item"><span class="priority-dot priority-{{ item.priority }}"></span> P{{ item.priority }}</span>
{% if item.target_date %}<span class="detail-meta-item">Target: {{ item.target_date }}</span>{% endif %} {% if item.target_date %}<span class="detail-meta-item">Target: {{ item.target_date }}</span>{% endif %}
</div> </div>
<div class="mt-2" style="max-width: 300px;"> <a href="/tasks/?project_id={{ item.id }}" class="stat-card-link" style="max-width: 300px; display: block; margin-top: 8px;">
<div class="progress-bar"><div class="progress-fill" style="width: {{ progress }}%"></div></div> <div class="progress-bar"><div class="progress-fill" style="width: {{ progress }}%"></div></div>
<div class="progress-text">{{ done_count }}/{{ task_count }} tasks complete ({{ progress }}%)</div> <div class="progress-text">{{ done_count }}/{{ task_count }} tasks complete ({{ progress }}%)</div>
</div> </a>
</div> </div>
{% if item.description %} {% if item.description %}

View File

@@ -328,3 +328,11 @@ def seed_note(all_seeds):
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def seed_meeting(all_seeds): def seed_meeting(all_seeds):
return {"id": all_seeds["meeting"], "title": "Test Meeting"} return {"id": all_seeds["meeting"], "title": "Test Meeting"}
@pytest.fixture(scope="session")
def seed_list(all_seeds):
return {"id": all_seeds["list"], "name": "Test List"}
@pytest.fixture(scope="session")
def seed_appointment(all_seeds):
return {"id": all_seeds["appointment"], "title": "Test Appointment"}

File diff suppressed because it is too large Load Diff

View File

@@ -33,10 +33,13 @@ from tests.form_factory import build_form_data, build_edit_data
_CREATE_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.CREATE and not r.has_file_upload] _CREATE_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.CREATE and not r.has_file_upload]
_EDIT_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.EDIT and not r.has_file_upload] _EDIT_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.EDIT and not r.has_file_upload]
_DELETE_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.DELETE] _DELETE_ROUTES = [r for r in ALL_ROUTES if r.kind == RouteKind.DELETE]
_ACTION_ROUTES = [r for r in ALL_ROUTES if r.kind in (RouteKind.ACTION, RouteKind.TOGGLE)] # Admin trash actions are excluded here — covered by TestAdminTrashLifecycle in test_business_logic.py
_ADMIN_TRASH_PATHS = {
# Destructive actions that wipe data other tests depend on "/admin/trash/empty",
_DESTRUCTIVE_ACTIONS = {"/admin/trash/empty", "/admin/trash/{table}/{item_id}/permanent-delete"} "/admin/trash/{table}/{item_id}/permanent-delete",
"/admin/trash/{table}/{item_id}/restore",
}
_ACTION_ROUTES = [r for r in ALL_ROUTES if r.kind in (RouteKind.ACTION, RouteKind.TOGGLE) and r.path not in _ADMIN_TRASH_PATHS]
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@@ -97,10 +100,6 @@ async def test_edit_redirects(client: AsyncClient, all_seeds: dict, route):
) )
async def test_action_does_not_crash(client: AsyncClient, all_seeds: dict, route): async def test_action_does_not_crash(client: AsyncClient, all_seeds: dict, route):
"""POST action routes should not return 500.""" """POST action routes should not return 500."""
# Skip destructive actions that would wipe seed data
if route.path in _DESTRUCTIVE_ACTIONS:
pytest.skip(f"Skipping destructive action {route.path}")
resolved = resolve_path(route.path, all_seeds) resolved = resolve_path(route.path, all_seeds)
if "{" in resolved: if "{" in resolved:
pytest.skip(f"No seed data mapping for {route.path}") pytest.skip(f"No seed data mapping for {route.path}")

102
tests/test_mobile_nav.py Normal file
View File

@@ -0,0 +1,102 @@
"""Tests that the mobile navigation bar is correctly structured and positioned."""
import re
import pytest
from httpx import AsyncClient, ASGITransport
from tests.registry import app
@pytest.fixture
async def client():
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url="http://test") as c:
yield c
@pytest.mark.asyncio
async def test_mob_nav_exists(client):
"""mob-nav element exists in page output."""
resp = await client.get("/")
assert resp.status_code == 200
assert 'class="mob-nav"' in resp.text, "mob-nav not found in HTML"
@pytest.mark.asyncio
async def test_mob_nav_is_direct_body_child(client):
"""mob-nav must be a direct child of body, not nested in any container."""
resp = await client.get("/")
html = resp.text
mob_idx = html.find('id="mobNav"')
body_close = html.find('</body>')
assert mob_idx != -1, "mobNav not found"
assert body_close != -1, "</body> not found"
between = html[mob_idx:body_close]
assert between.count('</main>') == 0, "mob-nav appears to be inside <main>"
assert between.count('</div></div></div>') == 0, "mob-nav appears deeply nested"
@pytest.mark.asyncio
async def test_mob_nav_has_five_items(client):
"""Bottom bar must have exactly 5 navigation items (4 links + 1 button)."""
resp = await client.get("/")
html = resp.text
start = html.find('id="mobNav"')
assert start != -1
# Scope to just the mob-nav element (ends at first </div> after it)
end = html.find('</div>', start)
chunk = html[start:end]
links = len(re.findall(r'<a\b', chunk))
buttons = len(re.findall(r'<button\b', chunk))
assert links == 4, f"Expected 4 link items, found {links}"
assert buttons == 1, f"Expected 1 button item, found {buttons}"
@pytest.mark.asyncio
async def test_mob_nav_has_inline_fixed_position(client):
"""mob-nav must have position:fixed as an inline style for maximum reliability."""
resp = await client.get("/")
assert 'id="mobNav" style="position:fixed' in resp.text, \
"mob-nav missing inline position:fixed style"
@pytest.mark.asyncio
async def test_mob_nav_css_has_fixed_position(client):
"""CSS must include position:fixed for mob-nav."""
css_resp = await client.get("/static/style.css")
css = css_resp.text
assert "position: fixed" in css or "position:fixed" in css, \
"No position:fixed found in CSS"
@pytest.mark.asyncio
async def test_mob_nav_inline_style_in_head(client):
"""Critical mob-nav styles must be inlined in <head> as a fallback."""
resp = await client.get("/")
html = resp.text
head_end = html.find('</head>')
head = html[:head_end]
assert '.mob-nav' in head, "No inline mob-nav styles found in <head>"
assert 'position:fixed' in head, "No position:fixed in inline <head> styles"
@pytest.mark.asyncio
async def test_mob_nav_not_inside_transformed_parent(client):
"""No ancestor of mob-nav should have transform that breaks position:fixed."""
resp = await client.get("/")
html = resp.text
mob_idx = html.find('id="mobNav"')
body_start = html.find('<body')
prefix = html[body_start:mob_idx]
opens = len(re.findall(r'<div\b[^>]*>', prefix))
closes = prefix.count('</div>')
nesting = opens - closes
assert nesting <= 1, \
f"mob-nav is nested {nesting} divs deep - must be 0 or 1 (direct body child)"
@pytest.mark.asyncio
async def test_mob_nav_present_on_all_pages(client):
"""mob-nav should appear on every page, not just dashboard."""
for path in ["/", "/tasks/", "/focus/", "/capture/", "/contacts/"]:
resp = await client.get(path)
assert 'id="mobNav"' in resp.text, f"mob-nav missing on {path}"