Skip to content

Conversation

@bartwell
Copy link
Owner

Motivation

  • Deliver all Control Panel interactions as events so the host app can observe user actions and config changes centrally via a stream instead of only a single callback.
  • Ensure events generated while the library UI overlays the app (e.g. activity paused on Android) are not lost and can be delivered when the app resumes.

Description

  • Added a sealed class ControlPanelEvent with variants for module exit, save, value change and button click and placed it under module/.../data/ControlPanelEvent.kt.
  • Introduced a buffered SharedFlow in ControlPanelActions and added emitEvent/emitButtonClick to publish events with replay and extra buffer capacity to tolerate temporary unavailability of subscribers.
  • Exposed the events stream from ControlPanelAccessor as the event: Flow<ControlPanelEvent> property and kept the existing onButtonClick callback for compatibility.
  • Emitted events from DefaultControlPanelComponent for module exit, save pressed, value changes and action button clicks, extended ControlPanelComponent with onActionButtonClick, and wired action buttons in ControlPanelContent through the component.
  • Updated the sample app (sample/shared/App.kt) to collect Kick.controlPanel.event and log received events, and synchronized the stub module to the new API.

Testing

  • No automated tests were run on the modified code.

Codex Task

@bartwell bartwell merged commit fade8a9 into develop Jan 22, 2026
2 checks passed
@bartwell bartwell deleted the codex/add-event-field-to-control-panel-77j7hn branch January 22, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants