Skip to content

fix: keep adjustment cost entry continuous - #482

Merged
corrin merged 3 commits into
productionfrom
fix/KAN-295-adjustment-continuous-entry
Jul 20, 2026
Merged

fix: keep adjustment cost entry continuous#482
corrin merged 3 commits into
productionfrom
fix/KAN-295-adjustment-continuous-entry

Conversation

@corrin

@corrin corrin commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What changed

  • promotes a typed adjustment from the trailing phantom row into a local draft immediately
  • keeps a fresh blank row available for continuous entry in Estimate, Quote, and Actual
  • awaits parent persistence before removing the promoted draft
  • exercises adjustment creation through the authenticated UI path

Why

Typing an adjustment description inferred the correct kind but kept occupying the only blank row until every save-required field was complete. This interrupted continuous cost entry.

Impact

Users can begin another cost line as soon as they start an adjustment description. Backend APIs and schemas are unchanged.

Validation

  • focused SmartCostLinesTable unit tests: 3 files, 6 tests passed
  • targeted authenticated Estimate and Actual cost-entry E2E scenarios passed
  • repository commit hooks passed

Review note

Follow-up review should concentrate on in-flight edits, pending-draft lifecycle during refresh/failure, stable local row identity, and deletion of incomplete promoted drafts.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e236284e-342f-467a-858a-16deee1519bb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/KAN-295-adjustment-continuous-entry

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.

corrin and others added 2 commits July 20, 2026 20:23
The columns computed depended on negativeIdsSig, so an async negative-stock
refresh recreated every column def and cell renderer, destroying the active
editor mid-typing and truncating the description.

Negative-stock rendering stays reactive: isNegativeStock reads
props.negativeStockIds inside the cell render callback, so Vue tracks it there.

Also corrects two unit_cost clears from null to undefined to match the field
contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CkGKYWKV4dEbCR8a6zQf8s
@corrin
corrin marked this pull request as ready for review July 20, 2026 08:53
@corrin

corrin commented Jul 20, 2026

Copy link
Copy Markdown
Owner Author

Verified green — ready to merge

Head is now `5194fd19` (the four-line fix was uncommitted until now; the previous head `32d3e304` was the broken state).

Root cause: the `columns` computed in `SmartCostLinesTable.vue` depended on `negativeIdsSig`. An async negative-stock refresh recreated every column def and cell renderer, destroying the active editor mid-typing — the description got truncated.

E2E: job-cost-entry-data.spec.tsactual labour material adjustment and delete reconcile persisted costs1 passed (2.6m). This is the test that was red against 32d3e304 with the text truncated to E2E actua. Full teardown completed; DB restored and verified clean.

Audit of the fix:

  • Negative-stock rendering stays reactive — isNegativeStock reads props.negativeStockIds directly inside an h() cell render callback, so Vue tracks it at render time. The negativeIdsSig dep was only forcing the full column rebuild that killed the editor.
  • unit_cost: nullundefined is a genuine contract fix, not a type-error silencer: updateDraft merges via spread (so undefined clears the field) and requiredNumber() rejects both at save time.
  • vue-tsc --build --force passes; all pre-commit hooks green.

Deferred lifecycle improvements remain in KAN-296. Not merging without explicit instruction.

@corrin
corrin merged commit 39e33e8 into production Jul 20, 2026
2 checks passed
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