From 8be56bbe2ffecbb3b1756371c09d2253b51a8635 Mon Sep 17 00:00:00 2001 From: Suradet Pratomsak Date: Sat, 15 Aug 2026 09:23:48 +0700 Subject: [PATCH 1/3] refactor(app): group sidebar controls into labeled sections Restructure the controls sidebar into five labeled groups (Code, Appearance, Canvas, Frame, Export) with a section-header component. Move the split-screen toggle next to the code textarea it controls, and introduce a reusable Toggle switch component. --- crates/app/src/controls.rs | 673 ++++++++++++++++++++++--------------- 1 file changed, 403 insertions(+), 270 deletions(-) diff --git a/crates/app/src/controls.rs b/crates/app/src/controls.rs index 2a0675f..06e5ed0 100644 --- a/crates/app/src/controls.rs +++ b/crates/app/src/controls.rs @@ -1,5 +1,5 @@ -//! Sidebar with every user control: code input, language/theme/font pickers, -//! sliders, scale selector, toggles, and background swatches. +//! Sidebar with every user control, grouped into labeled sections: code, +//! appearance, canvas geometry, frame toggles, and export settings. use codeframe_models::{Background, FontChoice, Language, ThemeChoice}; use leptos::prelude::*; @@ -30,6 +30,17 @@ fn background_css(background: &Background) -> String { } } +/// Sidebar section header: small lucide icon + uppercase title. +#[component] +fn SectionHeader(title: &'static str, children: Children) -> impl IntoView { + view! { +
+ +

{title}

+
+ } +} + /// A ` +