Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
d9e78e5
Decouple style engine
dzhou121 Apr 16, 2026
ef197a3
Scaffold floem-style crate and move selectors/unit/responsive into it
dzhou121 Apr 16, 2026
7522c8b
Type-erase StylePropInfo debug_view so props.rs no longer depends on …
dzhou121 Apr 16, 2026
cc5db70
Move InteractionState and InheritedInteractionCx into floem-style
dzhou121 Apr 16, 2026
a00ebcf
Promote ElementId to floem-style with ElementIdExt for owning_id()
dzhou121 Apr 16, 2026
7461ff1
Move StylePropValue trait and external-type impls into floem-style
dzhou121 Apr 16, 2026
872035f
Move props/transition/easing types and ObjectFit/Position/StrokeWrap …
dzhou121 Apr 16, 2026
661adda
Move recalc and Visibility into floem-style
dzhou121 Apr 17, 2026
77acfe3
Move recalc and Visibility into floem-style
dzhou121 Apr 17, 2026
0436064
Introduce InspectorRender trait to decouple PropDebugView from floem …
dzhou121 Apr 17, 2026
b5b8674
Move PropDebugView trait and external-type impls into floem-style
dzhou121 Apr 17, 2026
35c45b6
Thread &dyn InspectorRender through StylePropInfo::debug_view
dzhou121 Apr 17, 2026
3940435
Move Border/Padding/Margin/BoxShadow/DesignSystem types and extend In…
dzhou121 Apr 17, 2026
f66cabb
Extract Style::debug_view into StyleDebugViewExt trait
dzhou121 Apr 17, 2026
0a3c753
Move ContextValue/StyleMapValue/StyleValue into floem-style
dzhou121 Apr 17, 2026
035c85c
Move merge_id machinery and selector key functions into floem-style
dzhou121 Apr 17, 2026
2b04201
Move style_class! macro to floem-style
dzhou121 Apr 17, 2026
1073644
Add Style::resolve_context inherent method and retarget prop! macro
dzhou121 Apr 17, 2026
ab7e53c
Move PointerEvents/TextOverflow/CursorStyle/Focus enums into floem-style
dzhou121 Apr 17, 2026
3b693c4
Move Style/BuiltinStyle/cascade/built-in props into floem-style
dzhou121 Apr 17, 2026
d7bc64b
Move to_taffy_style and font_size_cx into floem-style as Style inhere…
dzhou121 Apr 17, 2026
6017da7
Move cache.rs into floem-style and inline cache helpers as Style inhe…
dzhou121 Apr 17, 2026
5a4649d
Move StyleSink trait to floem-style and retarget signatures to ElementId
dzhou121 Apr 17, 2026
f83ea73
Add standalone cascade tests to floem-style
dzhou121 Apr 17, 2026
e27d22c
Add standalone transition tests to floem-style
dzhou121 Apr 17, 2026
a3233f1
Add StyleCustomExt to prelude so examples can use .custom_style_class()
dzhou121 Apr 17, 2026
338415a
Update stale doc comments to reflect completed Style/macros moves
dzhou121 Apr 17, 2026
c764d10
Move Style::apply and context-value tests from floem into floem-style
dzhou121 Apr 17, 2026
4515c53
Add external integration test exercising floem-style via its public API
dzhou121 Apr 17, 2026
7c6d113
Fix clippy warnings and broken doctests in floem-style
dzhou121 Apr 17, 2026
df4e324
Remove dead ContextValueExt trait; callers can use Style::resolve_con…
dzhou121 Apr 17, 2026
ff4348e
Fix stale doc comments referencing removed ContextValueExt and Style …
dzhou121 Apr 17, 2026
f4b775e
Inline debug_view re-export shim into style/mod.rs
dzhou121 Apr 17, 2026
d12b0cc
Drop dead hash_* re-exports and route StylePropValue re-export direct…
dzhou121 Apr 17, 2026
aa4c4b4
Move StylePropReader and ExtractorField into floem-style
dzhou121 Apr 17, 2026
91f3c1e
Make value_impls module pub(crate); AffineLerp still reachable at root
dzhou121 Apr 17, 2026
232a940
Narrow style_macros module to pub(crate)
dzhou121 Apr 17, 2026
e37452c
Rename src/style/values.rs to debug_view_impl.rs to match its content
dzhou121 Apr 17, 2026
06246f6
Make StyleCx::window_state generic via &mut dyn StyleSink
dzhou121 Apr 17, 2026
eea3af2
Add mock_sink integration test demonstrating non-floem StyleSink usage
dzhou121 Apr 17, 2026
9c4ea91
Add StyleTree with host-agnostic cascade over its own parent/child edges
dzhou121 Apr 17, 2026
3f9bfbe
Wire StyleTree lifecycle into WindowState; allocate/free companion no…
dzhou121 Apr 17, 2026
b4c1df5
Mirror view direct style and class list into StyleTree each pass
dzhou121 Apr 17, 2026
cddd209
Drive StyleTree::compute_style on every style pass (outputs not yet c…
dzhou121 Apr 17, 2026
6b4b226
Flip floem's cascade to read from StyleTree; delete compute_combined
dzhou121 Apr 17, 2026
fb59b39
Re-enable style cache through StyleTree::compute_style
dzhou121 Apr 17, 2026
048854a
Extract style-cascade three-pass loop into WindowState::run_style_cas…
dzhou121 Apr 17, 2026
635b14e
Propagate full post-cascade interaction cx to children, not combined-…
dzhou121 Apr 17, 2026
5f39b9b
Surface tree-internal child-dirty propagation through StyleSink
dzhou121 Apr 17, 2026
80eeb2d
Update stale comments referring to the removed compute_combined method
dzhou121 Apr 17, 2026
b1cd024
Remove redundant combined_pre_animation_style field from StyleStorage
dzhou121 Apr 17, 2026
1aba279
Drop Phase 5 duplicate cascade; copy computed_style from tree
dzhou121 Apr 17, 2026
bbb077c
Drop dead write to post_compute_combined_interaction in apply_animations
dzhou121 Apr 17, 2026
10963c4
Move apply_animations into the tree cascade
dzhou121 Apr 17, 2026
f7cebdd
Move fixed-element registration into the tree cascade
dzhou121 Apr 17, 2026
93b58c8
Ignore .claude/ directory and drop scheduled_tasks.lock that slipped …
dzhou121 Apr 17, 2026
84e48d9
Move hidden/selected/disabled diff into tree; drop redundant interact…
dzhou121 Apr 17, 2026
102b352
Emit update_selector_interest from the tree cascade
dzhou121 Apr 17, 2026
9506ee5
Drop duplicate inspector capture from style_view
dzhou121 Apr 17, 2026
19a4c59
Move cursor-change detection into run_style_cascade Pass 3
dzhou121 Apr 17, 2026
1e7b78b
Populate StyleCx's cascade snapshot in new() instead of in Phase 5
dzhou121 Apr 17, 2026
78df746
Declare taffy as a first-class dep of floem-style
dzhou121 Apr 17, 2026
67dcb7a
Drop floem_reactive dependency from floem-style
dzhou121 Apr 17, 2026
33e6e42
Drop floem_renderer dep from floem-style; flip layering
dzhou121 Apr 18, 2026
3d7709a
Document StyleTree::compute_style contract and tidy crate-level doc
dzhou121 Apr 18, 2026
00c8f74
Relocate prop_extractor! to floem-style via narrow PropExtractorCx trait
dzhou121 Apr 18, 2026
0483588
Move LayoutProps / TransformProps / ViewStyleProps into floem-style
dzhou121 Apr 18, 2026
8223c35
Add host_integration test: end-to-end non-floem consumer walk-through
dzhou121 Apr 18, 2026
4e7b449
Move FontProps extractor into floem-style
dzhou121 Apr 18, 2026
66a0f4f
Drop StyleSelectorKey and StylePropReader accidental abstractions
dzhou121 Apr 18, 2026
becdc37
Fold StyleCache into StyleTree
dzhou121 Apr 18, 2026
0e08b5a
Fold selector-interest registry + descendant walks into StyleTree
dzhou121 Apr 19, 2026
702009a
Fold engine-originated next-frame schedule into StyleTree
dzhou121 Apr 19, 2026
293b03f
Move animation engine into floem-style
dzhou121 Apr 19, 2026
a156835
Add tree-native animation registry to StyleTree
dzhou121 Apr 19, 2026
4582a39
Drop four host-only methods from StyleSink
dzhou121 Apr 19, 2026
8abf7a0
Fold fixed-element registry into StyleTree
dzhou121 Apr 19, 2026
b460792
Fold the last three engine-emitted writes into StyleTree
dzhou121 Apr 19, 2026
a69879d
Engine uses StyleNodeId as its identity; hosts keep a reverse map
dzhou121 Apr 20, 2026
6afb236
Replace StyleSink with CascadeInputs + AnimationBackend
dzhou121 Apr 20, 2026
a17c44c
Rename floem-style/ to style/ and finish StyleNodeId migration
dzhou121 Apr 20, 2026
71cc462
Add multi-frame host-driver integration test
dzhou121 Apr 20, 2026
40f264b
Shrink PropExtractorCx; transitions reported as data
dzhou121 Apr 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/worktrees/agent-a7ed3fe3
Submodule agent-a7ed3fe3 added at ab7e53
1 change: 1 addition & 0 deletions .claude/worktrees/agent-a869dcda
Submodule agent-a869dcda added at 3b693c
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.lapce
/.idea
/.zed
/.claude
.DS_Store
rustc-ice*
*.orig
Expand Down
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"tiny_skia",
"reactive",
"editor-core",
"style",
"examples/*",
"ui-events-winit",
"test",
Expand All @@ -21,6 +22,7 @@ default-members = [
"tiny_skia",
"reactive",
"editor-core",
"style",
"ui-events-winit",
"test",
]
Expand Down Expand Up @@ -96,6 +98,7 @@ floem_vello_renderer = { path = "vello", version = "0.2.0", optional = true }
floem_vger_renderer = { path = "vger", version = "0.2.0", optional = true }
floem_tiny_skia_renderer = { path = "tiny_skia", version = "0.2.0" }
floem_reactive = { path = "reactive", version = "0.2.0" }
floem_style = { path = "style", version = "0.2.0" }
floem-editor-core = { path = "editor-core", version = "0.2.0", optional = true }
copypasta = { version = "0.10", default-features = false, features = [
"wayland",
Expand Down Expand Up @@ -185,7 +188,7 @@ image-webp = ["image/webp"]
tokio = ["dep:tokio"]
# rfd (file dialog) async runtime
crossbeam = ["dep:crossbeam", "floem_renderer/crossbeam"]
localization = ["dep:fluent-bundle", "dep:unic-langid", "dep:sys-locale", "dep:ouroboros"]
localization = ["dep:fluent-bundle", "dep:unic-langid", "dep:sys-locale", "dep:ouroboros", "floem_style/localization"]

[dev-dependencies]
criterion = { version = "0.8.1", features = ["html_reports"] }
Expand Down
1 change: 1 addition & 0 deletions editor-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ serde = { workspace = true, optional = true }
strum = { workspace = true }
strum_macros = { workspace = true }
ui-events.workspace = true
floem_style = { path = "../style", version = "0.2.0" }

lapce-xi-rope = { workspace = true }

Expand Down
11 changes: 11 additions & 0 deletions editor-core/src/indent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ impl std::fmt::Display for IndentStyle {
}
}

impl floem_style::StylePropValue for IndentStyle {}

impl floem_style::PropDebugView for IndentStyle {
fn debug_view(
&self,
r: &dyn floem_style::InspectorRender,
) -> Option<Box<dyn std::any::Any>> {
Some(r.text(&self.to_string()))
}
}

impl IndentStyle {
pub const LONGEST_INDENT: &'static str = " "; // 8 spaces
pub const DEFAULT_INDENT: IndentStyle = IndentStyle::Spaces(4);
Expand Down
1 change: 1 addition & 0 deletions renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ winit = { workspace = true }
wgpu = { workspace = true }
crossbeam = { version = "0.8", optional = true }
futures = "0.3.32"
floem_style = { path = "../style", version = "0.2.0" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = { version = "0.4" }
Expand Down
47 changes: 1 addition & 46 deletions renderer/src/text/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,52 +106,7 @@ impl FamilyOwned {
}
}

/// Specifies how line height is computed for text layout.
///
/// # Example
///
/// ```
/// use floem_renderer::text::{Attrs, LineHeightValue};
///
/// // 1.5x the font size (e.g. 24px for a 16px font).
/// let attrs = Attrs::new().line_height(LineHeightValue::Normal(1.5));
///
/// // Fixed 20-point line height regardless of font size.
/// let attrs = Attrs::new().line_height(LineHeightValue::Pt(20.0));
/// ```
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum LineHeightValue {
/// A multiplier of the font size (e.g. `1.0` means line height equals font size).
Normal(f32),
/// An absolute line height in points.
Pt(f32),
}
impl LineHeightValue {
pub fn resolve(&self, font_size: f32) -> f32 {
match self {
LineHeightValue::Pt(value) => *value,
LineHeightValue::Normal(multiplier) => font_size * multiplier,
}
}
}

impl From<f32> for LineHeightValue {
fn from(value: f32) -> Self {
LineHeightValue::Normal(value)
}
}

impl From<f64> for LineHeightValue {
fn from(value: f64) -> Self {
LineHeightValue::Normal(value as f32)
}
}

impl From<i32> for LineHeightValue {
fn from(value: i32) -> Self {
LineHeightValue::Normal(value as f32)
}
}
pub use floem_style::LineHeightValue;

/// Text styling attributes used to configure font properties, color, and layout.
///
Expand Down
Loading
Loading