Repository navigation
Add SheetPrototype and SheetBorderPrototype elements (BisCore 01.00.27) - #9823
tigistmebrate11 wants to merge 21 commits into
Conversation
|
This pull request is now in conflicts. Could you fix it @tigistmebrate11? 🙏 |
There was a problem hiding this comment.
Thank you for contributing sheet prototype support!
Reviewed assuming the BisCore 01.00.27 schema changes are available in native. I found two functional integration gaps and one API-tag inconsistency, detailed inline.
Validation: all 10 new tests passed in an adapted runtime harness using the PR's Element/NavigationRelationship handlers and BisCore 01.00.27 imported into installed native 5.16.3. Additional assertion-based checks reproduced the relationship and definition-cleanup findings. This was not a full Rush build/lint run or validation of the eventual native package.
|
Queue requested — the merge queue status continues in this comment ↓. |
🛑 Queue command cancelledTick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
🟡 Changes recommended
Relationship assertions fail on valid insertions due to incorrect separators, and the purge recheck can leave unreferenced GeometryParts incorrectly reported as in use.
2 open issues
What changed in this PR
Adds BisCore 01.00.27 sheet prototypes to the common and backend APIs, supporting reusable sheet layouts and border definitions.
Changes:
- Adds prototype elements, props, navigation relationships, and creation helpers; deprecates legacy sheet templates.
- Extends definition cleanup and adds tests for schema compatibility, references, sub-model restrictions, and deletion.
- Updates API reports, export summaries, documentation, and package change entries.
| File | Description |
|---|---|
| docs/changehistory/NextVersion.md | Announces sheet prototypes and schema requirements. |
| docs/bis/domains/drawings-sheets.md | Explains prototype modeling and relationships. |
| core/common/src/ElementProps.ts | Adds prototype props and deprecates legacy template props. |
| core/backend/src/test/element/SheetPrototype.test.ts | Tests creation, references, restrictions, and cleanup. |
| core/backend/src/NavigationRelationship.ts | Adds four prototype relationship helpers. |
| core/backend/src/Element.ts | Implements prototype elements and sheet references. |
| core/backend/src/EditTxn.ts | Extends usage rechecks during definition cleanup. |
| common/changes/@itwin/core-common/tm-sheet-prototype_2026-10-15-12-00-00.json | Records common API additions. |
| common/changes/@itwin/core-backend/tm-sheet-prototype_2026-10-15-12-00-00.json | Records backend prototype support. |
| common/api/summary/core-common.exports.csv | Updates common export classifications. |
| common/api/summary/core-backend.exports.csv | Updates backend export classifications. |
| common/api/core-common.api.md | Records common API additions and deprecations. |
| common/api/core-backend.api.md | Records backend API additions and deprecations. |
Review effort: Balanced
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review. Note You can configure setup steps for Copilot code review separately from Copilot cloud agent with a |
markschlosseratbentley
left a comment
There was a problem hiding this comment.
My feedback right now aligns with Copilot's review.
…he colon separator' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
🛑 The queue request has been cancelled: new commits were pushedDetails@tigistmebrate11 pushed to this pull request after |
aruniverse
left a comment
There was a problem hiding this comment.
Thank you for the updates! The specialized modeling relationships and the common property's beta tag are now corrected. The original cleanup finding is only partially fixed: native usage detection and the used-ID filtering now protect the definition elements, but tree cleanup can still delete their sub-models and graphics. I am following up in the original thread on that remaining data-loss case.
Two additional issues are detailed inline below. Validation against the PR's native 5.16.33 (BisCore 01.00.27): the latest SheetPrototype suite has 10 passing and 4 failing tests in a runtime harness using the PR sources. The existing DeleteDefinitionElements / should delete if not used regression passed, and additional assertions reproduced the loss of content from retained definitions. Full Rush build/lint and the complete backend suite were not run.
|
|
||
| /** Properties of a [SheetBorderTemplate]($backend) | ||
| * @beta | ||
| * @deprecated in 5.15 - might be removed in next major version. Use [SheetBorderPrototypeProps]($common) instead. |
There was a problem hiding this comment.
| * @deprecated in 5.15 - might be removed in next major version. Use [SheetBorderPrototypeProps]($common) instead. | |
| * @deprecated in 5.15 use [SheetBorderPrototypeProps]($common) instead. |
We have a linter that will publish the "might be removed in next major". This applies to all repeats
| }); | ||
| } | ||
| for (const id of subModeledIds) { | ||
| const result = this.deleteElements([id]); |
There was a problem hiding this comment.
[P2] Evaluate mutually referencing template-model roots as one deletion set
Calling deleteElements([id]) separately for each root treats references from another requested sub-model as external references. If the sub-models reference each other, both calls report a constraint violation, both roots enter usedIdSet, and the loop returns without deleting anything.
I reproduced this at dd044e98 against native 5.16.35 with two otherwise-unused SheetPrototypes whose graphics use each other's IDs as their code scopes. There are no references outside the requested pair:
deleteDefinitionElements([a, b])retains both prototypes and reports both as used.deleteElements([a, b])succeeds when given the same roots together.
Impact: This can leave unused template models, definitions, and graphics behind after the requested cleanup. We will still want to clean up these leftover template models rather than silently treating them as genuinely in use.
Please evaluate dependent model roots together in the bulk-delete operation, distinguish references within the requested set from genuinely external references, and add a cross-model regression test.
| @@ -1579,13 +1581,15 @@ export class SheetBorderTemplate extends Document { | |||
|
|
|||
| /** The template for a [[Sheet]] | |||
| * @public @preview | |||
There was a problem hiding this comment.
Might want to remove the preview from the deprecated functions
| protected override collectReferenceIds(referenceIds: EntityReferenceSet): void { | ||
| super.collectReferenceIds(referenceIds); | ||
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||
| if (undefined !== this.sheetTemplate) |
There was a problem hiding this comment.
Should these be one or the other? Is there a risk when both are passed in? (same question for the constructor)
| }); | ||
|
|
||
| const used = withEditTxn(db, (txn) => txn.deleteDefinitionElements([ids.protoA, ids.protoB, protoC])); | ||
| expect([...used]).to.deep.equal([protoC]); |
| }); | ||
|
|
||
| const used = withEditTxn(db, (txn) => txn.deleteDefinitionElements([protoId])); | ||
| expect([...used]).to.deep.equal([protoId]); |


Description
Purpose
Changes