Skip to main content

Module inspector

Module inspector 

Source
Expand description

UI Inspector overlay for debugging widget trees and hit-test regions. UI Inspector overlay for debugging widget trees and hit-test regions.

The inspector visualizes:

  • Hit regions with colored overlays
  • Widget boundaries with colored borders
  • Widget names and metadata

§Usage

use ftui_widgets::inspector::{InspectorMode, InspectorState, InspectorOverlay};

// In your app state
let mut inspector = InspectorState::default();

// Toggle with F12
if key == KeyCode::F12 {
    inspector.toggle();
}

// Render overlay after all widgets
if inspector.is_active() {
    InspectorOverlay::new(&inspector).render(area, frame);
}

See docs/specs/ui-inspector.md for the full specification.

Structs§

DiagnosticEntry
JSONL diagnostic log entry.
DiagnosticLog
Diagnostic log collector.
HitInfo
Helper to extract hit information from a HitCell for display.
InspectorOverlay
Inspector overlay widget.
InspectorState
Inspector overlay state (shared across frames).
InspectorStyle
Configuration for inspector appearance.
TelemetryHooks
Telemetry hooks for observing inspector events.
WidgetInfo
Information about a widget for inspector display.

Enums§

DiagnosticEventKind
Diagnostic event types for JSONL logging.
InspectorMode
Inspector display mode.

Functions§

diagnostics_enabled
Check if diagnostics are enabled.
init_diagnostics
Initialize diagnostic settings from environment.
is_deterministic_mode
Check if deterministic mode is enabled.
reset_event_counter
Reset event counter (for testing determinism).
set_diagnostics_enabled
Set diagnostics enabled state (for testing).

Type Aliases§

TelemetryCallback
Callback type for telemetry hooks.