Skip to content

refactor: split config.rs into config/ by domain (plan step 9, 0.91.0) - #16

Merged
Fi3w0 merged 19 commits into
masterfrom
refactor/config-split
Oct 28, 2026
Merged

Fi3w0 merged 19 commits into
masterfrom
refactor/config-split

Conversation

@Fi3w0

@Fi3w0 Fi3w0 commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Plan step 9, the last step of the architecture refactor. The 14,441-line src/tide_core/config.rs becomes src/tide_core/config/, one file per domain, using the layout Fiw approved: each file holds a domain's config types, their Default/impls, and the apply_*/lower_* functions that fill them, so one config key lives in one file. Version 0.91.0.

File Contents Lines
mod.rs Config, RawConfig, lower_entries, top-level assign/block dispatch, re-exports 1,598
animation.rs window/workspace animations, transitions, cascade liquid, ripple 1,796
spatial.rs engines, Ocean, Scroll, swim, compass, minimap, snap, depth, physics 1,741
decoration.rs frost, shadow, rounding, border, popup, glass, caustics 1,285
rules.rs window, layer and workspace rules 1,047
actions.rs Action, keybinds and their parsers 752
devices.rs input, outputs, GPU, switch events 701
shaders.rs shader definitions 422
files.rs watcher, config paths, raw load 285
defaults.rs default Wave text 249
values.rs shared scalar parsers 207
diff.rs ConfigDiff 179
tests.rs the config tests, moved verbatim 4,271

How it was done

  • 491bd32 renames config.rs to config/mod.rs with no content change; 45b4fae moves the tests body verbatim (rustfmt re-indent and two dropped trailing commas).
  • One commit per domain, each moving whole top-level items plus their impl blocks. Where rustfmt had to rewrap a line afterwards, that's a separate style: commit.
  • Visibility: only pub(super), and only where the compiler shows a use from mod.rs, a sibling domain, or the tests. Each commit message lists them. Test-only uses are imported under #[cfg(test)].
  • Caller paths are unchanged: config/mod.rs re-exports by explicit name, so no file outside config/ changes.
  • No accessors, renames, new keys, or behavior changes.

Verification

  • Whole-split identity vs 491bd32: all 273 item blocks present; 270 byte-identical apart from added pub(super), 3 differ only by rustfmt rewrapping. Tests identical ignoring whitespace.
  • Every move commit: 712 tests and strict Clippy (all and default features). Every style: commit also passes fmt. All-feature release build.
  • Nested matrix with subscribers: 61 observations, 0 differences vs 0.90.211; subscriber checks pass in Classic, Scroll and Ocean.
  • Native 0.91.0: tidectl doctor 10/10, startup probe with user state unchanged, and 12 WM + 4 client fullscreen round trips across Scroll→Classic→Scroll with state restored.

Fi3w0 added 19 commits October 28, 2026 21:23
Plan step 9, approved by Fiw: pure rename so the config split can add
domain files beside it. No content change.
Plan step 9, as approved: the 4,279-line `mod tests` body moves verbatim
to its own file, declared as `#[cfg(test)] mod tests;`. rustfmt
re-indented the code one level (string literal contents untouched) and
dropped two trailing commas on lines that now fit; nothing else changed.

712 tests and strict Clippy pass.
Plan step 9: DEFAULT_CONFIG_WAVE and DEFAULT_KEYBINDS_WAVE move verbatim.
Visibility: both gain pub(super) so mod.rs keeps using them.
Identity check: every item block byte-identical apart from that prefix.

712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 9: 5 items and 1 impl blocks move verbatim:
ConfigDiff, diff_entries, collect_assigns, collect_binds, collect_blocks.
impl blocks for: ConfigDiff.

Visibility: no changes.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
…les.rs

Plan step 9: 15 items and 1 impl blocks move verbatim:
RawConfigLoad, ConfigWatcher, absolute_watch_path, expanded_watch_paths, nearest_existing_directory, watch_directories, event_affects_paths, spawn_watcher, load_raw_config, load_raw_config_in, CONFIG_PATH_OVERRIDE, set_config_path_override, config_path, private_temp_config_path, ensure_private_owned_dir.
impl blocks for: ConfigWatcher.

Visibility: config_path, ensure_private_owned_dir, event_affects_paths, load_raw_config, load_raw_config_in, watch_directories gain pub(super) so config/mod.rs and its other domain files keep using them.
Imported for tests only (#[cfg(test)]): ensure_private_owned_dir, event_affects_paths, watch_directories.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 9: 16 items and 0 impl blocks move verbatim:
parse_list_value, parse_duration_ms, parse_duration_ms_including_zero, list_items, parse_u32_list, parse_duration_list, parse_bool, decode_hex_rgb, parse_rgba_color, decode_hex_rgba, parse_f32_clamped, validate_env_entry, set_bool, set_opt_bool, set_i32, set_f64.

Visibility: decode_hex_rgb, list_items, parse_bool, parse_duration_list, parse_duration_ms, parse_duration_ms_including_zero, parse_f32_clamped, parse_list_value, parse_rgba_color, parse_u32_list, set_bool, set_f64, set_i32, set_opt_bool gain pub(super) so config/mod.rs and its other domain files keep using them.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 9: 16 items and 2 impl blocks move verbatim:
Keybind, Mods, Direction, WorkspaceRef, LayoutSwitch, ColumnAction, Action, is_depth_action, depth_action_enabled, is_ocean_action, parse_keybind, parse_modifiers, parse_simple_chord, is_typing_key, parse_action, parse_workspace_ref.
impl blocks for: Keybind, Mods.

Visibility: depth_action_enabled, is_depth_action, parse_keybind, parse_modifiers, parse_simple_chord gain pub(super) so config/mod.rs and its other domain files keep using them.
Imported for tests only (#[cfg(test)]): is_depth_action.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 9: 9 items and 2 impl blocks move verbatim:
ShaderAssignment, ShaderStage, ShaderDefinition, apply_shaders_block, lower_shader_block, parse_shader_definition, expand_shader_sources, parse_shader_stage, parse_shader_param.
impl blocks for: ShaderAssignment, ShaderDefinition.

Visibility: apply_shaders_block, lower_shader_block gain pub(super) so config/mod.rs and its other domain files keep using them.
Members called from mod.rs gain pub(super): `fn parse(value: &str) -> Option<Self>`.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
…evices.rs

Plan step 9: 27 items and 10 impl blocks move verbatim:
AdaptiveSync, InputConfig, InputDeviceConfig, TouchpadConfig, XwaylandConfig, OutputConfig, OutputTransformConfig, GpuSelector, GpuVendor, GpuConfig, GpuConfigRaw, parse_gpu_selector, SwitchEventsConfig, SwitchEventsRaw, parse_mode_str, apply_gpu_block, apply_input_block, lower_input_device_block, parse_calibration_matrix, apply_touchpad_block, set_gesture_fingers, apply_xwayland_block, apply_switch_events_block, lower_output_block, parse_position, parse_transform, parse_adaptive_sync.
impl blocks for: InputConfig, InputConfig, InputDeviceConfig, XwaylandConfig, OutputConfig, OutputTransformConfig, GpuConfig, GpuConfigRaw, GpuConfig, SwitchEventsConfig.

Visibility: GpuConfigRaw, SwitchEventsRaw, apply_gpu_block, apply_input_block, apply_switch_events_block, apply_touchpad_block, apply_xwayland_block, lower_output_block, parse_adaptive_sync, parse_position gain pub(super) so config/mod.rs and its other domain files keep using them.
Members called from mod.rs gain pub(super): `SwitchEventsRaw.lid_close`; `SwitchEventsRaw.lid_open`; `SwitchEventsRaw.tablet_mode_off`; `SwitchEventsRaw.tablet_mode_on`; `fn from_raw(raw: GpuConfigRaw, warnings: &mut Vec<String>) -> Self`; `fn from_raw(raw: SwitchEventsRaw) -> Self`.
Imported for tests only (#[cfg(test)]): apply_touchpad_block.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Formatting only (cargo fmt): wrapped signatures that pub(super) pushed
past the line width and the new import lines. A whitespace-insensitive
identity check shows no other change.

712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 9: 9 items and 3 impl blocks move verbatim:
WindowMatchFacts, WindowRule, GlassMode, WindowOpacity, LayerRule, WorkspaceRule, lower_window_rule_block, lower_workspace_rule_block, lower_layer_rule_block.
impl blocks for: WindowOpacity, WindowRule, LayerRule.

Visibility: lower_layer_rule_block, lower_window_rule_block, lower_workspace_rule_block gain pub(super) so config/mod.rs and its other domain files keep using them.
Members called from mod.rs gain pub(super): `fn has_initial_criteria(&self) -> bool`; `fn has_live_criteria(&self) -> bool`; `fn has_on_workspace_criteria(&self) -> bool`; `fn has_tag_criteria(&self) -> bool`.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Formatting only (cargo fmt): wrapped signatures that pub(super) pushed
past the line width and the new import lines. A whitespace-insensitive
identity check shows no other change.

712 tests, fmt and strict Clippy (all and default features) pass.
…pup, glass, caustics) to config/decoration.rs

Plan step 9: 29 items and 10 impl blocks move verbatim:
GlassAnimation, WaterGlassConfig, ToastStyle, PopupAnimation, FrostConfig, CausticsConfig, FrostOverrides, ShadowConfig, ShadowOverrides, RoundingConfig, RoundingOverrides, BorderPlacement, BorderConfig, BorderOverrides, PopupConfig, parse_glass_animation, apply_water_glass_block, apply_caustics_block, apply_frost_block, apply_frost_override_block, apply_shadow_block, apply_shadow_override_block, parse_shadow_offset, apply_rounding_block, parse_corner_radii, apply_rounding_override_block, apply_border_block, apply_border_override_block, apply_popup_block.
impl blocks for: WaterGlassConfig, FrostConfig, CausticsConfig, FrostOverrides, ShadowConfig, ShadowOverrides, RoundingConfig, RoundingOverrides, BorderConfig, BorderOverrides.

Visibility: apply_border_block, apply_border_override_block, apply_caustics_block, apply_frost_block, apply_frost_override_block, apply_popup_block, apply_rounding_block, apply_rounding_override_block, apply_shadow_block, apply_shadow_override_block, apply_water_glass_block, parse_corner_radii gain pub(super) so config/mod.rs and its other domain files keep using them.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Formatting only (cargo fmt): wrapped signatures that pub(super) pushed
past the line width and the new import lines. A whitespace-insensitive
identity check shows no other change.

712 tests, fmt and strict Clippy (all and default features) pass.
Plan step 9: 40 items and 7 impl blocks move verbatim:
RippleShape, RipplePreset, RipplePresetSelection, RippleSizeMode, RippleTrigger, RippleAnchor, RippleLayer, WindowAnimationCurve, WindowAnimationEffect, WindowAnimationOrigin, WindowAnimationConfig, WindowAnimationsConfig, WorkspaceAnimationStyle, WorkspaceAnimationConfig, InteractiveAnimationConfig, RippleEase, WorkspaceTransitionConfig, WorkspaceTransitionStyle, WorkspaceTransitionDirectionMode, CascadeLiquidPreset, CascadeLiquidConfig, RippleConfig, apply_animations_block, apply_workspace_animation_block, apply_interactive_animation_block, apply_window_animation_block, spring_curve_rejection, parse_window_animation_curve, apply_cascade_liquid_block, apply_workspace_transition_block, apply_ripple_block, parse_ripple_color, parse_shapes, parse_ripple_preset_selection, valid_ripple_preset_name, parse_ripple_size_mode, parse_triggers, parse_anchor, parse_layer, parse_ease.
impl blocks for: WorkspaceAnimationConfig, InteractiveAnimationConfig, WindowAnimationsConfig, WindowAnimationsConfig, CascadeLiquidConfig, WorkspaceTransitionConfig, RippleConfig.

Visibility: apply_animations_block, apply_cascade_liquid_block, apply_ripple_block, apply_workspace_transition_block, parse_ripple_color, parse_ripple_preset_selection, parse_window_animation_curve, spring_curve_rejection, valid_ripple_preset_name gain pub(super) so config/mod.rs and its other domain files keep using them.
Imported for tests only (#[cfg(test)]): RippleSizeMode, parse_ripple_preset_selection, parse_window_animation_curve, spring_curve_rejection.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Formatting only (cargo fmt): wrapped signatures that pub(super) pushed
past the line width and the new import lines. A whitespace-insensitive
identity check shows no other change.

712 tests, fmt and strict Clippy (all and default features) pass.
…g to config/spatial.rs

Plan step 9: 46 items and 15 impl blocks move verbatim:
LayoutAlgorithm, MasterOrientation, SplitBias, VesselsConfig, SwayConfig, FloatPhysicsTier, FloatPhysicsWaveConfig, FloatPhysicsConfig, CurrentsConfig, BuoyancyConfig, SwimConfig, CompassConfig, MinimapConfig, SnapConfig, SpatialEngine, SpatialOwnership, WorkspaceProjection, OceanReefConfig, OceanBookmarkConfig, OceanPanButton, OceanConfig, DepthConfig, DepthBackgroundFit, ClassicDepthConfig, apply_snap_block, apply_connected_vessels_block, apply_sway_block, apply_float_physics_block, apply_float_physics_wave_block, apply_currents_block, apply_buoyancy_block, apply_swim_block, apply_compass_block, apply_minimap_block, apply_depth_block, apply_classic_depth_block, apply_scroll_block, apply_ocean_block, lower_ocean_reef, lower_ocean_bookmark, parse_viscosity, parse_layout_algorithm, parse_master_orientation, parse_split_bias, parse_workspace_gaps, parse_workspace_names.
impl blocks for: VesselsConfig, SwayConfig, FloatPhysicsWaveConfig, FloatPhysicsConfig, CurrentsConfig, BuoyancyConfig, SwimConfig, CompassConfig, MinimapConfig, SnapConfig, SpatialEngine, OceanPanButton, OceanConfig, DepthConfig, ClassicDepthConfig.

Visibility: apply_buoyancy_block, apply_classic_depth_block, apply_compass_block, apply_connected_vessels_block, apply_currents_block, apply_depth_block, apply_float_physics_block, apply_minimap_block, apply_ocean_block, apply_scroll_block, apply_snap_block, apply_sway_block, apply_swim_block, parse_layout_algorithm, parse_master_orientation, parse_split_bias, parse_viscosity, parse_workspace_gaps, parse_workspace_names gain pub(super) so config/mod.rs and its other domain files keep using them.
Imported for tests only (#[cfg(test)]): OceanBookmarkConfig, OceanPanButton, OceanReefConfig.
Caller paths are unchanged through re-exports from config/mod.rs.
Identity check: every item block byte-identical apart from added pub(super).

712 tests, fmt and strict Clippy (all and default features) pass.
Formatting only (cargo fmt): wrapped signatures that pub(super) pushed
past the line width and the new import lines. A whitespace-insensitive
identity check shows no other change.

712 tests, fmt and strict Clippy (all and default features) pass.
@Fi3w0
Fi3w0 merged commit bce1b11 into master Oct 28, 2026
1 check passed
@Fi3w0
Fi3w0 deleted the refactor/config-split branch October 28, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant