Skip to content

Modal forms with field errors, delete confirm and the keys sheet (ALI-2616) - #15

Merged
michaelaguiar merged 14 commits into
mainfrom
ali-2616-tui-modals
Dec 4, 2026
Merged

michaelaguiar merged 14 commits into
mainfrom
ali-2616-tui-modals

Conversation

@michaelaguiar

@michaelaguiar michaelaguiar commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

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)

  • Fields sit on a bg_alt strip. The focused field gets a primary ▌ before its value; buttons and toggles show focus the same way.
  • Client and Project suggest as you type, in a box under the field, ending with + Create “…”. ↑↓ choose, enter picks. An exact name match is listed first.
  • Errors sit under their own field as ✕ 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.
  • Buttons are primary (bg on primary) or secondary (text on bg_alt). The 1.91:1 button style is gone.
  • On short terminals the modal drops its spacing rows first, then hints, so every field and the buttons stay on screen down to 64×22.

New timer

  • Start (blank means now, or a past time like 9:05 AM or 2026-12-03 09:05) and End (blank keeps it running; with a Start it adds a finished entry).
  • Notes are saved.
  • task @client/project fills Client and Project when you leave Task, through internal/quickadd, and is read again on save.
  • Validation matches the CLI: no future times, and the end not before the start.
  • Bare times cross midnight when logging a block: with an End given, a bare Start later than now is last night's, and a bare End before the Start is the next day's (23:30 to 00:15 works at 00:20). A bare Start alone later than now is still “in the future”.
  • With Client blank, a project name two clients share is an error on Project until you pick the client.
  • In a form, q types; ctrl+c quits, and the key line says so. (Before, q quit even in a form.)

One write for every start. The form, r and space all go through db.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). timerStartedMsg still 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). y deletes, 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 keys when there's room.

First run. With no entries, Timers shows the stopwatch mark, “Nothing tracked yet”, the n New timer button and the bar widget tip, once a load has succeeded.

Tokens. New backdrop colour 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 in design/tokens.json; the theme code was regenerated with go run ./design/build.

Contrast

Computed with the WCAG 2.2 formula on the default palette. All pairs are in design/tokens.json and checked by go run ./design/build -check.

Pair Where Ratio Needs
text on bg_alt field values, secondary buttons 9.47 4.5
subtle on bg_alt placeholders 4.96 4.5
danger on bg_alt Delete entry button 5.85 4.5
bg on danger Delete button in the confirm 7.67 4.5
bg on primary primary buttons, selected suggestion 8.17 4.5
primary on bg focus ▌, Keys border 8.17 3
text on bg labels, modal titles 12.42 4.5
dim on bg unselected suggestions, key labels 11.53 4.5
subtle on bg hints 6.51 4.5
accent on bg keys sheet group titles 10.08 4.5
highlight on bg first-run mark 11.38 3
border on bg modal and suggestion borders 3.03 3
backdrop on bg dimmed screen behind a modal 1.88 exempt

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

  • Four tabs, not three. The boards fold Projects into Clients, which is ALI-2617. The keys sheet keeps a Projects group.
  • Dates in fields are pre-filled as 2026-12-03 11:00, not Dec 3 11:00 AM, so an edit round-trips through the same format the CLI accepts. Times like 9:05 AM are still accepted.
  • Delete entry is in Timers only. Reports' edit modal has no Delete; that screen is redesigned in ALI-2618.
  • The dimmed screen drops the selected row's tint. It's redrawn as plain text in the backdrop colour, so nothing behind the modal competes with it.
  • Editing a stopped entry needs an End. A blank End used to mean “keep the old one”; now it's an error, so what you see is what's saved.
  • Suggestions open on typing or ↓, not on focus, so tabbing through an empty Client doesn't pick the first client.
  • Suggestions float over the rows below their field instead of pushing them down, so the modal keeps its size and place while they open and close. Tab takes a suggestion only when the arrows chose it or the text is a name exactly; otherwise the typed name is created.
  • The top bar still says idle, not the board's not 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:

go build -o /tmp/notch-2616 .
mkdir -p /tmp/notch-try
cp ~/.local/share/notch/notch.db ~/.local/share/notch/notch.db-wal /tmp/notch-try/ 2>/dev/null
NOTCH_DB=/tmp/notch-try/notch.db /tmp/notch-2616

Then try:

  • n with a blank Task and enter: the error sits under Task and the status line counts it.
  • n, type Logo @Fieldnote Studio/Brand refresh, tab: Client and Project fill in.
  • n, type a Client name: suggestions with + Create.
  • n with a Start earlier than the running timer's: an error on Start.
  • e on 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-2616 for the first-run screen.

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.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1

A fresh reviewer ran code-review (high) on c58abca and found no P1. It confirmed:

  • cancel writes nothing;
  • quick add, AddEntry with the Start field error, paid-implies-invoiced, no future times and end-before-start all match the CLI;
  • enter-saves-from-any-field is safe.

Fixed in 86f0e2a. Each behaviour fix has a test that fails without it.

  • P2, the form got stuck in New mode when the entry vanished before the form opened. The mode is now set only after the entry is found; otherwise the status says "That entry no longer exists".
  • P2, suggestions pushed the buttons off small screens, and the box re-centred as they opened. Suggestions now float over the rows below their field, capped at the button row. The modal keeps its height and top edge, and the buttons and border always show. Tested at 64×22 with three errors and six suggestions.
  • P2, tabbing out of Client or Project took the highlighted suggestion even on a partial match. "Fieldnote" became "Fieldnote Studio". Tab now takes a suggestion only if the arrows chose it or the text is an exact name. Typing resets the selection.
  • P2, clearing Client and Project on edit kept the old project and still said "Entry updated". Blank now means Uncategorized, as in notch start and the new-timer form.
  • P2, a refused project rename left the clashing name in the list. saveForm now edits a copy.
  • P3, a delete confirm stayed open with no box when its entry vanished. It now closes.
  • P3, a stopped entry with a blank End got "Stop the timer before invoicing it." That error now applies only to a running entry.
  • P3, a bare time like 9:30 in Edit moved an older entry to today. It's now read against the entry's own date.
  • P3, every edit zeroed the seconds of Start and End. An unchanged field keeps its stored value.
  • P3, some sizes were hard-coded. They're now tokens: tui-keys-cols, tui-modal-min-width, tui-strip-min and tui-field-width.

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.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 2

A fresh reviewer reviewed 86f0e2a. Its code-review skill run was started but never reported back, so this round is the reviewer's own review, not the skill's. Round 3 runs the skill again.

It confirmed these round 1 fixes hold:

  • the gone-entry handling for both the form and the delete confirm;
  • the running-only invoicing error;
  • blank Client and Project meaning Uncategorized, on both edit paths;
  • kept seconds;
  • the Projects form's tab;
  • the size tokens;
  • the suggestion overlay.

Fixed in d7c7b7e. Each fix has a test that fails without it.

  • P2, a project name under several clients picked one at random. With Client blank, tab took the first of several same-named projects. Tab now takes an exact project match only when exactly one exists. Otherwise it keeps the text and shows "N clients have Website — pick one".
  • P3, a new timer couldn't cross midnight with bare times. In the New timer form, a bare Start later than now means yesterday, and a bare End before the Start means the next day. Both are still checked against future times and end-before-start.
  • P3, a stale edit form overwrote changes made elsewhere. A timer stopped from the CLI or the bar restarted when the form saved. A deleted entry could still get a client created first. The save now looks up the entry before creating anything:
    • if the entry is gone, the form closes and says so;
    • if its running state, Start or End changed since the form opened, the form stays open with "This entry changed elsewhere — reopen it to edit".
    • Edit entry also closes when a reload shows its entry is gone.
  • P3, a kept Start with seconds made a same-minute End look inverted. An End typed in the same minute as a kept Start now saves a zero-length entry instead of an error.

@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 3

A fresh reviewer ran code-review (high) on d7c7b7e. It confirmed:

  • the midnight rules hold;
  • a same-minute End saves a zero-length entry;
  • the gone and stale handling works on both edit paths;
  • synchronous edit saves are acceptable for a single-user tool.

Being fixed now (a narrow round 4 follows, since these include P2s):

  • P2, the "N clients have X — pick one" hint didn't stop Save, so the entry was still filed under the first client. Validation will block it.
  • P2, a new client name you'd typed was replaced by an existing client that has the same project name ("Zed" plus "Website" became Acme/Website).
  • P2, q quits the app while a form has focus. This dates from the first commit, but the modals make it easy to hit: typing "quote" in Task exits and loses the form. While a form is open, only ctrl+c will quit.
  • P2, the client and project delete confirms delete whatever is under the cursor at confirm time, so a reload could delete a different client and its entries. They'll delete by the stored ID.
  • P3, the stale check covered only times and running state, so an invoiced mark made from the CLI could be reverted.
  • P3, a bare Start later than now always rolled back a day. "9:05 PM" typed at 09:30 started a 12-hour-old timer. Rolling back will need an End.
  • P3, quick add ran in Edit entry too.
  • P3, the first-run footer copy disagreed with the screen, and the screen could show before the first load.
  • P3, the selected suggestion was marked only by colour (WCAG 1.4.1). It'll get a marker glyph.

…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.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Round 3 fixes

1bf72d9. Each fix has a test that fails without it.

  • The "pick a client" case now blocks Save, with an error on Project.
  • A typed new client keeps its new project instead of being swapped for an existing client's.
  • q types in forms and modals; only ctrl+c quits there, and the key line says so. This bug was on main too.
  • Client and project delete confirms delete the record they opened for, and close if it's gone.
  • Edit entry writes only the fields you changed. A change made elsewhere while the form is open (the bar stopping the timer, the CLI's --invoiced) is kept. The save is refused only when the same field changed in both places.
  • A bare Start rolls back to yesterday only with an End. "9:05 PM" alone at 09:30 is "in the future".
  • Quick add applies to new timers only.
  • The first-run screen shows only after a successful empty load, and its key line offers only n. A failed reload is now an error.
  • The selected suggestion gets a ▌ marker as well as its colour.
  • New db.GetEntry, so a save looks up one entry instead of loading them all.

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.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 4

A fresh reviewer ran code-review (high) on 1bf72d9 and ba50bb5. It confirmed:

  • the ambiguous-project error;
  • a typed new client keeping a new project;
  • quit (ctrl+c everywhere, q only when nothing is busy, covering every view's inputs);
  • stored-ID deletes and edits;
  • the merge for task, notes, project, times and running state;
  • the bare-Start, quick-add and first-run changes.

Fixed in 20309e7. Each fix has a test that fails without it.

  • P2, the edit merge could save paid without invoiced. Example: paid toggled here while the CLI un-invoiced the entry. Invoiced and paid now count as one unit for conflicts, and the merged entry goes through model.ApplyBilling; a failure is refused as stale.
  • P3, the Clients and Projects confirms checked the cached list, so a row already deleted elsewhere still reported "deleted". They now ask the database.
  • P3, surrounding whitespace counted as a change in the task or notes.
  • From the skill's run, checked and real:
    • In the Project form, tab turned an exact "Acme" into "ACME Corp", because SQLite sorts by byte value. An exact name now comes first.
    • n cancelled a delete confirm in Projects but not in Clients or Timers. esc and n now keep in all three.
    • A theme.conf that overrode bg kept the fixed backdrop colour. The backdrop is now derived from border and bg, unless the theme sets it.
    • On narrow terminals, the end of long text and the cursor were hidden in form fields. The visible window now follows the cursor.

No change

  • enter picks the highlighted suggestion while tab keeps the typed text. That's deliberate: enter chooses.
  • The edit's read-check-write isn't one transaction. It's a single-user tool, and the stale check covers the realistic races.
  • Editing Client in Edit entry clears Project, so saving without a project files it under one named after the client. That's the same rule as notch start --client-name.

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.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 5 (final)

A fresh reviewer ran code-review (high) on 20309e7 and found no P1 or P2. It confirmed:

  • the billing merge (invoiced and paid as one unit, with ApplyBilling run after the merged times) has no route to running-and-invoiced;
  • the database-checked delete confirms;
  • the trimmed comparison;
  • esc and n in every confirm;
  • the backdrop derivation;
  • the stripInput window, which doesn't change the stored model.

Fixed in cdda5cc (P3s, no further round). Each fix has a test that fails without it.

  • Typing mid-text in a narrow field was blind. The window started at the cursor. It now keeps a quarter of the strip's width as context to the left of the cursor.
  • With clients "Acme" and "acme", typing "Acme" picked "acme". A shared exactFirst helper now prefers the exact case, then other cases. The timer form's and the Project form's suggestions both use it.

The loop stops here, with nothing at P1 or P2 open.

@michaelaguiar
michaelaguiar marked this pull request as ready for review December 4, 2026 16:56
@michaelaguiar
michaelaguiar merged commit 6e553ee into main Dec 4, 2026
1 check passed
@michaelaguiar
michaelaguiar deleted the ali-2616-tui-modals branch December 4, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant