Part of #306. Batch 1 — every other workstream depends on this one.
Replace the Dioxus desktop shell with a gpui-kit application: boot, window,
Root wrapper, and the theme system including the System mode the kit does
not provide.
Owned files
src/app/root.rs (rewrite), src/app/window.rs (new)
src/theme/mod.rs (new), src/theme/persist.rs (new)
- Deletes:
src/components/** (13 dirs, 1 636 .rs + 2 440 .css),
assets/dx-components-theme.css
Do NOT write: Cargo.toml, src/lib.rs, any mod.rs, src/app/state.rs
(orchestrator-owned — report the lines you need instead).
Deliverables
- Boot —
gpui_kit::application().run(...) + gpui_kit::init(cx).
There is no Application::new(). Window sized to 75% of the current
monitor, centered, as today.
Root — mandatory top-level wrapper. Root::render does not mount
the dialog/sheet/notification layers; the root view must call
Root::render_dialog_layer, render_sheet_layer,
render_notification_layer itself.
Isolate these three calls in one small file — 0.7.0 removes them with no
documented replacement, and we want that migration to be a localised patch.
- Theme —
ThemePref { Light, Dark, System }. The kit's ThemeMode has
only Light | Dark and theme::init hard-sets Light; nothing observes
the OS. Wire it:
Theme::sync_system_appearance(Some(window), cx);
window.observe_window_appearance(|w, cx| Theme::sync_system_appearance(Some(w), cx)).detach();
After mutating Theme::global_mut, call Theme::sync_base(cx) — otherwise
the gpui-base layer (scrollbars, resize handles) keeps the old values.
- Persistence — the preference is stored next to the recents, i.e.
dirs::config_dir()/rustmotion/. Today the theme resets to System at
every launch; it must survive a restart. Follow the shape of
load_recents/push_recent in src/library/data.rs:233-266.
- Deletion — the whole
src/components/ tree. gpui-kit is used directly,
with no wrapper layer. All 6 live components have a kit equivalent.
Notes that will save you time
ActiveTheme must be imported from gpui_component, it is not re-exported
at the kit root. Then cx.theme().background etc.
- The token is
danger, not destructive, on ThemeColor.
- Map today's
--rm-* tokens (defined in src/app/root.rs:28-79) onto the
kit's semantic tokens. Note the current doc comment at line 25 contradicts
the CSS: .rm-system is in the dark rule and swaps to light under
prefers-color-scheme: light. The CSS is the behaviour to reproduce.
- Two
IconName enums exist. gpui_component::IconName (101 variants) is what
gpui_kit_assets::Assets actually embeds; using a gpui_kit_assets::IconName
variant (1830 Lucide) while registering only Assets silently fails to load.
Verify
CARGO_TARGET_DIR=/tmp/rm-ws1 rtk cargo build -p rustmotion-studio
CARGO_TARGET_DIR=/tmp/rm-ws1 rtk cargo test -p rustmotion-studio
CARGO_TARGET_DIR=/tmp/rm-ws1 rtk cargo clippy -p rustmotion-studio --all-targets -- -D warnings
Part of #306. Batch 1 — every other workstream depends on this one.
Replace the Dioxus desktop shell with a gpui-kit application: boot, window,
Rootwrapper, and the theme system including theSystemmode the kit doesnot provide.
Owned files
src/app/root.rs(rewrite),src/app/window.rs(new)src/theme/mod.rs(new),src/theme/persist.rs(new)src/components/**(13 dirs, 1 636 .rs + 2 440 .css),assets/dx-components-theme.cssDo NOT write:
Cargo.toml,src/lib.rs, anymod.rs,src/app/state.rs(orchestrator-owned — report the lines you need instead).
Deliverables
gpui_kit::application().run(...)+gpui_kit::init(cx).There is no
Application::new(). Window sized to 75% of the currentmonitor, centered, as today.
Root— mandatory top-level wrapper.Root::renderdoes not mountthe dialog/sheet/notification layers; the root view must call
Root::render_dialog_layer,render_sheet_layer,render_notification_layeritself.Isolate these three calls in one small file — 0.7.0 removes them with no
documented replacement, and we want that migration to be a localised patch.
ThemePref { Light, Dark, System }. The kit'sThemeModehasonly
Light | Darkandtheme::inithard-setsLight; nothing observesthe OS. Wire it:
Theme::global_mut, callTheme::sync_base(cx)— otherwisethe gpui-base layer (scrollbars, resize handles) keeps the old values.
dirs::config_dir()/rustmotion/. Today the theme resets toSystematevery launch; it must survive a restart. Follow the shape of
load_recents/push_recentinsrc/library/data.rs:233-266.src/components/tree. gpui-kit is used directly,with no wrapper layer. All 6 live components have a kit equivalent.
Notes that will save you time
ActiveThememust be imported fromgpui_component, it is not re-exportedat the kit root. Then
cx.theme().backgroundetc.danger, notdestructive, onThemeColor.--rm-*tokens (defined insrc/app/root.rs:28-79) onto thekit's semantic tokens. Note the current doc comment at line 25 contradicts
the CSS:
.rm-systemis in the dark rule and swaps to light underprefers-color-scheme: light. The CSS is the behaviour to reproduce.IconNameenums exist.gpui_component::IconName(101 variants) is whatgpui_kit_assets::Assetsactually embeds; using agpui_kit_assets::IconNamevariant (1830 Lucide) while registering only
Assetssilently fails to load.Verify