Presentation Capability Ports Architecture
Overview
To avoid god interfaces and adhere to the Interface Segregation Principle (ISP), TuiExtensionUI has been segregated into focused capability ports in :core:presentation:
-
StatusBarPort: Status management (text, widgets, state flows, removal). -
SlotPort: UI slot widget management (builder-based and flow-based widgets). -
WorkingIndicatorPort: Working message, frames indicator, and visibility control. -
EditorPort: Programmatic editor text manipulation (setEditorText,getEditorText,pasteToEditor). -
InteractivePort: Footer rendering, title setting, custom views, overlays, timed confirmation prompts, and theme access.
Composition & Delegation
TuiExtensionUI implements all capability ports alongside base ExtensionUI:
interface TuiExtensionUI :
ExtensionUI,
StatusBarPort,
SlotPort,
WorkingIndicatorPort,
EditorPort,
InteractivePort {
override val theme: TuiTheme get() = DefaultTuiTheme
}
Delegating implementations such as DelegatingExtensionUI and consumers query capability support explicitly via safe casts (e.g., ui as? StatusBarPort), logging or falling back gracefully when capabilities are absent.