Wardian docs

Focus log

Try it

This suite uses its own database, Splunk or channels, which need a Wardian. Download it and import it in Wardian to run it.

Download focus-log.wardian Import it in Wardian: Settings → Import.

For anyone using the Focus timer: every session you finish there lands here, so you can see how long you focused today, the last seven days, where the time went, and every session since you started. The two apps are separate packages that talk only on the channel focus.session, and only after you allow it (SPEC.md §6.9).

What you put in#

FieldTypeUnitAllowedDefaultRequired
Daily goalwhole numberminutes5 to 1,440120yes
Period (Where the time went)one of 3—Last 7 days, Last 30 days, All timeLast 7 daysyes
Allow the channelyes or no—Wardian's own question when the log first opens——

Sessions themselves come from the Focus timer: a label, minutes (above 0, up to 1,440), when it started and ended, and whether it was completed. A message that is not like that is refused and counted, never stored.

What it shows#

How it behaves#

Layout#

Two columns: Sessions coming in on the left; Today, the last 7 days, Where the time went, Every session and Export on the right. One column on a phone. Tab order is the reading order.

PanelHolds
Sessions coming in (aside)The channel's state, Ask again when refused, the last receipt.
TodayThree tiles, the goal meter, Daily goal (number, size-xs, num, "minutes" beside it, hint).
The last 7 daysThe bar chart (focusable, arrow keys) and its reading.
Where the time wentPeriod (a radio group, arrow keys move), the list of labels.
Every sessionThe table (Remove on each row), Newer and Older.
ExportDownload CSV with its reason when disabled, and the progress bar.

How it is built#

It is a suite because it has several jobs: receive, three summaries, a history and an export. Each part has its own panel and reads the same SQLite table.

PartSlotJobContract
inboxasideReceives on focus.session, checks each message, and adds it to the table. Shows whether the channel is open. When you do not allow it, it explains how to change that and offers Ask again.emits log:changed (retained); db; receives focus.session
todaymainMinutes today, sessions (completed and stopped early), the longest session, and a daily goal with a bar.listens log:changed; db, storage (the goal)
weekmainAn SVG bar chart of the minutes on each of the last 7 days, today on the right. Hover over a day, or use the arrow keys, to read it.listens log:changed; db
labelsmainTime per label, most first, for the last 7 days, the last 30 days or all time.listens log:changed; db, storage (the period)
historymainEvery session, newest first, 20 per page, read with db.page. Each row can be removed.listens and emits log:changed; db
exportmainDownloads every session as CSV, read 1,000 rows at a time.listens log:changed; db, claude:downloads

How a session flows:

  1. The Focus timer sends {label, minutes, started, ended, completed} on focus.session.
  2. Wardian stamps the message with the sender's name.
  3. inbox checks the message and runs INSERT OR IGNORE into sessions.
  4. inbox emits log:changed.
  5. Each view runs its own SQL again.

The views never wait on inbox's panel. They read the table when the app opens, so a hidden inbox changes nothing.

The table.

sessions(id TEXT PRIMARY KEY, day, label, minutes, started, ended, completed, source, received)

id is the sending package and the start time. Wardian gives the latest message on a channel to an app that opens later, so the log sees the last session again each time it opens. The key makes sure that session counts only once. day is the local date the session started, in the time zone of the browser that received it.

shared/log.js holds the code the parts share, listed in suite.json "scripts":

If you do not allow the channel, the log keeps the sessions it already has, but adds no new ones. The inbox says so and gives the steps. If you pressed Don't allow, open Settings → App permissions, press Revoke next to focus-log, then press Ask again. If you only closed the question, press Ask again.

Limits.

This page is apps/focus-log/README.md in the repository. Something wrong or missing? Change that file.