Repository navigation
Check-in: "Update the BOM from the CAD file", ticked by default (#407) - #450
Merged
Merged
Conversation
A check-in can update the BOM of the revision from the CAD references of
the version being checked in, in the check-in's transaction:
- services/bom_references.rs: plan() split into plan_on() on one
connection (sees the references the check-in just stored; counts from
file_references.instances, no parsing under the lock); the add/update
loop shared by apply() and the new apply_on_checkin() (new children
added, CAD-counted quantities corrected, never an assumed 1, circular
refused, nothing removed; kept_not_in_cad / not_in_teamcraft reported;
audit bom.from_references with source checkin). SolidCraft designs
with placements count as structure files.
- services/files.rs: check_in_with() with CheckInOptions; check_in()
keeps its behaviour. uploads::finish passes the option on.
- API: multipart field bom_from_references on POST .../checkin, body
field on POST /uploads/{id}/finish (off by default), answer adds bom.
- Web: the box in the check-in form (assembly items or CAD structure),
the flash message says what changed.
- Desktop: the box in Check in... (js/checkin-bom.js), bomFromReferences
through workspace_checkin, the result line in the toast; never on Park.
- Tests: tests/checkin_bom.rs, unit tests, scripts/desktop-checkin-bom.test.mjs.
- Docs: guides (structure, desktop, vault), API reference, CHANGELOG,
README, desktop/README, OPEN_WORK.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings on PR #450: - file-status answers bom_structure (bom_references::has_structure: the structure rule on the stored reference counts, no parsing); the desktop shows *Update the BOM from the CAD file* for that flag, an assembly item, an assembly file or a SolidCraft design (.sc and .solidcraft) - no longer for every NX/Creo .prt or STEP export. - Web: the check-in box also uses has_structure; cad_structure counts STEP assemblies (Exchange) that lead to other items. - Check-in: items referenced only through components excluded from the BOM in the CAD file are no longer reported as "no longer in the CAD file" (Collected/Plan.excluded_items, unit tests). - plan(): the CAD files are parsed for their counts with no pooled connection held (load_files / compare_on split; the check-in keeps everything on its transaction). - Docs: structure.md, desktop.md, desktop/README, api.md, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sebagrei
marked this pull request as ready for review
November 22, 2026 20:51
…om-from-cad # Conflicts: # .github/workflows/desktop.yml # CHANGELOG.md # desktop/ui/js/workspace.js # docs/OPEN_WORK.md # docs/src/reference/api.md # src/api/mod.rs # src/services/checkouts.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A check-in can now update the BOM of the revision from the CAD references of the version being checked in – the box Update the BOM from the CAD file, ticked by default, in the web check-in form and the desktop app's Check in….
Closes #407
What changed
services/bom_references.rs:plan()is split intoplan_on()on one connection, so inside the check-in transaction it sees the references the check-in just stored. At check-in the instance counts come fromfile_references.instances(stored by the reference scan), so no file is parsed while the revision is locked. The add/update loop is shared byapply()and the newapply_on_checkin(): new children are added, CAD-counted quantities corrected (never from an assumed 1), circular children refused, nothing removed;kept_not_in_cadandnot_in_teamcraftare reported; onebom.from_referencesaudit entry with"source": "checkin"when a line changed. SolidCraft designs with placements now count as structure files (they were counted incadrefs::instance_countsbut filtered out byis_structure).services/files.rs:check_in_with(…, CheckInOptions)runs the BOM step afterstore_uploads, in the same transaction;check_in()keeps its behaviour.uploads::finishpasses the option on (never withoutcheck_in).bom_from_referencesonPOST …/checkin, body field onPOST /uploads/{id}/finish, both off by default; the answers addbom: {added, updated, kept_not_in_cad, not_in_teamcraft, refused}(nullwithout the field or without a structure file). Route help inapi/mod.rs.checkinDialog(shown when a revision file may be an assembly: assembly kinds,.prt,.stp/.step,.sc– pure rules injs/checkin-bom.js),bomFromReferencesthroughworkspace_checkin→ multipart field (never on Park), the summary in the result toast.guide/structure.md(new section, Inventor and SolidCraft as count sources),guide/desktop.md,guide/vault.md,reference/api.md,CHANGELOG.md,README.md,desktop/README.md,docs/OPEN_WORK.md.Tests
tests/checkin_bom.rs: new children added, a differing CAD count corrected, an unreferenced line kept and reported, a missing file reported, one audit entry (and none on a repeat); an assumed 1 never overwrites a line; a circular child refused; park and a refused check-in (409 base version) leave the BOM untouched and the lock in place; no structure file / unticked box →bomnull; the chunkedfinishpath; the web form shows the ticked box and its field updates the BOM.bom_references.rs(SolidCraft structure, stored counts, the summary line);scripts/desktop-checkin-bom.test.mjs(added to theuijob).Not compiled or run locally (no builds on this machine): only
cargo fmt --all(server and desktop) was run; Node.js is not installed here, so the JS was not syntax-checked either. CI verifies.Checklist
knowledge), or openly licensed material under a compatible licence
that is credited. It contains no code decompiled, disassembled or
rewritten from proprietary software and no leaked code
(CONTRIBUTING.md).
CHANGELOG.md,README.md,docs/src/**,docs/OPEN_WORK.mdwhere it applies).cargo fmt --all --check,cargo clippy --all-targets -- -D warningsand
cargo testpass locally, or CI runs them. (fmt passes; clippy and tests: CI)🤖 Generated with Claude Code