Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plumb Assurance StatusUi logs from AppState #90

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

prudrabhat
Copy link
Contributor

@prudrabhat prudrabhat commented Feb 28, 2024

Description

There are some components that add status logs (Assurance being connected, screenshot being captured etc) which can be displayed when the floating button is clicked. This PR adds support for such logging.

  • The status logs are limited to particular app launch. So store them as part of Assurance app state so that it can be updated from various UI.
  • Create a lazy list with the status ui logs and add them to the AssuranceStatusScreen.
  • Add tests

Motivation and Context

There are some components that add status logs (Assurance being connected, screenshot being captured etc) which can be displayed when the floating button is clicked. Add support for such logging.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

- The status logs are limited to particular app launch.
  So store them as part of Assurance app state so that it
  can be updated from various UI.
- Create a lazy list with the status ui logs and add them to the
  AssuranceStatusScreen.
- Add tests
Copy link

@yangyansong-adbe yangyansong-adbe left a comment

Choose a reason for hiding this comment

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

LGTM, only two small comments.

*/
@JvmName("logStatus")
internal fun logStatus(level: AssuranceConstants.UILogColorVisibility, status: String) {
_statusLogs.value = _statusLogs.value + StatusLog(level, status)

Choose a reason for hiding this comment

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

nit: can we use _statusLogs.value += StatusLog(level, status)? It increases readability for me.

private val _sessionPhase = mutableStateOf<SessionPhase>(SessionPhase.Disconnected())

/**
* Represents the current phase of the assurance session.
*/
val sessionPhase: State<SessionPhase> = _sessionPhase

private val _statusLogs = mutableStateOf<List<StatusLog>>(emptyList())

Choose a reason for hiding this comment

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

nit: can we consider using a more succinct expression -> private val _statusLogs = mutableStateOf(emptyList<StatusLog>())?

@prudrabhat prudrabhat merged commit 8d10305 into adobe:feature/v-next Feb 28, 2024
4 checks passed
@prudrabhat prudrabhat deleted the add_status_logs branch February 28, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants