Skip to content

fix: SG-44534: Fix missing text caret on push events - #1416

Open
eloisebrosseau wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
eloisebrosseau:fix-annotation-text-caret
Open

eloisebrosseau wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
eloisebrosseau:fix-annotation-text-caret

Conversation

@eloisebrosseau

@eloisebrosseau eloisebrosseau commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

fix: SG-44534: Fix missing text caret on push events

Summarize your change.

Add the "|" placeholder on on_push() events that are triggered when clicking on the viewport through _ensure_text_node(). Note that some other changes were needed to make sure undo-redo was properly updated with that new behaviour to avoid registering the text caret as a real annotation:

  • _ensure_text_node() is now only responsible for creating a text node, and _register_text_undo() is responsible for updating the undo stack when a new text annotation is registered. This also fixed another issue where every text node was pushed onto the undo stack twice.
  • _frame_order_and_undo() was split into _add_to_order() and _register_undo_entry() to avoid counting a click without typing as an annotation.
  • _cancel_text was updated to fix an issue where clicking on the Escape key after typing would leave a stale undo entry that could be displayed again by clicking on undo, followed by redo.
  • Add commit_text_if_active() to clear_frame() and clear_all_frames() to ensure any in-progress text annotation is committed or canceled before the frame is cleared, and avoid a desync between the node state and the undo stack.

Describe the reason for the change.

When clicking on a frame with the text tool selected from the new annotation panel, no "|" placeholder was added to confirm that text would start being displayed at that position once the user would start to type.

Describe what you have tested and on which operating system.

Adding text annotations was tested on macOS.

@eloisebrosseau eloisebrosseau changed the title fix: SG-44534: Add text caret on push event fix: SG-44534: Add text caret on push events Sep 16, 2026
@eloisebrosseau eloisebrosseau changed the title fix: SG-44534: Add text caret on push events fix: SG-44534: Fix missing text caret on push events Sep 16, 2026
Signed-off-by: Éloïse Brosseau <eloise.brosseau@autodesk.com>
@eloisebrosseau
eloisebrosseau force-pushed the fix-annotation-text-caret branch from 2454553 to 93a1abb Compare September 16, 2026 19:25
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