Commit Graph

44 Commits

Author SHA1 Message Date
Krao Hasanee 476aab8ae8 Add company tabs to client invoices page
Tabs match projects page style, sorted alphabetically. Stats (Outstanding,
Paid, Overdue) update to reflect the selected company only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:23:43 -04:00
Krao Hasanee 1003b82944 Add task columns to client dashboard
Two-column layout below stats: Awaiting Your Review (left) + In Progress (right).
Each row links to the request detail page. Project name shown as subtitle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:19:03 -04:00
Krao Hasanee 5c668de588 Change request title placeholder to 'e.g. Site Address'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:16:43 -04:00
Krao Hasanee a8bce851a9 Rearrange client invoice card layout
Line 1: invoice name + issued date / item count
Line 2: status badge + overdue flag + price
Right: Download PDF button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:14:49 -04:00
Krao Hasanee ed30bb3a18 Restore summary stats and price to client invoice page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:12:19 -04:00
Krao Hasanee 19e7ae48af Simplify client invoice list: remove summary stats, strip card to essentials
Shows invoice number, issue/due date, overdue flag, item count, status, download PDF.
Removes outstanding/paid/overdue summary grid and total amount display.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:10:28 -04:00
Krao Hasanee 54ceb69dd0 Sort company tabs alphabetically on projects page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:07:47 -04:00
Krao Hasanee a519e806e5 Projects: collapse by default + company tabs
- ProjectGroup starts collapsed (open=false)
- Multi-company clients see tab switcher matching Invoices page style
- Single-company clients: no tabs, no change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:05:03 -04:00
Krao Hasanee 2a9c743823 Group projects by company on client projects page
Shows company name headers when client belongs to multiple companies.
Single-company clients see no change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:02:22 -04:00
Krao Hasanee 3a1cde64e6 Fix client storage RLS + rollback task on upload failure
Storage policies for submissions read/insert and deliveries read were using
get_my_company_id() (single company) instead of has_company_access() — blocked
multi-company clients from uploading or viewing files.

NewRequest: delete task+submission if any file upload fails so no orphaned
records are left behind.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 11:41:10 -04:00
Krao Hasanee 2bf29f5699 Remove 'Add Request' button from each project card
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 11:38:27 -04:00
Krao Hasanee 1b7c53b810 Add dedicated New Project page for clients
Route /new-project: name + company selector → creates project, redirects
to project detail. My Projects buttons now link there instead of new-request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 11:35:42 -04:00
Krao Hasanee 572c290f48 Rename client project buttons to '+ New Project'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 11:33:01 -04:00
Krao Hasanee 8f8b2090f6 Raise file upload limit to 50 MB
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>
2026-05-13 11:31:51 -04:00
Krao Hasanee 543983c914 Fix task delete cascade, multi-company UI, and error handling
- RequestDetail: remove auto-project-delete when last task deleted
- MyCompany: support multiple companies with selector dropdown
- MyCompany: fetch members from both profiles and company_members
- ProjectDetail/MyProjectDetail/InvoiceDetail: check Supabase errors before updating state
- Migration: drop client project-delete RLS policy (no longer valid)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 11:29:27 -04:00
Krao Hasanee d6e49a4c67 Add Stripe fee tracking on paid invoices + backfill function
- 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>
2026-04-14 12:16:22 -04:00
Krao Hasanee 906a0041a4 Add team-only user creation, remove public signup
- Add + New User form on Companies page (name, email, password, company)
- Create-user Supabase edge function with role verification
- Remove public signup route and login page link

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 09:27:19 -04:00
Krao Hasanee 5519c1f54b Surface actual error message when user creation fails
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 09:14:53 -04:00
Krao Hasanee 8034f15fb5 Full codebase cleanup and optimization pass
- Fix all hardcoded light colors breaking dark mode (FileAttachment, TaskDetail, RequestDetail)
- Parallelize sequential DB fetches in TaskDetail, CompanyDetail, MyProjects
- Add error handling: NewRequest project/file upload, MyCompany update, CompanyDetail prices, AuthContext profile fetch
- Fix currentUser.company_id → currentUser.company?.id in NewRequest
- Remove stale company.email references from InvoiceDetail, ProjectDetail, TaskDetail
- Clean up dead email field from Companies form reset

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 14:46:08 -04:00
Krao Hasanee 195c828f8b Improve auth performance: cache profile, remove double fetch, reduce timeout
- Seed currentUser from localStorage instantly on load (no loading flash)
- Remove getSession() duplicate — onAuthStateChange handles everything
- Fetch fresh profile in background while cached version shows immediately
- Reduce fallback timeout from 5s to 2s
- Explicit Supabase client auth options for reliability

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 10:41:42 -04:00
Krao Hasanee 41e4d58ab9 Fix invoice delete race condition by seeding detail page from navigation state
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 10:37:29 -04:00
Krao Hasanee bc6915a549 Fix invoice company dropdown by removing stale email column references
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 09:50:55 -04:00
Krao Hasanee 65b8b2ce2c Mark superseded request versions as completed on Requests page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:08:24 -04:00
Krao Hasanee 59c4ef6632 Remove Projects tab from company detail, fix pricing layout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:04:30 -04:00
Krao Hasanee 7000b5a840 Link project titles to detail page, add inline project name edit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:57:52 -04:00
Krao Hasanee 0371e3eba5 Newest version first in history, remove nav section labels
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:55:00 -04:00
Krao Hasanee 2c4f42ea55 Add client dashboard page, restore MyCompany to people+edit only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:52:52 -04:00
Krao Hasanee aeaf6558ac Fix dark mode light boxes, add client dashboard stats, reorder nav
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:47:06 -04:00
Krao Hasanee 71b34a4700 Fix send to client: use primary submission, add error handling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:41:15 -04:00
Krao Hasanee 33c2ad8460 Fix assign dropdown persistence, auto-assign on start
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:40:06 -04:00
Krao Hasanee d7948a9afe Replace filter dropdowns with toggle buttons on Requests page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:38:15 -04:00
Krao Hasanee 989ebcb024 Add company/user filters to Requests, move Companies to bottom of nav
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:36:11 -04:00
Krao Hasanee 684500b42e Nest amendments inside parent submission on Requests page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:31:52 -04:00
Krao Hasanee 342fa0805f Team task detail: group amendments in version history, fix dark mode backgrounds
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:24:31 -04:00
Krao Hasanee 92ab0601ae Group amendments inside their parent version box in timeline
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:18:28 -04:00
Krao Hasanee f4a1b7c25e Fix amendment: no version bump on edit, stays on current version
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:13:42 -04:00
Krao Hasanee 585cb154ba Amended request creates new submission entry with 'Amended Request' label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:09:23 -04:00
Krao Hasanee 1e1e29ad99 Add client company dashboard as landing page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:04:49 -04:00
Krao Hasanee 5782f42712 Fix profile query: select phone/address instead of email from companies
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 00:00:49 -04:00
Krao Hasanee e7174d392c Replace company email with address field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 23:59:21 -04:00
Krao Hasanee 8b5494a824 Fix login redirect: wait for currentUser before navigating
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 23:54:20 -04:00
Krao Hasanee d7f89ad0da Redirect to login with success message after signup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 23:50:23 -04:00
Krao Hasanee ee99465f8a Auto login after signup 2026-03-26 23:44:31 -04:00
Krao Hasanee 719209fa25 Refactor: clients → companies schema v2 2026-03-26 23:42:06 -04:00