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

@@ -1,11 +1,13 @@
package ru.bartwell.kick.module.controlpanel.feature.presentation

import com.arkivanov.decompose.ComponentContext
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Imports must be ordered in lexicographic order without any empty lines in-between with "java", "javax", "kotlin" and aliases in the end

@bartwell bartwell closed this Jan 22, 2026
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