Skip to content

Remove remember ViewModel#6618

Merged
david-livefront merged 1 commit intomainfrom
remove-remember-viewmodel
Mar 9, 2026
Merged

Remove remember ViewModel#6618
david-livefront merged 1 commit intomainfrom
remove-remember-viewmodel

Conversation

@david-livefront
Copy link
Collaborator

@david-livefront david-livefront commented Mar 5, 2026

🎟️ Tracking

N/A

📔 Objective

This PR removes all the instances of remeber(viewModel) from the click listeners in the codebase. These extra remebers are no longer needed since strong skipping will handle this for us. This will simplify a lot of our UIs.

@david-livefront david-livefront requested review from a team as code owners March 5, 2026 23:35
@github-actions github-actions bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:docs Change Type - Documentation t:feature Change Type - Feature Development t:llm Change Type - LLM related change (e.g. CLAUDE.md files) labels Mar 5, 2026
@david-livefront david-livefront added t:tech-debt Change Type - Tech debt and removed t:docs Change Type - Documentation t:feature Change Type - Feature Development t:llm Change Type - LLM related change (e.g. CLAUDE.md files) labels Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Logo
Checkmarx One – Scan Summary & Details8b867d2a-857c-47f6-b335-f880b1b3e281

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

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 82.92683% with 126 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.54%. Comparing base (aa23d5e) to head (8b47245).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...n/ui/auth/feature/environment/EnvironmentScreen.kt 61.76% 13 Missing ⚠️
...tor/ui/platform/feature/settings/SettingsScreen.kt 72.97% 10 Missing ⚠️
...untconfirmation/DeleteAccountConfirmationScreen.kt 36.36% 1 Missing and 6 partials ⚠️
...i/platform/feature/settings/export/ExportScreen.kt 0.00% 7 Missing ⚠️
...den/ui/vault/feature/addedit/VaultAddEditScreen.kt 85.00% 6 Missing ⚠️
...form/feature/settings/importing/ImportingScreen.kt 0.00% 6 Missing ⚠️
.../settings/accountsecurity/AccountSecurityScreen.kt 86.84% 1 Missing and 4 partials ⚠️
...ings/autofill/blockautofill/BlockAutoFillScreen.kt 58.33% 0 Missing and 5 partials ⚠️
...en/ui/vault/feature/qrcodescan/QrCodeScanScreen.kt 28.57% 3 Missing and 2 partials ⚠️
...bitwarden/ui/auth/feature/landing/LandingScreen.kt 78.94% 0 Missing and 4 partials ⚠️
... and 28 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6618      +/-   ##
==========================================
- Coverage   85.90%   85.54%   -0.36%     
==========================================
  Files         804      973     +169     
  Lines       57370    59933    +2563     
  Branches     8307     8411     +104     
==========================================
+ Hits        49284    51271    +1987     
- Misses       5203     5744     +541     
- Partials     2883     2918      +35     
Flag Coverage Δ
app-data 18.29% <0.00%> (+0.76%) ⬆️
app-ui-auth-tools 21.00% <29.98%> (+0.12%) ⬆️
app-ui-platform 15.61% <25.03%> (+0.54%) ⬆️
app-ui-vault 26.55% <12.27%> (+0.76%) ⬆️
authenticator 6.61% <16.81%> (-0.07%) ⬇️
lib-core-network-bridge 4.26% <4.64%> (-0.02%) ⬇️
lib-data-ui 0.93% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@david-livefront david-livefront added the ai-review Request a Claude code review label Mar 6, 2026
@claude
Copy link
Contributor

claude bot commented Mar 6, 2026

Claude finished @david-livefront's task in 3m 13s —— View job


Review Summary: Remove remember ViewModel

Reviewed commit: 8b4724526 (Remove remember ViewModel)
Risk level: Low - mechanical refactoring with well-defined pattern

Overview

This PR removes remember(viewModel) { { ... } } lambda wrappers from 74 files across all modules (app, authenticator, testharness) and documentation. The change relies on Compose strong skipping mode to handle lambda memoization automatically, eliminating the need for manual remember wrapping.

Findings

No issues found. This is a clean, well-executed mechanical refactoring.

Verification Summary

Check Result
Pattern replacement correctness All ~442 remember(viewModel) lambda wrappers correctly unwrapped
Non-lambda remember preserved All ~40 Handler object remember(viewModel) instances correctly kept (e.g., SendHandlers.create(), SearchHandlers.create())
remember import removal correct Verified files only lose the import when no remaining remember calls exist
No missed instances All remaining remember(viewModel) are for computed objects, not lambda callbacks
Documentation consistent CLAUDE.md, SKILL.md, templates.md, and ARCHITECTURE.md all updated to remove remember(viewModel) guidance
No behavioral changes All lambda bodies are preserved exactly; only the remember wrapper is removed

Notes

  • Two remember {} (without viewModel key) in authenticator ExportScreen.kt and ImportingScreen.kt were also correctly removed, consistent with the PR's purpose.
  • ViewSendScreen.kt includes a minor unrelated cleanup (LocalContext.currentLocalResources.current), which is a trivial improvement.

Status: Approved - No issues to address.

@david-livefront david-livefront force-pushed the remove-remember-viewmodel branch from 479d479 to 8b47245 Compare March 9, 2026 15:55
@github-actions github-actions bot added t:docs Change Type - Documentation t:feature Change Type - Feature Development t:llm Change Type - LLM related change (e.g. CLAUDE.md files) and removed t:tech-debt Change Type - Tech debt labels Mar 9, 2026
- ✅ Use `hiltViewModel()` for dependency injection
- ✅ Use `collectAsStateWithLifecycle()` for state (not `collectAsState()`)
- ✅ Use `EventsEffect(viewModel)` for one-shot events
- ✅ Use `remember(viewModel) { }` for stable callbacks to prevent recomposition
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@david-livefront
Copy link
Collaborator Author

Thanks @SaintPatrck

@david-livefront david-livefront added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit aeed96e Mar 9, 2026
34 checks passed
@david-livefront david-livefront deleted the remove-remember-viewmodel branch March 9, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:docs Change Type - Documentation t:feature Change Type - Feature Development t:llm Change Type - LLM related change (e.g. CLAUDE.md files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants