Repository navigation
refactor: split config.rs into config/ by domain (plan step 9, 0.91.0) - #16
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan step 9, the last step of the architecture refactor. The 14,441-line
src/tide_core/config.rsbecomessrc/tide_core/config/, one file per domain, using the layout Fiw approved: each file holds a domain's config types, theirDefault/impls, and theapply_*/lower_*functions that fill them, so one config key lives in one file. Version0.91.0.mod.rsConfig,RawConfig,lower_entries, top-level assign/block dispatch, re-exportsanimation.rsspatial.rsdecoration.rsrules.rsactions.rsAction, keybinds and their parsersdevices.rsshaders.rsfiles.rsdefaults.rsvalues.rsdiff.rsConfigDifftests.rsHow it was done
491bd32renamesconfig.rstoconfig/mod.rswith no content change;45b4faemoves the tests body verbatim (rustfmt re-indent and two dropped trailing commas).implblocks. Where rustfmt had to rewrap a line afterwards, that's a separatestyle:commit.pub(super), and only where the compiler shows a use frommod.rs, a sibling domain, or the tests. Each commit message lists them. Test-only uses are imported under#[cfg(test)].config/mod.rsre-exports by explicit name, so no file outsideconfig/changes.Verification
491bd32: all 273 item blocks present; 270 byte-identical apart from addedpub(super), 3 differ only by rustfmt rewrapping. Tests identical ignoring whitespace.style:commit also passes fmt. All-feature release build.0.90.211; subscriber checks pass in Classic, Scroll and Ocean.0.91.0:tidectl doctor10/10, startup probe with user state unchanged, and 12 WM + 4 client fullscreen round trips across Scroll→Classic→Scroll with state restored.