1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[26908] improve empty state design (#16832)

* max init

* add mp4 and organize code better

* fix lint errors

* move empty state logic into risk insights component

* replace getter logic

* sub for org name

* checkForVaultItems fix
- need to use cipherservice instead of report results from data service

* fix all critical issues mentioned by claude bot

* resolve empty state logic bug and memory leaks

- Handle zero-results case in empty state logic
- Add takeUntil cleanup to _setupUserId subscription
- Guard console.warn with isDevMode() check

* use tuple arrays for benefits to prevent XSS risk

Replace pipe-separated strings with typed tuple arrays [string, string][]
for benefits data in empty state component. This eliminates potential XSS
risk from string splitting, provides compile-time type safety, and improves
performance by removing runtime string parsing on every change detection.

* fix(dirt): hide empty states during report generation and fix memory leak

Add isGeneratingReport$ to combineLatest, update empty state conditions
to check !isGenerating, simplify run report logic, and fix memory leak
in route.queryParams subscription.

Addresses Claude bot feedback on PR #16832

* refactor(dirt): use signals and OnPush in empty state card component

Convert @Input() to readonly input signals and add OnPush change
detection strategy. Update template to call signals as functions.
Fixes ESLint compliance issues.

* refactor(dirt): remove unused shouldShowRunReportState variable

The shouldShowRunReportState variable was calculated but never used.
The template already uses @else for the run report state, making this
variable redundant.

* refactor(dirt): consolidate duplicate if statements in empty state logic

Merge 5 separate if/else blocks checking shouldShowImportDataState into
single consolidated block. Move constant benefits assignment outside
conditional. Improves readability and reduces duplication.

* remove unnecessary getOrganizationName wrapper method

* remove duplicate runReport method

Remove runReport arrow function and use generateReport consistently.
Both methods called dataService.triggerReport(), but generateReport
includes an organizationId check for defensive programming.
This commit is contained in:
Alex
2025-10-30 15:16:41 -04:00
committed by GitHub
parent 2b009778e8
commit fdfcee4bc5
11 changed files with 455 additions and 201 deletions

View File

@@ -172,8 +172,8 @@
}
}
},
"noAppsInOrgTitle": {
"message": "No applications found in $ORG NAME$",
"noApplicationsInOrgTitle": {
"message": "No applications found for $ORG NAME$",
"placeholders": {
"org name": {
"content": "$1",
@@ -181,8 +181,32 @@
}
}
},
"noAppsInOrgDescription": {
"message": "As users save logins, applications appear here, showing any at-risk passwords. Mark critical apps and notify users to update passwords."
"noApplicationsInOrgDescription": {
"message": "Import your organization's login data to start monitoring credential security risks. Once imported you get to:"
},
"benefit1Title": {
"message": "Prioritize risks"
},
"benefit1Description": {
"message": "Focus on applications that matter the most"
},
"benefit2Title": {
"message": "Guide remediation"
},
"benefit2Description": {
"message": "Assign at-risk members guided tasks to rotate at-risk credentials"
},
"benefit3Title": {
"message": "Monitor progress"
},
"benefit3Description": {
"message": "Track changes over time to show security improvements"
},
"noReportRunTitle": {
"message": "Run your first report to see applications"
},
"noReportRunDescription": {
"message": "Generate a risk insights report to analyze your organization's applications and identify at-risk passwords that need attention. Running your first report will:"
},
"noCriticalApplicationsTitle": {
"message": "You havent marked any applications as critical"

Binary file not shown.