Repository navigation
Drawing sheets: a balloon on a linked design's parts list shows no number, not this design's (#3874) - #17733
Merged
Conversation
… numbered from this design (tangency-labs#3874) A balloon reads its number from the parts list it goes by. That list documents one of the drawing's sources, and Session::drawn is the one place that says which design a source means. The balloon read path skipped it and listed this design, so a list of a linked design (made by hand or by an older file) gave this design's numbers with no warning. - doc: balloon_rows is a free function that takes each source's design from the caller (Design): asked once per source, one tree per source. A list whose design can't be read reads RowRead::Unread, with why. - engine: Session::source_design gives drawn in doc's shape; drawing.balloon.inspect and the sheet use it. row_status says "unread"; the sheet and inspect say why, in one wording (row_why). - drawing.inspect and drawing.check count a list's balloons only when its source means this design, so a linked list is never counted against this design's rows. 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.
Requested by Cam
A balloon on a drawing sheet shows the item number of the part it points at, read from a parts list. This PR makes sure that number always comes from the design the parts list documents, never from another design by mistake.
Part of #3874. Follow-up to #16842 (balloons on the sheet).
The problem
Session::drawnis the one place that says which design a source means. A linked design (another file) can't be read yet (Drawing W11, W12, W15: where drawings are saved, their records and their commands #3890), sodrawnrefuses it.drawn. A balloon did not: it always listed the design the drawing is in. So a balloon on a list of a linked design showed this design's number, with no warning.drawnexists to answer once.What changes
balloon_rowsis now a free function. The caller gives the design for each source (Design: the design and its model, or why it can't be read). Each source is asked once, with one tree per source. A list whose design can't be read givesRowRead::Unread, with the reason.Session::source_designreturnsdrawn's answer in that shape.drawing.balloon.inspectand the sheet both use it.row_statuscan now beunread.drawing.inspectanddrawing.checkcount a list's balloons only when its source means this design. A list of a linked design showsballooned: nulland gets no "not ballooned" findings. Before, it was counted against this design's rows.Nothing changes for any list a command can make: those all document the design the drawing is in. So there is nothing new to see in the app, and no picture.
Tests
a_balloon_on_a_list_of_a_linked_design_is_never_numbered. It was written first and failed before the fix. It checks inspect (unread, no item, a warning that names the linked design), the sheet's reason, anddrawing.inspect's count.a_list_whose_design_cant_be_read_numbers_none: two lists of two sources. Each source is asked once. The list that can't be read numbers none of its balloons, and the other list still reads its own design.unreadreported asnot_found, the sheet reading this design, and the count taking any list.For later
drawnanswer with a linked design, balloons follow with no change. The inspect/check count then needs a tree per design. Until then it refuses rather than miscounts.Changes a default: no