Tighten API naming, close NodeRole enum gap, protect newNodeId#3
Open
Tighten API naming, close NodeRole enum gap, protect newNodeId#3
Conversation
- Rename getNodeId/getPortIndex to connectionNodeId/connectionPortIndex to clarify these extract fields from a ConnectionId, not from a node. - Close the NodeRole enum gap (7→9) by renumbering OutPortCount=8, Widget=9, ValidationState=10, ProcessingStatus=11. - Move newNodeId() from public to protected on AbstractGraphModel; only subclasses and internal library friends need to mint node IDs. - Fix docs table formatting: move note block after the complete table so Caption/CaptionVisible rows render correctly. https://claude.ai/code/session_01BSbxaZ4ghZbro1BibMXJBY
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.
Summary
Addresses the last 3 remaining API issues from the thorough code review, plus a docs formatting bug:
getNodeId/getPortIndex→connectionNodeId/connectionPortIndex— the old names read as "get a node's ID" when they actually extract a field from aConnectionIdfor a given port side. The new names make the intent clear.NodeRoleenum gap —OutPortCountwas 9 (skipping 8), causing all subsequent values to be non-sequential. Renumbered toOutPortCount=8, Widget=9, ValidationState=10, ProcessingStatus=11.newNodeId()from public to protected onAbstractGraphModel— this is a side-effectful ID generator that only subclasses and internal library code should call. External code should useaddNode()instead. Internal callers (BasicGraphicsScene,PasteCommand) are added as friends.graph-models.rst— a.. note::block was inserted mid-table, breaking theCaptionandCaptionVisiblerows. Moved the note after the complete table.Test plan
TestConnectionId,TestAbstractGraphModel,TestDataFlow, etc.)https://claude.ai/code/session_01BSbxaZ4ghZbro1BibMXJBY