Skip to content

Extract PaletteActionList and SimulationDetailView from ContentView - #15

Merged
code4teaching merged 19 commits into
simulation-controllerfrom
palette-view
Oct 19, 2026
Merged

code4teaching merged 19 commits into
simulation-controllerfrom
palette-view

Conversation

@code4teaching

Copy link
Copy Markdown
Owner

Requested by Holger · project thread

Before: the palette list with its action buttons (about 200 lines) and the simulation layout lived inside ContentView.

After: they are their own views, Palette/PaletteActionList.swift and Simulation/SimulationDetailView.swift. The screens should look and behave exactly as before.

How: PaletteActionList gets the simulation flag, whether the selection can be deleted, the code generator access, and one closure per action. The action logic itself (start/stop simulation, open the code generator) stays in ContentView as toggleSimulationMode and openCodeGenerator. SimulationDetailView takes the SimulationController and the read-only canvas as a view builder. First part of step 5 of the plan; stacked on #14.

Check on Mac, iPad and iPhone: palette insert by tap and by drag (drag preview), delete button disabled when nothing deletable is selected, simulation toggle, generate code (and the lock when locked), share PNG/document, PDF, About; simulation layout side by side on a wide window and stacked on a narrow one.


Generated by Claude Code

- Palette/PaletteActionList.swift: palette rows, drag preview and the
  action buttons below; actions come in as closures.
- Simulation/SimulationDetailView.swift: canvas plus state panel layout
  for simulation mode, driven by SimulationController.
- ContentView keeps the action logic (toggleSimulationMode,
  openCodeGenerator) and the simulation canvas.

No behavior change intended.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ
@code4teaching code4teaching self-assigned this Oct 18, 2026
- VisuStructCore: VisuStructDocumentEditing.multiwayAncestorPath and
  caseIndex(of:inMultiwayAt:), with tests.
- Inspector/InspectorElementHints.swift: line editor placeholder and
  condition hint line per element type.
- Remove the unused statementIOModeIfApplicable().

No behavior change intended.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ
claude and others added 17 commits October 18, 2026 22:26
The four export actions in ContentView each rendered the diagram and
mapped errors themselves. Export/DiagramExporter.swift now does that;
ContentView only stores the share payloads it returns.

No behavior change intended.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cp4EQgFQyGbM8MVLiWbJKQ
- 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 portrait simulation layout from main into
SimulationDetailView.swift.

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
# Conflicts:
#	VisuStruct-iOS/VisuStructXcodeOpen/VisuStruct/ContentView.swift
Split DiagramCanvasView into view, drop zones and renderer
Bundle PNG, file, PDF and print export in DiagramExporter
Move inspector hints and Fallauswahl path helpers out of ContentView
@code4teaching
code4teaching merged commit 251cb84 into simulation-controller Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants