mega-plant/components
David fd2afeba4e Invoices: a machine chosen in the dropdown was never actually booked
Selecting a plant item in the Booked to dropdown silently did nothing. The menu
opened, the option highlighted, and clicking it produced no request at all — the
menu just closed. Reproduced with a real browser click: no POST to /book.

The menu is rendered with createPortal(..., document.body) because the line table
lives in an overflow-x-auto container that would clip an in-place dropdown. A
portal is not a DOM descendant of the component that made it, so the click-away
handler's `boxRef.contains(target)` reported every option as an outside click:
mousedown closed the menu, React unmounted the button, and the click that would
have booked it never landed. The menu now has its own ref and is treated as part
of the control. Verified with a real click — the booking posts, the site clears,
and the unbooked badge goes.

The site dropdown was never affected; it is a native <select>, outside the portal.

Also on this screen:

- The Booked to column needs min-w-[240px] with the two pickers stacked inside
  it. At 768px the column is only ~166px, so two 200px controls could not sit
  side by side; as flex children they compressed into each other by ~12px, and
  once they were not allowed to shrink they spilled past the edge of the table.
- Dropped the "Booked to income / VAT to SARS / Billed to customer / Still
  unbooked" money block, its component and the variables feeding it. The status
  line stays: "1 line not yet booked to a machine".

Typecheck and build green. Checked at 768x1024 and 375x812: no page overflow, no
control past the table edge, no tap target under 44px.
2026-10-03 15:43:46 +02:00
..
ChartsGrid.tsx Charts: a profit line that changes colour, and a Series toggle 2026-10-03 09:20:16 +02:00
DashboardCharts.tsx Charts: a profit line that changes colour, and a Series toggle 2026-10-03 09:20:16 +02:00
ExpenseSectionPage.tsx Fix: the mobile table was mislabelled and clipping its own totals 2026-10-02 15:34:19 +02:00
GlobalSearch.tsx Fix: the mobile table was mislabelled and clipping its own totals 2026-10-02 15:34:19 +02:00
IncomeView.tsx Fix: the mobile table was mislabelled and clipping its own totals 2026-10-02 15:34:19 +02:00
InvoiceIntake.tsx Fix: toast and machine dropdown were rendering behind the page chrome 2026-10-02 18:42:29 +02:00
InvoiceList.tsx Invoices: fix the tablet layout and make booking an unbooked line obvious 2026-10-03 09:59:05 +02:00
InvoiceTable.tsx Invoices: a machine chosen in the dropdown was never actually booked 2026-10-03 15:43:46 +02:00
InvoiceUploader.tsx Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
MachineCombobox.tsx Invoices: a machine chosen in the dropdown was never actually booked 2026-10-03 15:43:46 +02:00
MachineLineChart.tsx Charts: a profit line that changes colour, and a Series toggle 2026-10-03 09:20:16 +02:00
PlantMap.tsx Map: dark tiles from Esri, because CARTO retired keyless access 2026-10-03 09:20:24 +02:00
PlantMapLoader.tsx Map: dark tiles from Esri, because CARTO retired keyless access 2026-10-03 09:20:24 +02:00
PlantRegisterTable.tsx Plant: default the register's status filter to Active 2026-10-03 09:59:11 +02:00
RunningView.tsx Fix: the mobile table was mislabelled and clipping its own totals 2026-10-02 15:34:19 +02:00
ScrollFade.tsx Fix: the mobile table was mislabelled and clipping its own totals 2026-10-02 15:34:19 +02:00
Sidebar.tsx Sites: auto-allocate container lines to the container the site hires 2026-10-02 18:32:12 +02:00
SiteBookingSelect.tsx Invoices: fix the tablet layout and make booking an unbooked line obvious 2026-10-03 09:59:05 +02:00
SiteContainerEditor.tsx Sites: auto-allocate container lines to the container the site hires 2026-10-02 18:32:12 +02:00
SiteCoordinateEditor.tsx Sites: give every site coordinates 2026-10-02 16:33:43 +02:00
SitesView.tsx Sites: a card list that reads like the income screen 2026-10-03 09:20:20 +02:00
Sparkline.tsx Invoices: keep the PDF on the invoice, and search the invoice's own words 2026-10-02 19:09:16 +02:00
ThemeProvider.tsx Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
ThemeToggle.tsx Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
Toast.tsx Fix: toast and machine dropdown were rendering behind the page chrome 2026-10-02 18:42:29 +02:00