Skip to content

Copy and Cut buttons and menus put the text on the system clipboard (#431) - #463

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Zetenypapp:fix/copy-paste-431
Oct 14, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Zetenypapp:fix/copy-paste-431

Conversation

@Zetenypapp

Copy link
Copy Markdown
Contributor

Fixes #431, at least the part I could reproduce on Windows 11.

Upfront: this is my second contribution, and like the first (#349) it was written by Claude (Claude Code, Opus 5.5). I tested it myself in the app.

The bug

Ctrl+C and Ctrl+X work. But the ribbon's Copy and Cut buttons, the slide's right-click Copy/Cut, the menus and the command palette never put anything on the system clipboard, so whatever you copy with them can't be pasted into another program. To reproduce:

  1. In Notepad, copy hello.
  2. In DeckCraft, select some slide text and click the ribbon's Copy button.
  3. Paste in Notepad. You get hello, not the slide text.

Why

Ctrl+C runs edit.copy and hands the returned text to ctx.copy_text. Everything else runs the same command through SlideApp::run, which dropped the text.

The fix

SlideApp::run keeps the text of a successful edit.copy / edit.cut and hands it to the clipboard on the next frame, the same way pending_urls works. So every button, menu, the palette and the control channel behave like the keyboard. It's one small change in crates/ui-egui/src/lib.rs, plus a line in the ROADMAP.md progress log.

Testing

  • New test: copy_and_cut_commands_reach_the_system_clipboard runs Copy and Cut through SlideApp::run and checks the frame's CopyText output. It fails without the fix.
  • cargo xtask ci passes locally on Windows 11 (fmt, clippy, tests, assets, layers, wasm).
  • Manually in the release build: the clipboard went from hello to the slide text after the command path's Copy.
  • It merges cleanly with Ctrl+C then Ctrl+V pastes objects that carry no text (Fixes #182) #189 (pasting objects without text).

Not covered: the report also says Ctrl+C/V don't work at all for the reporter. On Windows 11 those work for me, so that part may be specific to their system (no OS or version was given).

🤖 Generated with Claude Code

…torytold#431)

Ctrl+C and Ctrl+X ran edit.copy / edit.cut and handed the returned text
to egui's clipboard; the ribbon's Copy and Cut, the slide's right-click
menu, the menus, the palette and the control channel ran the same
commands through SlideApp::run, which dropped the text, so it never left
DeckCraft. SlideApp::run now keeps the text of a successful Copy or Cut
and hands it to the clipboard on the next frame, like pending URLs.

Regression test: copy_and_cut_commands_reach_the_system_clipboard runs
both commands and checks the frame's CopyText output (it fails without
the fix).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 903cf09 into storytold:main Oct 14, 2026
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution, @Zetenypapp! It has landed on main and will ship in the next DeckCraft release.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft

@Zetenypapp
Zetenypapp deleted the fix/copy-paste-431 branch October 14, 2026 17:11
anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
…ting to the system region (storytold#463)

* Issue storytold#432: global Units preference (mm, cm, in, pt), defaulting to the system region

Preferences ▸ Documents and view ▸ Units sets the unit for page sizes
(Document Properties, Print), Header & Footer margins, the start of Set
Page Boxes and the Measure tool on pages without a viewport scale. On
first start it follows the system region: AppleMeasurementUnits on macOS,
Region ▸ Measurement system (iMeasure) on Windows, then LC_ALL /
LC_MEASUREMENT / LANG; inches for US, LR and MM, millimetres elsewhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Issue storytold#432: macOS falls back to AppleLocale when the measurement system was never set

AppleMeasurementUnits only exists in the global domain once someone changed
Measurement system in System Settings, and apps started from the Finder get no
LANG, so a German Mac with untouched settings landed on inches. The region of
AppleLocale (always present) decides next; AppleMeasurementUnits still wins.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01REz7wTfQgnopyvN9eQJJVu

* Issue storytold#432: Units labels in the Arabic and Italian catalogs new on main

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01REz7wTfQgnopyvN9eQJJVu

* Issue storytold#432: the Print dialog's PDF page size follows the Units preference

Main's new "PDF page: {w} × {h} in" label was always in inches. It now uses
the preferred unit like the sheet size next to it; each catalog keeps its
wording with the size in place of the inch values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tristan von Kries <tristan@MacBook-Pro-von-Tristan.local>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
….exe (storytold#1227)

The desktop app started `reg.exe query "HKCU\Control Panel\International" /v iMeasure` at every launch to pick the default Units (storytold#463). On managed PCs reg.exe is a process EDR and WDAC/AppLocker setups watch, and a Sandbox process-creation audit showed it as the one child process left at startup. Read the value in-process with winsafe's safe RegGetValue (advapi feature) instead. Behaviour is unchanged: "1" is inches, "0" is millimetres, anything missing or unreadable falls through to the locale check. The value-to-unit mapping is a pure function with a unit test, plus a Windows test that the registry read yields a known value.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

[DeckCraft] Copy and Paste does not work within or out of DeckCraft

3 participants