Commit Graph

64 Commits

Author SHA1 Message Date
Krao Hasanee ff159c5937 Move multi-role pages out of team/ to pages/ root
CompanyDetail (team+client), BrandBook, SurveyMaker, Converters (team+external)
all serve more than one role — belong at pages/ not pages/team/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 22:14:49 -04:00
Krao Hasanee 66baa2869e Move FileSharing from team/ to pages/ — serves all 3 roles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 22:13:11 -04:00
Krao Hasanee b9a4c4a353 Merge all role-dispatcher pages into single files; add FileBrowser with file-type icons
- 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>
2026-05-19 22:11:34 -04:00
Krao Hasanee f9e66dfced Rename Jobs to Tasks, add Project Files section header on project detail 2026-05-14 19:46:17 -04:00
Krao Hasanee 6e7e7d7130 Include paid sub invoices in expenses/profit/year totals 2026-05-14 19:40:50 -04:00
Krao Hasanee 6b5f5df547 Add sub invoice detail page with delete/mark paid/receipt; fix payable stat 2026-05-14 19:35:44 -04:00
Krao Hasanee 13bb0f7914 Apply pill shape (border-radius 20px) to all buttons and sidebar nav items 2026-05-14 15:48:23 -04:00
Krao Hasanee 53b591697a Apply pill tab style across all portal pages (team, client, external) 2026-05-14 15:26:48 -04:00
Krao Hasanee 4980ebb09a Add client filter tabs to team Projects page 2026-05-14 15:23:39 -04:00
Krao Hasanee b2f165a8f1 Add Projects page for team members with search, nav under Requests 2026-05-14 15:21:25 -04:00
Krao Hasanee c32f9d1366 Add Project Files section and show company name for external users on project detail 2026-05-14 15:01:32 -04:00
Krao Hasanee eee0885811 Fix file sharing load speed and move error; misc updates
- 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>
2026-05-13 14:20:38 -04:00
Krao Hasanee c9e7816e28 Fix Create Folder button not submitting form
LoadingButton defaults to type='button'. Added type='submit'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:12:28 -04:00
Krao Hasanee dd7bfd2338 Fix 'column task.deadline does not exist' on subcontractor requests
deadline is on submissions, not tasks. Removed from select and fallback.
Due date now sourced from PO only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:11:42 -04:00
Krao Hasanee e5a5529e21 Move New Folder inline next to Sync Folders button
Clicking '+ New Folder' expands an inline input in the action bar.
Removed the separate form below the toolbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:08:46 -04:00
Krao Hasanee a89f91c8d1 Fix MyRequests slow load and stuck spinner
- Parallelize tasks + submissions + invoices + invoice_items (4 serial → 1 parallel batch)
- Wrap with withTimeout (10s/12s) so hung queries don't freeze indefinitely
- Add try/catch + finally to guarantee setLoading(false) on any failure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 13:02:14 -04:00
Krao Hasanee 03fbed8ccc Fix task row title color + add submitted date
- Title forced to --text-primary (was inheriting link color)
- Submitted date prepended before 'Submitted by' using task.submitted_at

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:52:58 -04:00
Krao Hasanee c7485257f6 Requests page: remove project header meta, make rows clickable
- Removed started date and status badge from project group header
- Task rows are now full-width Links; removed Details button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:31:33 -04:00
Krao Hasanee be975f74f5 Add company tabs to client dashboard
Tabs appear below stats. All four stat cards + both task columns filter
to the selected company. Stats recompute client-side from fetched data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:26:55 -04:00
Krao Hasanee 6379dc9d82 Move company tabs below stats on invoices page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 12:25:04 -04:00
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