Skip to content

fix(work-item): separate work order and invoice actions, remove duplicate buttons - #44

Merged
Dev869 merged 1 commit into
mainfrom
fix/separate-workorder-invoice-actions
May 18, 2026
Merged

Dev869 merged 1 commit into
mainfrom
fix/separate-workorder-invoice-actions

Conversation

@Dev869

@Dev869 Dev869 commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

Surgical UI cleanup of web/src/routes/contractor/WorkItemDetail.tsx so WORK ORDER actions and INVOICE actions are clearly separated and de-duplicated. No data-model changes. Quotes route untouched.

What was duplicated / removed

  • Duplicate full-width "Send to Client →" button (mailto fallback): removed. The Email compose card already covers sending the work order. The now-dead handleSendToClient function and its now-unused httpsCallable / functions imports were also removed.
  • Duplicate "Approve & Generate PDF" button: it was rendered twice in the actions row (identical onClick, only layout classes differed). Removed the redundant one; it now appears exactly once.
  • Duplicate "Invoice Status Actions" block (Mark as Paid / Mark Overdue): removed. These transitions already exist in the Invoice Status card.

What was separated / relabeled

  • Invoice Tracking card header: "Invoice" → "Invoice Status" (status display only).
  • Email compose grid: now its own clearly-labeled "Email" section (Work Order composer + Invoice composer), separate from the Invoice Status card.
  • Remaining work-order-only actions (View PDF + Send Work Order to Client) grouped under a new visually-distinct "Work Order Actions" card placed after the Email compose grid.
  • Primary actions row relabeled "Primary Actions" (Discard | Save | Approve & Generate PDF once | Complete).

No restyling — only reorganization and de-duplication. All conditional/status gating logic and styling tokens preserved.

Test plan

  • cd web && npx tsc -b — exit 0
  • npx eslint src/routes/contractor/WorkItemDetail.tsx — clean (exit 0)
  • npx vitest run — 59/59 pass
  • Manual: verify no duplicate buttons; work-order vs invoice actions visually grouped across draft/sent/paid/overdue/approved/completed states

🤖 Generated with Claude Code

@Dev869
Dev869 merged commit 79299bf into main May 18, 2026
3 checks passed
@Dev869
Dev869 deleted the fix/separate-workorder-invoice-actions branch May 18, 2026 22:45
@github-actions

Copy link
Copy Markdown

🔥 Firebase Hosting preview: https://open-ten99--pr-44-cun1dh7p.web.app
(expires in 7 days)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant