Skip to content
Draft
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
29 changes: 14 additions & 15 deletions relay/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,23 +423,21 @@ function buildBoardHtml(rows: ProjectRow[], updatedAt: string, todos: TodoRow[]
const idleCount = effectiveStates.filter(s => s === 'idle').length;

const footerParts: string[] = [];
if (stats) {
footerParts.push(`${stats.activeHours}/24h active`);
footerParts.push(`${stats.donesToday} done today`);
if (stats.donesWeek > stats.donesToday) {
footerParts.push(`${stats.donesWeek} this week`);
}
if (stats.todosOpen > 0) {
footerParts.push(`${stats.todosOpen} open TODO${stats.todosOpen > 1 ? 's' : ''}`);
}
} else {
if (stuckCount > 0) footerParts.push(`<span class="ember">${stuckCount} needs attention</span>`);
if (doneCount > 0) footerParts.push(`${doneCount} done`);
if (workingCount > 0) footerParts.push(`<span class="working">${workingCount} working</span>`);
if (idleCount > 0) footerParts.push(`<span class="idle">${idleCount} idle</span>`);
}
if (stuckCount > 0) footerParts.push(`<span class="ember">${stuckCount} needs attention</span>`);
if (doneCount > 0) footerParts.push(`${doneCount} done`);
if (workingCount > 0) footerParts.push(`<span class="working">${workingCount} working</span>`);
if (idleCount > 0) footerParts.push(`<span class="idle">${idleCount} idle</span>`);
const footerHtml = footerParts.length > 0 ? footerParts.join(' · ') : 'no projects yet';

const gamificationHtml = stats ? (() => {
const parts: string[] = [];
parts.push(`${stats.activeHours}/24h active`);
parts.push(`${stats.donesToday} done today`);
if (stats.donesWeek > stats.donesToday) parts.push(`${stats.donesWeek} this week`);
if (stats.todosOpen > 0) parts.push(`${stats.todosOpen} open TODO${stats.todosOpen > 1 ? 's' : ''}`);
return parts.join(' · ');
})() : null;

const emptyMsg = rows.length === 0
? '<div class="empty">No events yet — start emitting with <code>tend emit working "your task"</code></div>'
: '';
Expand Down Expand Up @@ -649,6 +647,7 @@ function buildBoardHtml(rows: ProjectRow[], updatedAt: string, todos: TodoRow[]
</form>` : ''}
</section>` : ''}
<footer class="footer">${footerHtml}</footer>
${gamificationHtml ? `<div class="gamification">${gamificationHtml}</div>` : ''}
</main>
</div>
<script>
Expand Down
Loading