Skip to content

Theme: paste a theme into the Import tile (#8226) - #8227

Merged
bherbruck merged 3 commits into
tangency-labs:mainfrom
raykholo:theme-paste-8226
Oct 28, 2026
Merged

bherbruck merged 3 commits into
tangency-labs:mainfrom
raykholo:theme-paste-8226

Conversation

@raykholo

@raykholo raykholo commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #8226

The theme Import tile also takes a theme as text, with no new UI:

  • Ctrl+V (Cmd+V on a Mac) on Preferences › Interface imports a copied solidcraft-theme/1 file and turns it on, as Import… does with a file. It goes through the same theme_import checks, and an invalid theme reports why in the status bar. Text that isn't a theme keeps its usual meaning: the paste is only taken when it is a theme, so pasting copied components or into a text field works as before.
  • Right-clicking the tile offers Paste theme (desktop app), for anyone who doesn't know the shortcut.
  • A theme file dropped on the tile imports instead of opening as a design.
  • The tile's second line reads "file or paste", and its tooltip names all three.

The paste is caught before the global Copy/Paste shortcuts, so on the Interface page a copied theme never reaches the component paste.

0.25.0: "theme file" This PR: "file or paste" Ctrl+V with the Digital Rain theme copied
before tile after

The right-hand shot is a real Ctrl+V on an X display with the theme on the clipboard, in a release build of this branch.

Tests: a_theme_pasted_or_dropped_on_the_interface_page_imports_and_other_pastes_pass_through (prefs tests) covers a theme pasted on another page (ignored), plain text on the Interface page (ignored), a theme (imported and on), an invalid theme (refused), and a file dropped on the tile (imported, no design opened). The user guide's theme section describes paste and drop.

Changes a default: no

Ctrl/Cmd+V on Preferences > Interface imports a copied theme file, the tile's
menu offers Paste theme, and a theme file dropped on the tile imports instead
of opening as a design. Pasted text that is not a theme keeps its usual
meaning. The tile reads "file or paste".
@raykholo
raykholo marked this pull request as ready for review October 28, 2026 13:26
@bherbruck bherbruck added ready to merge reviewed, every ask addressed; merge once CI is green approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) and removed approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Oct 28, 2026
@bherbruck
bherbruck enabled auto-merge October 28, 2026 13:49
@bherbruck bherbruck added approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) and removed approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) labels Oct 28, 2026
auto-merge was automatically disabled October 28, 2026 15:09

Head branch was pushed to by a user without write access

@bherbruck
bherbruck added this pull request to the merge queue Oct 28, 2026
Merged via the queue into tangency-labs:main with commit b68d42e Oct 28, 2026
21 checks passed
@selun3

selun3 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

@raykholo, the theme-drop handler has a wasm build blocker that we encountered during the current X2 validation run for #8435:

error[E0599]: no method named `bytes` found for reference
`&std::sync::Arc<dyn DroppedFile + Send + Sync>` in the current scope
    --> crates/ui-egui/src/prefs.rs:2738:14
2738 |             .bytes()
     |              ^^^^^ method not found
error: could not compile `solidcraft-ui-egui` (lib)
(exit code: 101)

This is the observed failure of the 12-crate wasm stage. The 82-native-binary queue was still running at the captured snapshot; this is not a final overall CI result.

egui 0.36.2 exposes DroppedFile::bytes() only outside wasm, and bytes_async() on wasm. By source comparison, the same take_theme_drops function and egui lock are present at public refs 119c40c, fe3fb38, and checked main 9628e60. This comparison is static; we have not run an untouched baseline for this report. #8432 and #8522 also mention this blocker, rather than an implementation fixing it.

There is already an async read/completion path in apps/solidcraft-web/src/files.rs::take_drops. The web shell drains dropped files before the UI handler sees them, so a complete fix also needs to preserve theme-tile routing through that async path. A native-only guard would not establish browser theme-drop support.

Could you confirm whether a fix for the #8226/#8227 theme-drop path is already underway, or who should own the coordinated UI/web correction? We have not changed the handler or published a competing fix.

Owner follow-up

Thanks for the correction. We are tracking #8534 at ad21a49be327f226799970d6906c6f45d63a32e1, following your reply. At this check it remains open and unmerged. Our current validation keeps its frozen source and recorded wasm failure; the correction has not been applied or tested in that run. We will bind any later integration to the actual delivered source rather than duplicate the fix or transfer its result to our candidate.

Follow-up: original owner fix adopted in the Drawings WIP

We have now included the original three-file correction from #8534 in our Drawings/DXF draft #8515, with Ray credited. We checked it against the frozen source rather than adopting later main or a different fix. The earlier-source wasm failure remains preserved. Fresh validation on d8e7a869 has now completed the actual 12-crate wasm command successfully, with the original three-file correction included. Full repository CI is a separate pending gate; browser Theme-import acceptance has not been run. No further action is requested here.

@raykholo

Copy link
Copy Markdown
Contributor Author

Thanks for catching this. Fix in #8534: the desktop app reads the dropped file as before, and the web app now routes a drop on the Import tile through its async file path (a new Theme intent in files::take_drops), so a theme dropped in the browser imports instead of opening as a design.

ablasik pushed a commit to ablasik/solidcraft that referenced this pull request Oct 29, 2026
…ncy changes (tangency-labs#8652)

The wasm compile ran only by hand, so tangency-labs#8227 (a native-only DroppedFile::bytes() call in
crates/ui-egui) passed PR CI and the merge queue and broke the web build on main (tangency-labs#8534).
A merge group that touches the crates below the apps, the web app, the vendored crates, the
manifests, the toolchain or this workflow now runs `cargo xtask wasm`, and `ci` requires it.

Dependency advisories ran only nightly. A pull request or merge group that changes Cargo.lock
or a Cargo.toml now runs `cargo deny --locked check --warn unmaintained advisories`, and `ci`
requires it then. The nightly keeps the full advisories, bans and sources scan.

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

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Theme: paste a theme into the Import tile

3 participants