Repository navigation
Drawings: a parts list's rows are read as the table on the sheet will show them - #12839
Merged
Merged
Conversation
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>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
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::rowsgives 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 ondrawings, 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:bom::item_text), so a balloon and its row can't disagree;purchased);counthas the total;MassFormat::text).cell::MISSING, which is nothing), never "0".bom::Row.assemblysays that the row's part places others.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:
rowsruns 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 ondrawings594945b, 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 checkandcargo clippy -- -D warnings: clean. On f1153f4:cargo check --all-targetsof geom, doc and engine clean, and the docbomandtabletests pass.table17 of 17, docbomandtable54 of 54, enginebom,drawing_tableanddrawing_balloon90 of 90.crates/doc/src/drawing/table_tests.rs:a_rows_values_read_as_a_list_shows_them,a_lists_rows_lay_out_in_a_tableanda_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.What the tests don't reach:
format_numberreturns 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
drawingsf1153f4, checked 2026-11-07 02:31 UTC. No other open PR intodrawingschangesbom.rs,drawing/table.rsorcrates/geom/src/table.rs.