Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ function renderHistory() {
<div class="day-row${dayHL}" data-date="${dateStr}">
<span class="day-label"><span class="day-name">${name}</span> <span class="day-date">${date}</span></span>
<span class="day-total">${fmt(total)}</span>
<span class="day-chevron">${isExp ? '' : '▶'}</span>
<span class="day-chevron${isExp ? ' expanded' : ''}"></span>
</div>
${isExp ? `<div class="day-tasks">${
tasks.map(t => {
Expand All @@ -1046,7 +1046,7 @@ function renderHistory() {
<div class="day-task-row${dtExp ? ' expanded' : ''}${dtHL}" data-task-id="${t.id}" data-date="${dateStr}">
<span class="dt-name">${esc(t.name)}</span>
<span class="dt-time">${fmt(t.ms)}</span>
<span class="dt-chevron">${dtExp ? '' : '▶'}</span>
<span class="dt-chevron${dtExp ? ' expanded' : ''}"></span>
<button class="dt-del" tabindex="-1">✕</button>
</div>${sessionsHTML}`;
}).join('')
Expand All @@ -1059,7 +1059,7 @@ function renderHistory() {
<div class="total-row week-total-row${weekHL}">
<span class="total-label">week</span>
<span class="total-time" id="week-total-time">${fmt(weekTotal)}</span>
<span class="week-chevron">${weekVisible ? '' : '▶'}</span>
<span class="week-chevron${weekVisible ? ' expanded' : ''}"></span>
</div>
` + dayRows;
}
Expand Down Expand Up @@ -1146,7 +1146,7 @@ function renderLater() {

const laterHL = nav && nav.type === 'later' ? ' nav-highlight' : '';
headerEl.className = laterHL.trim();
headerEl.innerHTML = `<span class="later-label">later</span><span class="later-chevron">${laterVisible ? '' : '▶'}</span>`;
headerEl.innerHTML = `<span class="later-label">later</span><span class="later-chevron${laterVisible ? ' expanded' : ''}"></span>`;

const inputHL = nav && nav.type === 'later-input';
inputEl.style.display = laterVisible ? '' : 'none';
Expand Down Expand Up @@ -1300,7 +1300,7 @@ function render() {
}
return `<span class="t-time">${fmt(displayMs)}</span>`;
})()}
${isRecent ? '' : `<span class="t-expand">${task.sessions.length ? (isExp ? '' : '▶') : ''}</span>`}
${isRecent ? '' : `<span class="t-expand${task.sessions.length && isExp ? ' expanded' : ''}"${task.sessions.length ? '' : ' style="visibility:hidden"'}></span>`}
<button class="t-del" data-id="${task.id}" tabindex="-1">✕</button>
</div>
${sessionHTML}
Expand All @@ -1323,12 +1323,12 @@ function render() {
<span class="t-time-sep">·</span>
<span class="t-time-label">today</span> <span id="total-time">${fmt(allTodayMs())}</span>
</span>
<span class="total-expand">▼</span>`;
<span class="total-expand expanded"></span>`;
} else {
totalRow.innerHTML = `
<span class="total-label">today</span>
<span class="total-time" id="total-time">${fmt(allTodayMs())}</span>
<span class="total-expand">${listShown ? '' : '▶'}</span>`;
<span class="total-expand${listShown ? ' expanded' : ''}"></span>`;
}

renderHistory();
Expand Down
111 changes: 40 additions & 71 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,14 @@ html[data-theme="system"] #auth-screen {
margin: 0 2px;
}

.t-expand {
font-size: 10px;
/* ── Shared disclosure caret (macOS-style) ── */
.t-expand,
.day-chevron,
.dt-chevron,
.week-chevron,
.total-expand,
.later-chevron {
font-size: 0;
color: var(--dimmer);
width: 28px;
height: 28px;
Expand All @@ -553,6 +559,32 @@ html[data-theme="system"] #auth-screen {
cursor: pointer;
transition: color 0.1s, background 0.1s;
}
.t-expand::before,
.day-chevron::before,
.dt-chevron::before,
.week-chevron::before,
.total-expand::before,
.later-chevron::before {
content: '';
display: block;
width: 6px;
height: 6px;
border-right: 1.5px solid currentColor;
border-bottom: 1.5px solid currentColor;
transform: rotate(-45deg);
transition: transform 0.15s ease;
margin-left: -1px;
}
.t-expand.expanded::before,
.day-chevron.expanded::before,
.dt-chevron.expanded::before,
.week-chevron.expanded::before,
.total-expand.expanded::before,
.later-chevron.expanded::before {
transform: rotate(45deg);
margin-left: 0;
margin-top: -2px;
}

.task-row:hover .t-expand { color: var(--dim); }
.t-expand:hover { background: var(--sel); color: var(--text) !important; }
Expand Down Expand Up @@ -727,6 +759,12 @@ html[data-theme="system"] #auth-screen {
margin-right: 4px;
outline: none;
}
html[data-theme="dark"] .sl-time-input,
html[data-theme="dark"] .sl-date-input { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
html[data-theme="system"] .sl-time-input,
html[data-theme="system"] .sl-date-input { color-scheme: dark; }
}
.sl-dash { color: var(--dim); }

/* ── Total ── */
Expand Down Expand Up @@ -764,20 +802,6 @@ html[data-theme="system"] #auth-screen {
margin-top: 40px;
}

.total-expand {
font-size: 10px;
color: var(--dimmer);
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
border-radius: 4px;
cursor: pointer;
transition: color 0.1s, background 0.1s;
}

.total-row:hover .total-expand { color: var(--dim); }
.total-expand:hover { background: var(--sel); color: var(--text) !important; }

Expand All @@ -799,20 +823,6 @@ html[data-theme="system"] #auth-screen {
border-bottom: 1px solid var(--border);
}

.week-chevron {
font-size: 10px;
color: var(--dimmer);
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
border-radius: 4px;
cursor: pointer;
transition: color 0.1s, background 0.1s;
}

.week-total-row:hover .week-chevron { color: var(--dim); }
.week-chevron:hover { background: var(--sel); color: var(--text) !important; }

Expand All @@ -828,20 +838,6 @@ html[data-theme="system"] #auth-screen {
user-select: none;
}

.day-chevron {
font-size: 10px;
color: var(--dimmer);
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
border-radius: 4px;
cursor: pointer;
transition: color 0.1s, background 0.1s;
}

.day-row:hover .day-chevron { color: var(--dim); }
.day-chevron:hover { background: var(--sel); color: var(--text) !important; }

Expand Down Expand Up @@ -912,19 +908,6 @@ html[data-theme="system"] #auth-screen {
font-variant-numeric: tabular-nums;
}

.dt-chevron {
font-size: 10px;
color: var(--dimmer);
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
border-radius: 4px;
cursor: pointer;
transition: color 0.1s, background 0.1s;
}
.day-task-row:hover .dt-chevron { color: var(--dim); }
.dt-chevron:hover { background: var(--sel); color: var(--text) !important; }

Expand Down Expand Up @@ -972,20 +955,6 @@ html[data-theme="system"] #auth-screen {
letter-spacing: 0.15em;
}

.later-chevron {
font-size: 10px;
color: var(--dimmer);
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
border-radius: 4px;
cursor: pointer;
transition: color 0.1s, background 0.1s;
}

#later-header:hover .later-chevron { color: var(--dim); }
.later-chevron:hover { background: var(--sel); color: var(--text) !important; }

Expand Down
Loading