Skip to content

fix: stop the Finish tab prescribing business process it invented (KAN-323) - #513

Merged
corrin merged 3 commits into
mainfrom
fix/KAN-323-finish-tab-copy
Aug 1, 2026
Merged

fix: stop the Finish tab prescribing business process it invented (KAN-323)#513
corrin merged 3 commits into
mainfrom
fix/KAN-323-finish-tab-copy

Conversation

@corrin

@corrin corrin commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Why

An audit of every user-facing string introduced in the latest production release (PR #512 vs PR #500) found the Finish Job workspace copy — written by the AI agent in 61fbc61d/1013c781 — asserting business processes KAN-323 never specified. Ticket-backed copy ("Recorded against the job. Never blocks invoicing.", the invoice-mode labels, the balance labels) is untouched; only the invented policy is corrected, per the office's actual rules.

What changed

All in JobFinishTab.vue (+ its checklist test):

  • Over-invoiced warning no longer prescribes "Resolve it with a credit note in Xero." A credit note is only one possible resolution — a stale job value after scope creep is another — so it now reads: "Job appears over-invoiced by $X (excl GST). The job value may be out of date, or invoicing may need correcting."
  • Load-error panel drops the invented staff instruction "Do not quote the customer a figure until it loads." (keeps "Reload the page.").
  • T&M nag paragraph ("…time and materials are what the customer pays. Get them right before invoicing.") deleted — the ticket explicitly says this area must never nag staff.
  • Timesheets checklist question ("Have you collected the timesheet entries?") now renders only on T&M jobs; a quoted job is never asked.
  • "Has the job been released?""Has the job been handed over?" — matches the field's meaning (collection, delivery, or on-site install). Column name and automation ids unchanged.

Blessed as-is after review: the five-item checklist itself (the ticket specified three), including "Have you called the customer?".

Tests

  • Checklist suite updated: five questions on T&M, four on fixed-price (timesheets absent); the two urgency-note tests removed with the paragraph.
  • vitest run src/components/job/__tests__ — 7 files, 33 tests, all passing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PnuHL7w3UisSk6KQ81q3Qf

Summary by CodeRabbit

  • Bug Fixes
    • Updated job completion guidance for financial load errors and over-invoicing.
    • Removed outdated urgency messaging from the Time & Materials checklist.
    • Adjusted checklist visibility so timesheet questions appear only for Time & Materials jobs.
    • Renamed the final checklist status from “released” to “handed over.”

An audit of user-facing strings in the last release found the Finish Job
copy asserting processes KAN-323 never specified. Corrections, per the
office's actual rules:

- Over-invoiced is a diagnostic, not advice: a credit note is only one
  possible resolution — the job value being out of date is another — so
  the warning now names the fact and both likely causes, prescribing
  neither.
- The load-error panel no longer instructs staff not to quote the
  customer; the T&M "get them right before invoicing" paragraph is
  deleted outright (the ticket forbids the checklist area nagging staff).
- Timesheets only exist to invoice on a T&M job, so a quoted job is no
  longer asked "Have you collected the timesheet entries?".
- "Has the job been released?" becomes "Has the job been handed over?",
  matching the field's meaning (collection, delivery, or on-site install).

KAN-323

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PnuHL7w3UisSk6KQ81q3Qf
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@corrin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6db09200-078d-497d-ab5a-81118ec7785c

📥 Commits

Reviewing files that changed from the base of the PR and between dc8a04f and 312c74f.

📒 Files selected for processing (1)
  • frontend/src/components/job/JobFinishTab.vue
📝 Walkthrough

Walkthrough

The job finish tab updates financial and completion guidance. Its checklist now shows the timesheet question only for Time & Materials jobs and uses “handed over” for the final item. Tests verify both checklist variants.

Changes

Job finish checklist updates

Layer / File(s) Summary
Checklist guidance and validation
frontend/src/components/job/JobFinishTab.vue, frontend/src/components/job/__tests__/JobFinishTab.checklist.test.ts
The tab simplifies load-error and over-invoicing guidance, removes the Time & Materials urgency note, conditionally displays the timesheet question, and renames the final checklist item. Tests cover Time & Materials and fixed-price jobs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing unsupported business-process guidance from the Finish tab.
Description check ✅ Passed The description explains the rationale, lists the changes, includes KAN-323, and reports tests; it omits the template checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/KAN-323-finish-tab-copy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
frontend/src/components/job/JobFinishTab.vue (1)

379-383: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use an explicit else branch for the checklist filter.

This is a non-trivial conditional. Replace the ternary with an if/else block. This makes the two checklist variants easier to audit.

Proposed refactor
-const checklistItems = computed(() =>
-  props.pricingMethodology === 'time_materials'
-    ? allChecklistItems
-    : allChecklistItems.filter((item) => item.key !== 'timesheets_collected'),
-)
+const checklistItems = computed(() => {
+  if (props.pricingMethodology === 'time_materials') {
+    return allChecklistItems
+  } else {
+    return allChecklistItems.filter((item) => item.key !== 'timesheets_collected')
+  }
+})

As per coding guidelines, use explicit else branches for non-trivial conditionals.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/components/job/JobFinishTab.vue` around lines 379 - 383, Update
the checklistItems computed property to replace the ternary conditional with an
explicit if/else branch: return allChecklistItems for the time_materials pricing
method and the filtered list otherwise, preserving the existing filtering
behavior.

Source: Coding guidelines

frontend/src/components/job/__tests__/JobFinishTab.checklist.test.ts (1)

63-79: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the complete checklist contract.

The tests verify that expected keys exist, but they do not verify the total number of rendered items. An extra item would pass both tests. Add count assertions for five T&M items and four fixed-price items. Also assert the new “handed over” label.

Proposed test additions
     const wrapper = mountTab('time_materials')
     await flushPromises()

+    expect(
+      wrapper.findAll('[data-automation-id^="JobFinishTab-checklist-"]'),
+    ).toHaveLength(5)
+    expect(wrapper.text()).toContain('Has the job been handed over?')
+
     for (const key of ITEMS) {
       expect(item(wrapper, key).exists(), key).toBe(true)
     }

     const wrapper = mountTab('fixed_price')
     await flushPromises()

+    expect(
+      wrapper.findAll('[data-automation-id^="JobFinishTab-checklist-"]'),
+    ).toHaveLength(4)
+
     expect(item(wrapper, 'timesheets_collected').exists()).toBe(false)

As per coding guidelines, tests must verify enduring behavior or invariants by executing code and asserting observable outcomes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/components/job/__tests__/JobFinishTab.checklist.test.ts` around
lines 63 - 79, Add assertions in the T&M and fixed-price cases of the checklist
test to verify exactly five and four rendered items respectively, preventing
unexpected extras. Also assert the expected “handed over” checklist label using
the existing item lookup or rendered text assertion.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@frontend/src/components/job/__tests__/JobFinishTab.checklist.test.ts`:
- Around line 63-79: Add assertions in the T&M and fixed-price cases of the
checklist test to verify exactly five and four rendered items respectively,
preventing unexpected extras. Also assert the expected “handed over” checklist
label using the existing item lookup or rendered text assertion.

In `@frontend/src/components/job/JobFinishTab.vue`:
- Around line 379-383: Update the checklistItems computed property to replace
the ternary conditional with an explicit if/else branch: return
allChecklistItems for the time_materials pricing method and the filtered list
otherwise, preserving the existing filtering behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 70a5f1e7-a34c-4410-84e7-d6e1fcc10ebb

📥 Commits

Reviewing files that changed from the base of the PR and between 2ebb8ef and dc8a04f.

📒 Files selected for processing (2)
  • frontend/src/components/job/JobFinishTab.vue
  • frontend/src/components/job/__tests__/JobFinishTab.checklist.test.ts

corrin and others added 2 commits August 1, 2026 22:15
True, but not something the office needs telling; the behaviour is
pinned by a test, not by copy. The subtitle keeps "Recorded against
the job." so staff know ticks persist.

KAN-323

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PnuHL7w3UisSk6KQ81q3Qf
- "Self-checklist." replaces "Recorded against the job." — every field
  is recorded against the job, so that said nothing.
- Supervisor, not foreman — the term the workshop actually uses. The
  foreman_signed_off column keeps its name; only the label changes.
- "today's timesheet entries" — says which timesheets are meant.
- The materials question now asks what the check actually is: the
  workshop forgetting to write materials used on the job sheet, or
  writing them wrongly — not a vague "checked the materials".

KAN-323

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PnuHL7w3UisSk6KQ81q3Qf
@corrin
corrin merged commit 6e1371c into main Aug 1, 2026
9 checks passed
@corrin
corrin deleted the fix/KAN-323-finish-tab-copy branch August 1, 2026 10:25
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