Skip to content

Keep undone text words undone in the tablet inspector - #178

Merged
bpacholek merged 1 commit into
mainfrom
text-inspector-follows-undo
Nov 1, 2026
Merged

bpacholek merged 1 commit into
mainfrom
text-inspector-follows-undo

Conversation

@bpacholek

Copy link
Copy Markdown
Contributor

Found while making the demo video in the tablet editor.

Problem

  1. Type new words into a title in the tablet Text inspector.
  2. Press Undo. The preview shows the old words, but the inspector field still shows the typed ones.
  3. Select something else. The inspector writes its draft back, and the title has the typed words again, so the undo is lost.

Change

rememberWords (in TextPanels.kt) now owns the draft:

  • Typed words are committed 0.6 s after typing stops, as before, and when the selection moves on.
  • Words that change from outside (undo, redo) replace the draft, so they are not written back over.

Tests

  • New TextPanelsTest.undoneWordsStayUndone: type, commit, undo, deselect. Without the fix it fails with expected:<Clipra> but was:<Clipra demo>.
  • :feature:text:testDebugUnitTest, :app:compileDebugKotlin and spotlessCheck pass.

🤖 Generated with Claude Code

The tablet Text inspector kept its own draft of the selected clip's words
and wrote it back when the selection moved on. After Undo restored a
title's words, the inspector still showed the typed ones, and leaving the
clip put them back, so the undo was lost.

The draft now takes words that change from outside (undo, redo) and only
commits what was typed. rememberWords holds that logic and has a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bpacholek
bpacholek merged commit 644dbe2 into main Nov 1, 2026
1 check 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.

1 participant