Lint went from 84 problems to 0. Build passes.
Dead code:
- TeamInvoices: drop the orphaned Subcontractor PO block (updateSubcontractorPO
plus send/ready-to-pay/paid/reopen/cancel/delete/download/CPA-export handlers
and ~25 derived vars). That feature moved to the routed
TeamCreateSubcontractorPO / TeamSubcontractorPODetail pages in the Layout2
redesign; these were leftovers. 2100 -> 1880 lines.
- Tasks: drop unrendered project sort/tab/completion logic in TasksPageShell.
- Remove 59 unused vars, imports, and handlers across 12 other files.
Removed wasted queries:
- TeamInvoices ran a nested subcontractor_payments join (profiles, projects,
companies, PO items, tasks) on every page load into state nothing read.
- TeamInvoices and ExternalMyInvoices each fetched a task-type map on invoice
open and discarded it; the ExternalMyInvoices one blocked the detail popup.
- RequestForm queried sign_families on mount into unread state.
Dependencies:
- Drop heic2any (zero imports). heic-to is the one in use and already lazy-loads.
Effects and exports:
- RequestForm: remove 4 effects. Sign-row sizing and company-change resets move
into their change handlers; single-company selection is derived during render
rather than written back into form state.
- FilterDropdown: measure position on click instead of in an effect, which also
removes a one-frame stale-position flicker.
- BrandBook: latest-ref pattern so the 900ms address debounce is not reset by
handler identity.
- ClientMyInvoices: hoist MONTHS to module scope.
- Split non-component exports: POPUP_FIELD_LABEL moves to lib/popupStyles.js;
resolveProfileAvatar and useLiveClock are internal-only; getGreeting deleted
as nothing referenced it.
Companies.jsx keeps one scoped eslint-disable with a reason: load() only
setStates after awaiting its queries, so set-state-in-effect is a false positive
there, and load() is shared with the create/delete handlers.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Report was flagging every unbilled delivered version as "Not Invoiced"
for sub billing, even when a team member delivered it — team work is
billed to the client directly and is never sub-invoiced. Now traces
each version's actual deliverer and shows N/A when it's a team member,
regardless of who delivered earlier versions on the same task.
Also: SubcontractorInvoiceForm no longer masks fetch errors as "No
completed tasks available to invoice" — the real error now shows in
the Completed Tasks panel.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Clicking the dimmed area outside a modal (+Task, +Invoice, expense,
review, etc.) accidentally dismissed it and lost in-progress input.
Every popup already has an explicit Cancel/Close/✕ button, so the
backdrop click handler is removed; also drops the now-dead
onClose/blockClose prop plumbing that only existed to support it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Completed Tasks list scoped by task.assigned_to meant a reassigned task
made the original sub's already-delivered versions permanently unbillable
by anyone. Now scoped by deliveries.sent_by directly, so each version
stays billable by whoever actually delivered it, independent of who
currently owns the task.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rename in 91045a1 was only partially reverted by later commits, leaving
~20 UI spots calling the project entity "Client" while table headers
already said "Project". Reverted all of them plus the /clients/:id
route (now /projects/:id canonical again, nothing was live yet).
Also: stop tracking .env.backfill (had a live admin password/token
committed - rotate those credentials), remove stale pre-redesign
layout.md superseded by REDESIGN-LAYOUT2.md.
- Rename "Project" → "Client" across UI (labels + /projects→/clients routes with redirect); normalize company-meaning labels to "Company"
- Finance tabs: merge dual cards into one per tab, add header column filters (expenses/subs/invoices), overview as 3-section card, move +Expense/+Invoice to card right edge
- Tasks: responsive mobile stats grid, progressive column hiding (min Status+Name+Assigned), sidebar mobile footer (profile/theme/signout)
- Hide Company column for single-company users; +Task shows disabled Company field instead of hiding
- Sticky table headers site-wide with opaque card background
- Pin dev server to port 5173
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Design system (Layout2):
- Solid token-driven theme (no animated grid); single-source tokens for bg,
cards (bg/border/radius), popups, fonts (Inter), and full semantic +
data-viz color palette. Swept ~168 hardcoded colors to tokens.
Dashboard:
- Reflow: To Do + Calendar row (fixed right rail) over Activity / In-Progress /
Team Performance; CSS height-match (To Do = Calendar); responsive stacking.
- 'Tasks Not Started' -> 'To Do' card with R#/Assigned columns; compact money fmt.
Tasks page:
- Combined tabs into Tasks + Completed with a Status column.
- Column-header sort + filter (Status, R#/new-vs-revision, Project, Task Type,
Company) via portaled, scrollable FilterDropdown; removed toolbar filters and
the projects side panel; headers stay visible when empty; renamed to 'Tasks'.
Perf:
- FK/filter index migration; removed redundant client/external scope waterfall
(rely on RLS); parallel follow-up queries.
Mobile:
- Responsive grids; mobile topbar = hamburger only, blends with bg, proper offset.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Invoice numbers now come from DB function next_invoice_number()
(max+1 per year under advisory lock) with a unique index; the old
row-count method reused numbers after deletes and raced concurrent
creates, which broke public pay links
- Remove dead standalone TeamCreateInvoice page; the TeamInvoices
modal is the single create path (page had already drifted)
- Invoice delete now asks for confirmation and only un-bills tasks/
submissions not billed on another invoice
- Created invoice shows correct "sent" status in list without reload
- Invoice/due dates computed at save time, not module load
- Reopening a paid invoice clears stale stripe_fee
- Stripe webhook markPaid is idempotent (no double receipts)
- subcontractor_invoice_items.version_number column stores billing
version explicitly; description parsing kept as legacy fallback
- Drop unused buildInvoiceStatusByKey/deriveVersionStatus
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace SubcontractorInvoiceDetailView (card-based) with flat layout
matching the original sub-invoice popup: meta strip + raw table + notes.
- InvoiceDetailPopup: add metaContent/metaActions/metaCols props + export POPUP_FIELD_LABEL
- New InvoicePopupTable: flat sortable 5-col table, no card wrapper
- All 4 popups (client, team invoice, team sub-invoice, external): use
flat meta strip (4-col grid, borderBottom) and InvoicePopupTable
- Sub-invoice + external: Submitted | Paid/Created | Items | Total
- Client invoice: Date | Due | Status | Total
- Team invoice: Date | Due | Company | Email | Total (+ stripe if paid)
with Edit Dates button in metaActions slot
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Overview tab: 3 donut pie charts (expenses by category, sub payments, invoiced) each with independent month navigation arrows
- Expenses tab: big red total in category sidebar, left-aligned category column, white text
- Subcontractors tab: big gold total in sidebar, pending/paid breakdown with gold highlight
- Invoices tab: big green total in companies sidebar, dashboard-inline-link for invoice# and company, StatusBadge with Invoiced/Paid labels, column widths tuned
- StatusBadge: add optional label prop for custom display text
- Layout/style polish across tabs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Unified Tasks page: 3 role render blocks → 1, normalized row shape, single renderRow/sort/tabs
- Fixed role scoping: external = all tasks in member projects, client = all tasks in company projects
- Fixed client bug: was scoped by submitted_by, now company→project→tasks
- Aligned dashboard client scope to match tasks page
- Hot tasks dashboard: now filters to active statuses only (not completed/invoiced/paid)
- Removed Projects.jsx (dead), fixed /project/ → /projects/ links
- Renamed all page files to match folder path (Team*, External*, Client* prefixes)
- Renamed: RequestsPage→Tasks, Settings→Profile, CompaniesPage→Companies, ProjectDetailPage→ProjectDetail
- Dropped dead fetches from Tasks page (invoices, invoice_items, subcontractor_invoice_items)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- DashboardPage, Projects, RequestsPage, ProjectDetailPage, RequestDetail: each now handles team/external/client in one file via role flags — removed 10 old role-specific sub-files
- Layout: client Company nav link goes directly to /company/:id when user has a single company
- FileBrowser: replace emoji icons with colored extension-text badges (square); folder icon stays 📁; Adobe/Figma/design-tool colors for design files
- CompaniesPage: merged team Companies + client company routing (single-company redirect, multi-company list)
- FileSharing: integrated FileBrowser component
- Removed: seafile API + lib, old ServerStatus, TaskDetail, role-split page files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove recursive directory size calculations (single Seafile API call per list)
- Remove 'Used in this location' usage display
- Fix move using v2 per-type endpoints instead of broken batch endpoint
- Send entry type from frontend for correct move routing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Was 10 MB — blocked zip files at or near that size. Supabase storage
supports up to 50 MB; mime-type restrictions were already removed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Store stripe_fee on invoices when webhook receives checkout.session.completed
- Display Stripe fee and net received in InvoiceDetail when paid via Stripe
- Add backfill-stripe-fees edge function to populate fee on existing paid invoices
- Migration: add stripe_fee column to invoices table
- Includes all pending portal changes (brand book, sign survey, task/project/company updates, etc.)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>