record the onSelect widening and what invoiceshelf being unconnected leaves unverified

This commit is contained in:
2026-08-07 14:08:22 +00:00
parent f46a603892
commit a81b7cfcde
+16 -1
View File
@@ -299,7 +299,22 @@ publishers means changing the chat panel, which is another agent's, so it is wri
`apps/Invoices/DashboardView.tsx`, plus two more row handlers in the same file that the grep misses `apps/Invoices/DashboardView.tsx`, plus two more row handlers in the same file that the grep misses
because they route through an `onOpen` prop. Every one was pure navigation to an already-addressable because they route through an `onOpen` prop. Every one was pure navigation to an already-addressable
URL that the destination genuinely reads (`useInvoicesSection` parses both `status` and `selected`), URL that the destination genuinely reads (`useInvoicesSection` parses both `status` and `selected`),
so they were anchors written as buttons and nothing more. Fixed in `ea1dae5`; the grep is clean now. so they were anchors written as buttons and nothing more. Fixed in `ea1dae5`.
**Widen that grep to `onSelect` as well** — Radix menu items do not have an `onClick`. Adding the
alternation turned up three more, all pure navigation to already-addressable URLs:
`CustomersListView.tsx` "Their invoices" / "Their payments" (`?customer=`, read by `useListFilters`)
and `InvoicesListView.tsx` "Record payment" (`/invoices/payments?edit=new&pay=<id>`, both params read
by `InvoicesView`). A menu item becomes an anchor with `asChild`, which hands Radix's item semantics
to the `<Link>` instead of nesting one inside the other; the "Record payment" one also meant turning a
callback prop into an href prop (`onRecordPayment``recordPaymentHref`), which is the shape any
list-to-parent navigation should have. Fixed in `f46a603`. Standing form of the sweep:
`grep -rn "onClick={() => navigate(\|onSelect={() => navigate(" src/apps/officer-web src/workspaces/officerdev/src`.
Clean as of `f46a603`.
Two `navigate()` calls in the same files deliberately **stay** calls: `onConverted` (an estimate is
converted, *then* you are sent to the resulting invoice) and `select()` on the customers "View" item
(a toggle that preserves the surrounding filter/search/page params, which a fixed `to=` would drop).
**A third sweep, because a navigation can be well-formed and still go nowhere.** Neither grep above **A third sweep, because a navigation can be well-formed and still go nowhere.** Neither grep above
can tell you whether the URL a control navigates to *exists*. React Router does not error on an can tell you whether the URL a control navigates to *exists*. React Router does not error on an