more prod ready comments

This commit is contained in:
Priec
2025-08-18 21:10:06 +02:00
parent 465db82bd9
commit f9d9231d50
8 changed files with 48 additions and 19 deletions

View File

@@ -1,5 +1,11 @@
//! Computed fields subsystem.
//!
//! This module exposes the provider trait and the internal state management
//! for computed (display-only) fields. Computed fields are values derived
//! from other fields in the form and are not directly editable by the user.
pub mod provider; pub mod provider;
pub mod state; pub mod state;
pub use provider::{ComputedContext, ComputedProvider}; pub use provider::{ComputedContext, ComputedProvider};
pub use state::ComputedState; pub use state::ComputedState;

View File

@@ -1,6 +1,7 @@
// ================================================================================================ //! Provider interface and context for computed/display-only fields.
// COMPUTED FIELDS - Provider and Context //!
// ================================================================================================ //! Implementors provide logic to compute a field's display value from the
//! other field values in the form.
/// Context information provided to computed field calculations /// Context information provided to computed field calculations
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View File

@@ -1,11 +1,10 @@
/* file: canvas/src/computed/state.rs */ // src/computed/state.rs
/* //! Computed field state: caching and dependency graph.
Add computed state module file implementing caching and dependencies //!
*/ //! This module holds the internal state necessary to track which fields are
//! computed, their dependencies, and cached computed values. It is used by the
// ================================================================================================ //! editor to avoid unnecessary recomputation and to present computed fields as
// COMPUTED FIELDS - State: caching and dependencies //! read-only.
// ================================================================================================
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
@@ -85,4 +84,4 @@ impl Default for ComputedState {
fn default() -> Self { fn default() -> Self {
Self::new() Self::new()
} }
} }

View File

@@ -1,5 +1,9 @@
// src/editor/mod.rs // src/editor/mod.rs
// Only module declarations and re-exports. //! Editor submodule exports.
//!
//! This module exposes the internal editor pieces (core, editing, movement,
//! navigation, mode, and optional features like suggestions, validation, and
//! computed field helpers). Only module declarations and re-exports live here.
pub mod core; pub mod core;
pub mod display; pub mod display;

View File

@@ -1,4 +1,8 @@
// src/suggestions/mod.rs // src/suggestions/mod.rs
//! Suggestions subsystem - provider and optional GUI.
//!
//! Contains the suggestion provider types used by the editor and, when the GUI
//! feature is enabled, the rendering helpers for the suggestions dropdown.
pub mod state; pub mod state;
#[cfg(feature = "gui")] #[cfg(feature = "gui")]

View File

@@ -1,4 +1,9 @@
// src/textarea/mod.rs // src/textarea/mod.rs
//! Text area convenience exports.
//!
//! Re-export the core textarea types and provider so consumers can use
//! `canvas::textarea::TextArea` / `TextAreaState` / `TextAreaProvider`.
pub mod provider; pub mod provider;
pub mod state; pub mod state;

View File

@@ -1,6 +1,11 @@
/* canvas/src/validation/formatting.rs // src/validation/formatting.rs
Add new formatting module with CustomFormatter, PositionMapper, DefaultPositionMapper, and FormattingResult //! Custom formatting and position mapping for validation/display.
*/ //!
//! This module defines the CustomFormatter trait along with helpers to map
//! cursor positions between the raw stored text and the formatted display
//! representation. Implementors may provide a custom PositionMapper to handle
//! advanced formatting scenarios.
use std::sync::Arc; use std::sync::Arc;
/// Bidirectional mapping between raw input positions and formatted display positions. /// Bidirectional mapping between raw input positions and formatted display positions.
@@ -214,4 +219,4 @@ mod tests {
_ => panic!("expected success"), _ => panic!("expected success"),
} }
} }
} }

View File

@@ -1,6 +1,11 @@
// src/validation/mod.rs // src/validation/mod.rs
//! Validation subsystem re-exports and helpers.
//!
//! This module collects validation-related modules (limits, masks, patterns,
//! formatting, and state) and re-exports the most commonly used types so that
//! callers can import them from `crate::validation`.
// Core validation modules // Core validation modules
pub mod config; pub mod config;
pub mod limits; pub mod limits;
pub mod state; pub mod state;