Repository navigation
Modal forms with field errors, delete confirm and the keys sheet (ALI-2616) - #15
Conversation
The tab bar now carries the ◷ notch wordmark, numbered tabs with a primary underline, and the running pill on every tab. The bottom is a rule and one line of keys with the latest status at the right. The Timers list gains a hero (NOW TRACKING, block-digit elapsed time, today, this week and unbilled), range chips (t w m a f), day groups with subtotals, status glyphs, a detail pane at 120 columns and wider, and a compact layout below that with a summary line and enter for details. New keys: m (this month), r (resume), enter (details). Layout sizes come from design/tokens.json (tui-margin, tui-wide, tui-detail-width; tui-chrome-rows is now 4).
… notes (ALI-2615) The list's column widths, the detail pane's label column and note rows, and the hero's row counts were Go literals, outside design/tokens.json. They're tokens now (tui-col-*, tui-detail-label, tui-detail-note-rows, tui-hero-rows*), generated into internal/theme. New tui-min-width (64) and tui-min-height (22) give the smallest terminal the layout fits, measured from the views' real output. The contrast notes said warning draws invoiced status and primary the running timer. In the redesigned Timers list invoiced is accent, running is success, and day headers are primary; warning is left for Reports and the hero's unbilled total. The notes now say so.
- Text was cut by rune count, so CJK and emoji ran past their columns and could push the running pill off the tab bar. truncate and truncateStr now cut by display width, as does wrapWords. - The compact details overlay and the wide detail pane weren't fitted to the body: at 80x24 the overlay lost its bottom border and keys, and a short wide terminal could overflow. The box now drops spacing and lesser fields first, keeping its borders, the task and every key, and isn't drawn when even those don't fit. - The range keys and r had no place on screen. Each range chip now shows its key, and r resume stays in the pane and the overlay. - Range keys reset the cursor but not the scroll offset. - On a narrow tab bar the pill was clipped. The task name goes first, then the inactive tabs' names, then the wordmark's name. - Below 64x22 the layout wrapped over itself; it now shows a centred "Terminal too small" note. - The details stayed open after an edit, a delete or a tab switch. - A reload moved the cursor by index. It now follows the selected entry by ID, and after r or space starts a timer, selects the new one. - The hero, the rows, the day subtotals and the pill each read the clock separately and some rounded, so Today could show 4:38:46 above a 4:38:47 subtotal. They now share one now and whole seconds. - Day subtotals now line up in two right-aligned columns, "—" included. - q quit is back at the end of the key line, the first key dropped. - Removed the unused filteredTotals and friendlyDay, and comments that named removed functions.
r and space set selectRunning on the model, and whichever entry list arrived next used it up. A failed start left it set, so the next unrelated reload jumped the cursor to whatever was running; a watcher reload landing between StopAllRunning and StartEntry used it up before the new entry existed, so the start's own list didn't select it. startCmd now returns timerStartedMsg with the new entry's ID, and only that message selects it. Nothing is left in the model to go stale.
…ALI-2615) - At 120+ columns and 22 rows the wide layout left 7 rows for an 8-row detail pane, so the pane column went blank. The wide layout now also needs the rows for the pane (23 at the hero's height); shorter wide terminals get the compact layout, with details over the list. - Status and error messages were cut to half the line, even with keys to spare. The message now takes the room it needs and the keys fill the rest. - After y at 120+ columns no range chip was highlighted. The wide chips now show Yesterday while it's active, as the compact ones do. - The compact details survived n (new timer) and a widen-then-narrow. Both now close them. - The pane gap, the list's trailing column, and the tab bar and key line gaps were literals. They're tokens now (tui-pane-gap, tui-col-trail, tui-wordmark-gap, tui-tab-gap, tui-key-gap). - Removed the test-only tabsStart and a comment naming the removed footer, and the landing page no longer says the elapsed time is in the bottom status bar.
- The new-timer form discarded StartEntry's result and sent a plain reload, so unlike r and space it left the cursor on the old entry. It now sends timerStartedMsg with the new entry's ID. - A range key kept the compact details open, so they reopened on the new range's first entry. setRange now closes them. - With no message, the key line still reserved the 3-column gap that separates keys from a message, dropping q quit when the keys fit exactly. - README: enter opens details in the compact layout, which now includes wide terminals under 23 rows.
…-2616) The TUI's forms were full-screen pages with one error line at the bottom and an unfocused button at 1.91:1. They now open as centred modals over the dimmed screen, following the design canvas's RdTuiNew, RdTuiEdit, RdTuiDelete, RdTuiHelp and RdTuiEmpty boards. - Fields sit on a bg_alt strip; the focused one gets a primary ▌. Client and Project suggest as you type, ending with "+ Create". - Errors sit under their field with ✕, and the status line counts them. Validation matches the CLI: no future times, no end before the start. - New timer has Start (blank is now, or a past time) and End, saves Notes, and reads `task @client/project` through internal/quickadd. - Every start (form, r, space) goes through db.AddEntry, so stopping the running timer and starting the next is one write. A start before the running timer's shows as a Start error. - Edit entry gains Invoiced and Paid toggles and Delete entry. - Delete confirms name the entry with its time, with Delete and Keep it. - ? opens every key, grouped by tab; a first run shows a welcome screen. - Clients and Projects use the same modal and confirm. - New backdrop token for the dimmed screen; the bg-on-danger pair is added to the contrast checks.
# Conflicts: # design/build/main.go # design/tokens.json # internal/theme/tokens_gen.go # internal/ui/app.go # internal/ui/app_test.go # internal/ui/views/timers.go # internal/ui/views/timers_start_test.go # internal/ui/views/timers_view.go
…s (ALI-2616) Review round 1 on PR #15 found these problems: - Opening Edit entry for an entry another process had just deleted left the tab in New mode with an empty form. The mode is now set only once the entry is found, and the status says "That entry no longer exists". - A delete confirm whose entry disappeared stayed in confirm mode with no dialog. A reload now closes it, with the same status. - Suggestions were rows added to the modal and never dropped, so on a short terminal the box outgrew the body and lost its buttons and bottom border, and it re-centred (the fields jumped) whenever they opened. They now float over the rows below their field, capped at the button row, and the modal keeps room under its last suggesting field, so its size and place don't change. - Tab out of Client or Project took the highlighted suggestion even for a partly typed name, so typing "Fieldnote" to create a client gave "Fieldnote Studio". Tab now takes a suggestion only when the arrows chose one or the text is a name exactly; typing resets the selection. Enter on an open list still picks. - Clearing Client and Project in Edit entry kept the old project while saying "Entry updated". Blank now means the uncategorized project, as for `notch start` and a new timer. - A refused project rename (name taken) changed the shared *Project before saving, so the list showed the clashing name. It edits a copy now. Clients already saved a new struct. - A stopped entry with End cleared and Invoiced ticked also said "Stop the timer before invoicing it". That error is for running entries only. - A bare time in Edit entry ("9:30") was read as today, moving an older entry to today. It's now read on the entry's own day. - Every edit zeroed the seconds of Start and End, since the fields hold minutes. A field left as filled keeps its stored time. - Hard-coded sizes (modal and strip minimums, field width, keys sheet columns) move to tokens with usage notes.
Review round 1A fresh reviewer ran
Fixed in 86f0e2a. Each behaviour fix has a test that fails without it.
Declined: the backdrop pair (1.88:1) stays at a minimum of 1. WCAG 1.4.3 exempts text in inactive interface components, and the list dimmed behind a modal is inert. Nothing the user needs is drawn in that colour. The PR body says so. |
…ght (ALI-2616) Review round 2 on PR #15 found these problems: - With Client blank, a project name used under two clients ("Website" under Acme and Beta) was taken on tab as whichever came first, silently picking a client. Tab now takes an exact name only when one project has it; with several it leaves the text as typed and Project says "2 clients have Website — pick one". - A new timer couldn't cross midnight with bare times. In the New timer form, a bare Start later than now is last night's, and a bare End before the Start is the next day's; both still go through the no-future and end-not-before-start checks. - Saving a stale Edit entry overwrote changes made elsewhere: a timer stopped by the CLI or the bar was restarted, and a deleted entry's client was still created before the save failed. The save now checks the entry first. Gone, it says "That entry no longer exists". Times or running state changed, it keeps the form open with "This entry changed elsewhere — reopen it to edit". Saving is now synchronous, so that error can sit in the form. Edit entry also closes when a reload shows its entry gone, as the reload comment already said. - A kept Start has seconds (09:05:40), so an End typed as "09:05" read as before the Start. A typed time in the kept time's minute is now the same moment: a zero-length entry.
Review round 2A fresh reviewer reviewed 86f0e2a. Its It confirmed these round 1 fixes hold:
Fixed in d7c7b7e. Each fix has a test that fails without it.
|
Review round 3A fresh reviewer ran
Being fixed now (a narrow round 4 follows, since these include P2s):
|
…2616) Review round 3 on PR #15 found these problems: - The "2 clients have Website — pick one" hint didn't stop Save, so the entry landed under whichever same-named project came first. With Client blank it's now an error on Project. - With a new client typed ("Zed"), another client's project of the typed name still counted as an exact match, so tab took it and put Client back to that client. A typed client that doesn't exist yet now has no projects to suggest: the project is created under it. - q quit the app even in a form, so typing "quote" in Task lost the form (also on main). In a form or modal only ctrl+c quits now, and the key line says so. - The client and project delete confirms deleted the row under the cursor when confirmed, so a reload under the open modal could delete a different one with its entries. They keep the ID from when they opened, and close with "That client/project no longer exists" when it's gone. - Edit entry wrote every field from its snapshot, silently reverting a CLI --invoiced made while it was open. It now writes only the fields the user changed and keeps the rest as stored, and refuses only when a field the user changed was also changed elsewhere. Saving looks the entry up with a new db.GetEntry rather than loading every entry. - A bare Start later than now always rolled back a day, so "9:05 PM" at 09:30 started a 12-hour-old timer. It rolls back only when an End is given too; alone it's still "in the future". - Quick add ran in Edit entry, rewriting "Reply to @jane about Q4" and creating a client. It's for new timers only. - The first-run key line sent you to add a client first, while the copy says clients are created as you type; it now offers only n. The welcome screen waits for a load that succeeded with no entries, and reloads that fail are errors instead of an empty list. - The selected suggestion was marked by colour alone (WCAG 1.4.1). It now has the cursor glyph too.
…(ALI-2616) Edit project saved to the project under the cursor at save time, so a reload while the form was open (another process adding or deleting a project) could rename a different project. It now keeps the project's ID when it opens and saves to that one, read fresh from the database. Edit client already saved by its stored ID, but when that client had been deleted elsewhere the save failed with "Save failed: not found" and left the form open on nothing. Both forms now close when their record is gone, with "That client no longer exists" or "That project no longer exists", and reload the list.
Round 3 fixes1bf72d9. Each fix has a test that fails without it.
ba50bb5. The Projects and Clients edit forms save to the record they opened for, not the selection at save time, and close with "That … no longer exists" if it's gone. The builder found this alongside the delete-confirm fix. A narrow round 4 checks these two commits. |
…narrow fields (ALI-2616) Review round 4 on PR #15 found these problems: - The Edit entry merge checked invoiced and paid separately, so ticking Paid while the CLI un-invoiced the entry (or the reverse) could store paid without invoiced. Billing is one unit now: a change to either here and either elsewhere is stale. The merged entry also goes through model.ApplyBilling before it's written. - The client and project delete confirms checked the loaded list for a row deleted elsewhere, so a row already gone was "deleted" again and reported as deleted. They ask the database. - The merge compared the stored task and notes untrimmed with the form's trimmed text, so stray spaces counted as a change. - In the Project form, tab took the highlighted client, which wasn't always the exact name: "ACME Corp" sorts before "Acme". An exact name is listed first now, as in the timer form. - n kept the entry in the Projects confirm but not in Clients or Timers. esc and n keep in every confirm. - A theme.conf that changed bg without a backdrop kept the default's backdrop. It's now mixed from bg and border, as for aliasOS themes. - On a narrow terminal the field strip is narrower than the input's own width, so the end of long text and the cursor could be hidden. The input's window is recomputed for the strip each time it draws.
Review round 4A fresh reviewer ran
Fixed in 20309e7. Each fix has a test that fails without it.
No change
The P2 fix goes to a narrow round 5. |
…names (ALI-2616) Review round 5 on PR #15 found two problems: - On a narrow strip, moving the cursor left of the window that ends at the text's end started the window at the cursor, so typing in the middle of a long field showed nothing to its left. The window now starts a quarter of the strip before the cursor (clamped at 0), with the cursor and the text after it still showing. - The exact-name preference matched ignoring case and prepended each match, so with clients "Acme" and "acme", typing "Acme" picked the later "acme". An exact match in the typed case now comes first, then any case, through one helper shared by the timer form (clients and projects) and the Project form.
Review round 5 (final)A fresh reviewer ran
Fixed in cdda5cc (P3s, no further round). Each fix has a test that fails without it.
The loop stops here, with nothing at P1 or P2 open. |
Closes ALI-2616.
The TUI's forms were full-screen pages with one error line at the bottom, and the unfocused form button was 1.91:1. All forms (New timer, Edit entry, and the Clients and Projects forms) now open as centred modals over the dimmed screen, following the design canvas's RdTuiNew, RdTuiEdit, RdTuiDelete, RdTuiHelp and RdTuiEmpty boards.
What changed
Modal forms (
internal/ui/views/modal.go,timer_form.go)+ Create “…”. ↑↓ choose, enter picks. An exact name match is listed first.✕ message, wrapping rather than cutting off. The status line counts them (✕ 2 fields need fixing). Typing in a field clears only that field's error.New timer
9:05 AMor2026-12-03 09:05) and End (blank keeps it running; with a Start it adds a finished entry).task @client/projectfills Client and Project when you leave Task, throughinternal/quickadd, and is read again on save.qtypes;ctrl+cquits, and the key line says so. (Before,qquit even in a form.)One write for every start. The form,
rand space all go throughdb.AddEntry, so stopping the running timer and starting the next happens in one transaction. A start before the running timer's start shows as an error on Start (ErrRunningStartedLater).timerStartedMsgstill carries the new entry's ID, so the new row is selected.Edit entry saves only the fields you changed, so a change made elsewhere while it's open (the bar stopping the timer, the CLI's
--invoiced) stands. If a field you changed was also changed elsewhere, it says “This entry changed elsewhere — reopen it to edit”. Quick add is for new timers only. A bare time is read on the entry's own day, and untouched times keep their seconds. It also gains Invoiced and Paid toggles (ticking Paid ticks Invoiced; clearing Invoiced clears Paid; a running entry can't be invoiced) and a Delete entry button.Delete confirm. A danger border, the entry named with its day, times and duration, “This can’t be undone.”, then Delete (filled danger) and Keep it (secondary, focused first).
ydeletes, esc keeps. Clients and Projects use the same confirm. From Edit entry, Keep it goes back to the form.Keys sheet.
?opens every key grouped by tab (Everywhere, Timers, Ranges, Projects, Clients, Reports, Forms) in two or three columns, depending on width. On short terminals it scrolls with ↑↓. The bottom bar shows? all keyswhen there's room.First run. With no entries, Timers shows the stopwatch mark, “Nothing tracked yet”, the
n New timerbutton and the bar widget tip, once a load has succeeded.Tokens. New
backdropcolour for the dimmed screen (aliasOS themes mix border 60% over bg), new spacing tokens for the modal and the keys sheet, and new contrast pairs. Values are indesign/tokens.json; the theme code was regenerated withgo run ./design/build.Contrast
Computed with the WCAG 2.2 formula on the default palette. All pairs are in
design/tokens.jsonand checked bygo run ./design/build -check.The backdrop pair stays at a minimum of 1: WCAG 1.4.3 exempts text in inactive interface components, and the screen dimmed behind a modal is inert until the modal closes. No text the user needs is drawn in that colour; everything they act on is in the modal. It's listed so the table is complete. No pair fails.
Colour is never the only signal: focus has ▌, errors have ✕ and sit under their field, the selected suggestion is also marked by position and the ↑↓ hint, and toggles show
[x].Differences from the boards
2026-12-03 11:00, notDec 3 11:00 AM, so an edit round-trips through the same format the CLI accepts. Times like9:05 AMare still accepted.idle, not the board'snot tracking. That bar is ALI-2615's and wasn't changed here.How to try it
Build a binary, then run it in a real terminal against a copy of your database, so nothing you try touches your real data:
Then try:
nwith a blank Task and enter: the error sits under Task and the status line counts it.n, typeLogo @Fieldnote Studio/Brand refresh, tab: Client and Project fill in.n, type a Client name: suggestions with+ Create.nwith a Start earlier than the running timer's: an error on Start.eon an entry: toggle Invoiced and Paid with space; set End before Start.d: the confirm names the entry; enter on Keep it keeps it.?at a full-size and a small terminal.NOTCH_DB=/tmp/notch-try/empty.db /tmp/notch-2616for the first-run screen.