Skip to content

Conversation

aj-rosado
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-27092

📔 Objective

Changing orientation is cleaning the flags, changing isScreenCaptureAllowed to state makes this work properly and consistent with the password manager implementation.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.78%. Comparing base (562b48d) to head (963ea80).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6062      +/-   ##
==========================================
+ Coverage   84.74%   84.78%   +0.04%     
==========================================
  Files         737      720      -17     
  Lines       55439    55060     -379     
  Branches     7655     7654       -1     
==========================================
- Hits        46983    46684     -299     
+ Misses       5775     5695      -80     
  Partials     2681     2681              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 21, 2025

Logo
Checkmarx One – Scan Summary & Details172ef8af-3971-4b44-bb29-ab01aa6f3d6a

Great job! No new security vulnerabilities introduced in this pull request

setupEdgeToEdge(appThemeFlow = mainViewModel.stateFlow.map { it.theme })
setContent {
val state by mainViewModel.stateFlow.collectAsStateWithLifecycle()
handleScreenCaptureSettingChange(isScreenCaptureAllowed = state.isScreenCaptureAllowed)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rename this function, the handle moniker is reserved for actions and events.

I think we went with updateScreenCapture in the PW app.

.isScreenCaptureAllowedStateFlow
.onEach { isAllowed ->
sendEvent(MainEvent.ScreenCaptureSettingChange(isAllowed))
mutableStateFlow.update { it.copy(isScreenCaptureAllowed = isAllowed) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

You cannot update the state from within a coroutine scope. You should be sending an internal action to do this.

The docs on this can be found here.

Improved method naming on MainActivity
@aj-rosado aj-rosado marked this pull request as ready for review October 22, 2025 11:41
@aj-rosado aj-rosado requested review from a team and brian-livefront as code owners October 22, 2025 11:41
sendEvent(MainEvent.ScreenCaptureSettingChange(isAllowed))
}
.map { MainAction.Internal.ScreenCaptureUpdate(it) }
.onEach(::trySendAction)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just use ::sendAction

MainAction.OpenDebugMenu -> handleOpenDebugMenu()

is MainAction.Internal.ScreenCaptureUpdate -> handleScreenCaptureUpdate(
isAllowed = action.isScreenCaptureEnabled,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should pass the whole action through

…nshot-flag

# Conflicts:
#	authenticator/src/main/kotlin/com/bitwarden/authenticator/MainViewModel.kt
#	authenticator/src/test/kotlin/com/bitwarden/authenticator/MainViewModelTest.kt
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.

2 participants