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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,24 @@ Times are shown and entered in the server's `TZ` (UTC in Docker unless you set i
times without an offset are read in that zone too. Raise `BODY_SIZE_LIMIT` if a large export is
rejected with 413.

## Report

**Report** shows where a month went: an ECharts Sankey from source (Calendar, Timer, Manual,
Import) to category to project, with hours on each link (entries without a project appear by
title), and a table of hours per category and project. Pick a month, and use _Export CSV_ to
download the month's entries with their category and hours. Like **Time**, a month holds the
entries that start in it; a running timer counts once it stops.

Categories and their colors are set on **Settings**, along with rules that assign them. A rule
matches an entry's source, or its project or title by keyword (case-insensitive substring) or
regular expression (case-insensitive). Rules are tried in order and the first match wins; entries
no rule matches are _Uncategorized_. Move a rule up or down to change its precedence.

Calendar blocks often overlap time you tracked (timer, manual or imported entries). The report
shows how much overlaps. By default both are counted; tick _Tracked time wins over calendar_ to
count overlapping time only for the tracked entry. The CSV has the entry's full hours and the
hours counted with the chosen option.

## Capture API

Send a dump from anywhere with `POST /api/dumps` and `Authorization: Bearer $DUMPDOWN_API_TOKEN`.
Expand Down
26 changes: 26 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"dependencies": {
"better-sqlite3": "^13.2.0",
"echarts": "^6.1.0",
"ical.js": "^2.2.1",
"zod": "^4.6.7"
}
Expand Down
19 changes: 0 additions & 19 deletions src/lib/components/Placeholder.svelte

This file was deleted.

42 changes: 42 additions & 0 deletions src/lib/components/Sankey.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<script lang="ts">
import { sankeyHeight, type SankeyLink, type SankeyNode } from '#lib/report.ts';

let { nodes, links, label }: { nodes: SankeyNode[]; links: SankeyLink[]; label: string } =
$props();
let el = $state<HTMLDivElement>();

// ECharts only runs in the browser; it is loaded on demand and redrawn when the data changes.
$effect(() => {
const target = el;
const data = { nodes, links };
if (!target) return;
let remove: (() => void) | undefined;
let cancelled = false;
void import('#lib/sankeyChart.ts').then(({ renderSankey }) => {
if (cancelled) return;
const style = getComputedStyle(target);
remove = renderSankey(target, data.nodes, data.links, {
text: style.getPropertyValue('--fg').trim() || '#1f2328',
muted: style.getPropertyValue('--muted').trim() || '#656d76'
});
});
return () => {
cancelled = true;
remove?.();
};
});
</script>

<div
bind:this={el}
class="sankey"
role="img"
aria-label={label}
style:height="{sankeyHeight(nodes)}px"
></div>

<style>
.sankey {
width: 100%;
}
</style>
Loading