Skip to content

Conversation

@AlexRubik
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-29219
https://bitwarden.atlassian.net/browse/CL-947

📔 Objective

Ensure Access Intelligence drawers stay at the small width once drawer size variants land by threading an explicit small size through state and render.

Files changed

  • bit-common/src/dirt/reports/risk-insights/models/drawer-models.types.ts: add optional size property to DrawerDetails (supporting small/default/large; default small).
  • bit-common/src/dirt/reports/risk-insights/services/view/risk-insights-data.service.ts: default drawer state to size: "small" and propagate it in all drawer open/close updates.
  • bit-web/src/app/dirt/access-intelligence/shared/risk-insights-drawer-dialog.component.html: bind dialogSize to drawerDetails.size ?? 'small' instead of fixed large.

⏰ 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

- add optional size to DrawerDetails with default small to preserve current layout
- propagate size: "small" in all RiskInsights drawer state updates to avoid wider defaults when variants land
- bind Access Intelligence drawer dialogs to use drawerDetails.size ?? 'small' instead of fixed large size
@AlexRubik AlexRubik self-assigned this Dec 10, 2025
@AlexRubik AlexRubik requested a review from a team as a code owner December 10, 2025 21:17
@claude
Copy link

claude bot commented Dec 10, 2025

Claude finished @AlexRubik's task —— View job


Code Review Complete

Tasks

  • Read changed files
  • Run bitwarden-code-reviewer agent
  • Post inline comments
  • Provide review summary

Overall Assessment: APPROVE ✅

This is a clean, well-structured change that successfully enforces the small drawer size for Access Intelligence. The implementation is solid and follows Bitwarden's patterns correctly.

What I Reviewed

  • Type safety: The optional size property correctly matches the DialogComponent's accepted values ("small" | "default" | "large")
  • Observable Data Services pattern (ADR-0003): Properly maintained - uses BehaviorSubject with observable exposure
  • Consistency: All 6 drawer state updates consistently set size: "small"
  • Template binding: Correctly uses property binding [dialogSize]="drawerDetails.size ?? 'small'" with safe fallback
  • Backward compatibility: Optional property ensures existing code continues to work

Strengths

👍 Type-safe: The new size property type exactly matches the DialogComponent's input type definition

👍 Consistent: All drawer state mutations include the size: "small" property across 6 different methods (lines 116, 142, 173, 199, 227, 260 in risk-insights-data.service.ts)

👍 Safe fallback: The template uses the nullish coalescing operator (?? 'small') to handle the optional property gracefully

👍 Well-documented: The JSDoc comment in the type definition clearly explains the default behavior

👍 Observable pattern: Maintains the existing BehaviorSubject pattern correctly

Technical Debt Finding

♻️ Test file not updated: The test file risk-insights-drawer-dialog.component.spec.ts contains mock DrawerDetails objects that should include the new size: "small" property for consistency.

While tests pass without it (since size is optional), including it would:

  • Ensure test data matches production usage (all production code sets size: "small")
  • Make tests more representative of actual runtime conditions
  • Maintain consistency with the updated type definition

This is a minor issue and doesn't block the PR, but would be a good enhancement.

No Issues Found With

✅ Security concerns (UI-only change)
✅ Breaking changes (backward compatible optional property)
✅ Logic errors (straightforward property threading)
✅ Edge cases (template fallback handles undefined gracefully)
✅ Performance impacts (no performance implications)


@github-actions
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details90c19d34-7d88-4d2b-8d9e-d96abaff5c35

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

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.81%. Comparing base (7f892cf) to head (e17720d).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17915      +/-   ##
==========================================
- Coverage   41.81%   41.81%   -0.01%     
==========================================
  Files        3589     3589              
  Lines      104160   104161       +1     
  Branches    15707    15709       +2     
==========================================
- Hits        43557    43556       -1     
+ Misses      58759    58756       -3     
- Partials     1844     1849       +5     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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