Skip to content

Drawings: a parts list's rows are read as the table on the sheet will show them - #12839

Merged
bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:parts-list-rows-3874
Nov 7, 2026
Merged

bherbruck merged 1 commit into
tangency-labs:drawingsfrom
CamWight:parts-list-rows-3874

Conversation

@CamWight

@CamWight CamWight commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Change

A parts list on a drawing sheet is a table of the design's bill of materials: one row for each part, with its item number, part number, description, quantity and mass. Before this PR, the list knew its rows but not the text each cell shows. Now PartsList::rows gives each row as a table row with its values formatted, each one followed by the rows listed under it. The table that draws these rows on the sheet comes in a later PR.

Part of #3874, into drawings. One commit on drawings, not stacked.

Changes a default: no
Nothing on screen changes yet: no code draws these rows, and nothing new is saved.

What it does

  • PartsList::rows(list, units) (crates/doc/src/drawing/table.rs) gives each row's cells:
    • the item number, by the same rule a balloon reads (bom::item_text), so a balloon and its row can't disagree;
    • the part number, names, description, revision, materials and count;
    • whether the part is bought in, from its BOM type (purchased);
    • the quantity as how many there are in one of the row's parent; count has the total;
    • a length in the drawing's units, and a mass in the list's unit and decimals (MassFormat::text).
  • A value a row hasn't got, such as a mass not weighed or an unknown quantity, is left out. Its cell then shows the missing value (cell::MISSING, which is nothing), never "0".
  • Free properties go in first, so none of them takes the place of a value.
  • bom::Row.assembly says that the row's part places others.
  • A row's key names each member from the outermost in. So one part listed under two parents keeps two keys and two rows.
  • In crates/geom/src/table.rs, a row key may now be 2048 bytes, which fits the 65 members of the deepest list. Field keys stay at 256 bytes.

Cost: rows runs once for each list when it is drawn, over the rows the list already gathers. Each row copies its properties and joins its names and materials once, with no lookups.

Validation

Local, Windows, --profile ci. The run was on drawings 594945b, then the commit was replayed onto f1153f4 (the same patch; #10431, merged since, touches none of these files) and checked again there:

  • cargo fmt: no diffs; cargo check and cargo clippy -- -D warnings: clean. On f1153f4: cargo check --all-targets of geom, doc and engine clean, and the doc bom and table tests pass.
  • Tests: geom table 17 of 17, doc bom and table 54 of 54, engine bom, drawing_table and drawing_balloon 90 of 90.
  • New tests:
    • crates/doc/src/drawing/table_tests.rs: a_rows_values_read_as_a_list_shows_them, a_lists_rows_lay_out_in_a_table and a_row_at_the_deepest_level_keeps_its_key (64 levels, each member's name at its longest);
    • crates/doc/src/bom_tests.rs: which rows are assemblies;
    • crates/geom/src/table_tests.rs: a 2048-byte key passes and a 2049-byte key is refused.
  • Planted faults: 9 of 9 caught, each by one of these tests, then a clean run that passed. The faults:
    • the key without its parents;
    • no row is an assembly;
    • the quantity as the total;
    • a length always in mm;
    • a missing mass read as 0;
    • kg read as grams;
    • lb read as grams;
    • nothing purchased;
    • the old key limit.

What the tests don't reach:

  • a parts list drawn on a sheet (the next PR draws these rows);
  • a mass that isn't a finite number reads as no value (format_number returns an error), so its cell shows nothing; no test plants one.

Screenshots of the behavior

None. No code draws these rows yet, so nothing changes on screen.

Integration status

On drawings f1153f4, checked 2026-11-07 02:31 UTC. No other open PR into drawings changes bom.rs, drawing/table.rs or crates/geom/src/table.rs.

PartsList::rows gives each row of a bill of materials with its values formatted, each followed by the
rows listed under it. The item comes from the rule a balloon reads, so the two can't disagree. A mass
follows the list's unit and decimals and a length the drawing's units; a value a row hasn't got is left
out, for the table to mark. A nested row's quantity is how many are in one of its parent, and `count`
has them all.

A row's key names each member, so one part listed in two places keeps two keys, and the limit is now
2048 bytes to fit the 65 members of the deepest list. The plan's "item with its padding" has nothing to
do: no padding exists. The text measure goes with its first caller, the sheet's tables (P8b).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

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

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot added area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES kernel-paused labels Nov 7, 2026
@bherbruck
bherbruck merged commit d506dd6 into tangency-labs:drawings Nov 7, 2026
46 of 47 checks passed
@CamWight
CamWight deleted the parts-list-rows-3874 branch November 7, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants