Repository navigation
Split DiagramCanvasView into view, drop zones and renderer - #18
Merged
Merged
Conversation
- DiagramCanvasView.swift: inputs, state, layout and body, clipboard. - DiagramCanvasDropZones.swift: drop bands, tap insert targets and applying drops. - DiagramCanvasRenderer.swift: Canvas drawing of cells, lines and text. The two new files are extensions of DiagramCanvasView, so members they share lose their `private`. Code is moved unchanged otherwise. No behavior change intended. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ
Carries the VoiceOver block labels from main into DiagramCanvasDropZones.swift. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ
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 Holger · project thread
Before:
Canvas/DiagramCanvasView.swiftwas one file of about 1260 lines with layout, drag and drop, and drawing.After: it is three files of about 340, 450 and 490 lines:
DiagramCanvasView.swift(inputs, state, layout, clipboard),DiagramCanvasDropZones.swift(drop bands, tap insert targets, applying drops) andDiagramCanvasRenderer.swift(drawing). The canvas should look and behave exactly as before.How: the code is moved unchanged into two extensions of
DiagramCanvasView. Members that the files share loseprivate, since Swift'sprivatedoes not reach across files. Separate types for the renderer and the drop zones would need many more parameters and were not worth the risk here. Step 7, the last step of the plan; stacked on #17.Check on Mac and iPad: drawing of all element types, selection highlight in edit and simulation mode, drag from the palette onto before/after/replace bands and the strip above the first element, moving elements by drag, tap insert on iPhone, copy/cut/paste from the context menu.
Generated by Claude Code