Repository navigation
Conversation
Show a preview line from the last point to the mouse position, finish drawing with a right click in addition to Enter and only finish if enough points have been added (two for lines, three for areas). Areas are closed before they are saved. Key presses are only evaluated while an editor is active and only on key down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Highlight the knob under the mouse, select knobs by click or drag, move and place them. Add hotkeys to insert a knob at the mouse position between the closest knobs (+), delete the selected knob while keeping the minimum number of knobs (Delete/Backspace) and shift the selected knob in the order of knobs (arrow left/right). Enter or a right click saves, Escape deselects the knob or cancels editing. The geometry logic lives in UI independent functions in section_geometry.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Draw area sections closed and semi-transparently filled, show section names passed as text, draw flows as arrows that respect the given arrow style and ignore canvas input while an action is running unless the editor was started by this action. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Key presses are ignored while a button has the focus. Starting an editor via the section buttons kept the focus on the button, so hotkeys only worked after clicking into the canvas. Release the focus when an editor starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
briemla
enabled auto-merge
October 15, 2026 07:25
This branch has not been deployed
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.
OP#10515
Problem
The section editor of the WebUI canvas (
canvas_form.py) could do much less than the editor of the customtkinter GUI (line_section.py:SectionBuilder,SectionGeometryEditor,SectionPainter,ArrowPainter):Arearejects.text) andarrow_stylewere ignored, flows had no arrow head, anddisable()/enable()did nothing.cancel_action().Solution
Split into commits A (drawing), B (editing) and C (presentation), plus two small follow-ups:
SectionBuilder.update):mousemoveon the interactive image.CanvasKeys.MESSAGE_NOT_ENOUGH_POINTS).SectionGeometryEditor.update):+inserts a knob at the mouse position into the closest segment. On a line, a point beyond either end extends the line at that end.Delete/Backspacedeletes the selected knob but keeps at least 2 knobs for lines and 3 for areas.HotKeysof theResourceManager.section_geometry.py.SectionPainter/ArrowPainter):svg/polygon.py).svg/text.py).arrow_style(newsvg/arrow.py).disable()makes the canvas ignore input while an action runs. An editor started by that action enables the canvas again, because the viewmodel disables the canvas right before it starts the editor.The customtkinter GUI, the ViewModel and the
UiFactoryare unchanged.Notes:
textorarrow_styletoday (in the customtkinter GUI either). The WebUI now draws them when they are passed, but the visible result does not change yet.+affordance on segment midpoints (docs/plans/2026-03-02-insert-intermediate-section-point*.md) is not part of this PR. Inserting uses the+hotkey like the customtkinter GUI.Tests
tests/unit/OTAnalytics/plugin_ui/nicegui_gui/pages/canvas_and_files_form/(test_canvas_form.py, newtest_section_geometry.py)tests/unit/OTAnalytics/plugin_ui/nicegui_gui/nicegui/svg/(newtest_polygon.py,test_text.py,test_arrow.py)tests/unit/OTAnalytics/plugin_ui,tests/unit/OTAnalytics/applicationandtests/unit/OTAnalytics/adapter_ui: 848 passed, 5 skipped.tests/acceptance/test_sections_and_flows.pypass (3 tests there were already skipped):TestSectionEditorOnCanvas::test_draw_line_section_with_preview_and_right_clickTestSectionEditorOnCanvas::test_insert_and_delete_knob_of_sectiontest_create_sections_two_timespre-commit(flake8, black, isort, mypy) passes on the changed files.pre-commit run --all-filesalso reports failures that come from the local environment and not from this change (end-of-file in a test data file,update-mypy-dependencies, ShellCheck about a missing.venv). Those hook changes were not committed.🤖 Generated with Claude Code