Implement the GUI Style tab (Pico CSS theme editor) #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The
stylesingleton tab is specified inspecs/editor_settings.allium(lines 251–325,StyleViewSurface) andspecs/tabs.allium("style: Pico CSS theme editor"), and bDS2 implements it (../bDS2/lib/bds/desktop/shell_live/settings_editor/style_editor.ex). In RuDS the tab exists but renders a bare placeholder:crates/bds-ui/src/views/workspace.rsmapsTabType::StyletoContentRoute::Placeholder. There is currently no way to change the projectpicoThemefrom any surface. This editor is GUI-only — the TUI must not get one (see the companion issue that removes the TUI Style section).The backend already exists:
/__style-previewincrates/bds-core/src/engine/preview.rs(acceptsthemeandmodequery params, covered by tests).supported_pico_themesperspecs/metadata.allium(20 named themes).picoThemeinmeta/project.jsonviaengine::meta(read_project_json/ project metadata update; seeengine_side_effects.alliumUpdateProjectMetadataSideEffects).picoThemefor the status-bar badge (crates/bds-ui/src/app.rs, searchtheme_badge).settings.nav.style) already opens the Style tab (crates/bds-ui/src/views/sidebar.rs).Task
Implement the Style view per
StyleViewSurface:crates/bds-ui/src/views/style_view.rsrendering:-→ space, first letter capitalized. Selected theme visually highlighted.http://127.0.0.1:4123/__style-preview?theme=<sel>&mode=<mode>using the existing embedded webview component (crates/bds-ui/src/components/webview.rs), updating on selection or preview-mode change.@guarantee PreviewModeLocal).picoThemeintometa/project.jsonthrough the shared project-metadata engine path (must emit the normal project metadata domain event), then refresh the status-bar theme badge.TabType::Styleto the new view inworkspace.rs; removeContentRoute::Placeholderif the style tab was its last user (it is — delete the variant andwelcome::tab_placeholderif now unused).@guarantee SeparateTab).../bDS2/lib/bds/desktop/shell_live/settings_editor/style_editor.ex.locales/ui/*.ftlfiles (en, de, es, fr, it). No untranslated string constants.meta/project.jsonand in the metadata written to the filesystem.Definition of done
picoThemeand updates the badge.cargo test --workspacepasses; no clippy warnings.Implemented in
fe7dd82. Added the real GUI-only Style singleton tab with all 20 supported themes, distinct swatches derived from the bundled Pico CSS, localized Auto/Light/Dark controls, a visibly disabled unchanged Apply action, and an independently managed embedded Wry preview. The preview now selects /assets/pico.THEME.min.css, uses data-theme only for the Light/Dark color scheme, removes forced mode for Auto, serves bundled preview assets when older projects lack theme files, and applies persisted themes to rendered pages. Apply writes picoTheme through the shared project-metadata engine, emits the normal Project Updated event, and refreshes the status badge; placeholder routing was removed and all five locales plus README were updated. Verified with focused red/green state, persistence, filesystem, renderer, preview-server, theme-validation, routing, disabled-style, and i18n tests; cargo test --workspace; cargo clippy --workspace --all-targets -- -D warnings; cargo build --workspace; cargo machete; cargo outdated; Allium check/analyse; release packaging; and visual Light/Dark/Auto plus theme switching in the packaged app. A neutral review against the issue, bDS2 preview override behavior, the Allium contracts, and the UI style guide found no remaining gaps. The swatches intentionally improve on bDS2s identical placeholder triplets by showing the actual bundled Pico theme accents, as confirmed during visual QA.