web: read the outcome off a table instead of walking an if chain #24

Merged
PerishFire merged 3 commits from debt-dispatch into main 2026-07-21 13:35:05 +00:00
Owner
No description provided.
Every view answered a wire outcome the same way: a chain of else-ifs
comparing the same string, each arm setting one message. That is dispatch
spelled longhand, so the seventeen of them collapse into a lookup keyed by
the outcome, with the branch kept only where it does real work — clearing
fields, reloading, redirecting.

The fallback sentence was written out four times; say() now holds it once
and takes an override for the one caller that says something else. Views
that redirect on ok keep the early return, so the table only ever answers
the failure half.

The identity guard in Portal and Admin discriminated by comparing against
both string sentinels in turn. It now asks which side of the union it is
holding, which is the honest question when the type is Me | "anon" |
"fail". The first attempt nested that check and pushed both files past
the block depth limit — two debts traded for four faults — so the guard
is two flat early returns instead.

admin-boards.tsx is a compound word in a filename; it is boards.tsx now.

Verified in a browser, not just through the type checker: a wrong password
renders "That login and password did not match." rather than the fallback,
which is what a mistyped table key would have silently produced, and both
guarded routes bounce to /login carrying their return path.

Debt in this repo goes 19 to 1, with no faults; the one left is in the cli.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@playwright/cli is a driver for a browser that already lives on the
machine, not a thing this app is built from. Holding it as a workspace
dependency meant every install of this repo pulled it, and pinning it in
the catalog meant the version was decided here rather than wherever the
browser is.

Installed globally instead, with its agent skill in the user's skill
directory. The tool's default browser channel resolves to the system
Chrome, so no configuration is carried in the tree and the skill's own
examples work unmodified.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cli: give the argument tail a receiver
All checks were successful
guard / guard (pull_request) Successful in 4m31s
44de4017d8
Four command handlers took the same &[String] first, which is a receiver
written as a parameter. They are methods on a Rest newtype now, and main
dispatches with rest.login() instead of login(rest).

Only app was reported, though login, invite and team have the identical
signature. Moving app above login moved the report onto team: the tool
raises one debt per group of same-shaped signatures and anchors it at the
last one in file order. So a report of this kind names a group, and the
group is what gets fixed — fixing only the named function would have left
three identical shapes and moved the marker rather than cleared it. This
also explains the note that renaming the function does not clear such a
debt while renaming the parameter does: renaming the parameter leaves the
group, which moves the anchor.

Debt in this repo reaches zero.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PerishFire deleted branch debt-dispatch 2026-07-21 13:35:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
PerishLab/ensign!24
No description provided.