feat(pam): unified vault-row access-state badge - #22323
Closed
Hinton wants to merge 1 commit into
Closed
Conversation
Replace the two-state, icon-only vault-row lease badge with the unified access-state badge from the "Unifying access-state badges" spec (Figma 88-1699): a bit-badge pill with per-state colour + icon + copy, mutually exclusive precedence, and the 5-minute danger "Ending soon" escalation, rendered by a shared AccessStateBadgeComponent (reusable by the modal and Requests page). - AccessStateBadgeComponent + cipherAccessBadgeState resolver + 7 i18n keys - AccessRequestSdkService.getCipherAccessState (binds the SDK's commercial().pam().access_requests().cipher_access_state) - provide-pam binds VAULT_ROW_LEASE_BADGE to the component "Unavailable / held by another user" is modelled but not yet produced: CipherAccessStateView is caller-scoped and never reports another user's lease (needs an SDK + server signal).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
Implements the "Unifying access-state badges consistently across vault, modal, and Requests page" spec (Figma 88-1699) for the vault-row surface.
📔 Objective
Replace the two-state, icon-only vault-row lease badge with the unified access-state badge from the spec: a
bit-badgepill with per-state colour + icon + copy, mutually exclusive precedence, and the 5-minute danger "Ending soon" escalation. The recipe lives in a reusableAccessStateBadgeComponentso the cipher-view modal and Requests page can adopt the identical recipe in follow-ups.State model
primarybwi-keywarningbwi-clocksuccessbwi-checkaccent-primarybwi-unlockdangerbwi-exclamation-trianglesubtlebwi-locksubtlebwi-lockPrecedence (highest-ranked true state wins): active lease → ready → pending → privileged.
What's here
access-state-badge/—AccessStateBadgeComponent+cipherAccessBadgeStateresolver + specs.vault-row-lease-badge/— theVAULT_ROW_LEASE_BADGEprovider, rewritten to render the shared badge.AccessRequestSdkService.getCipherAccessState(bindscommercial().pam().access_requests().cipher_access_state).provide-pambindsVAULT_ROW_LEASE_BADGE; 7pamAccessBadge*i18n keys.Deferred
"Unavailable / held by another user" is modelled in
AccessBadgeStateand the recipe but not yet produced by the resolver:CipherAccessStateViewis caller-scoped and never reports another user's lease. Lighting it up needs a new signal on the SDKCipherAccessStateViewfed by the server access-state query.Stacks on #22171 (the
VAULT_ROW_LEASE_BADGEseam token) + #22147 (the PAM SDK request services). The PR base is an integration branch (pam/vault-row-access-badge-base=main+ #22171 + #22147) so the diff shows only the badge. Retarget once the team settles the stack.CI is red on 20 pre-existing errors inherited from the base PRs — none in the badge code:
partial/partialData, which are absent from the published@bitwarden/sdk-internal@0.2.0-main.956and need the still-unpublishedsdk-internalTrying to get the status code. #1359.AccessDeciderunion refactor (deciderKind/name/emailno longer exist onAccessRequestDecisionView).The badge's own files are clean — ESLint + prettier pass, 29 unit tests pass, and the badge logic typechecks (its only build error is the inherited
cipher.partial). This goes green once #1359 publishes and the base PRs adopt their drift fixes.Verification
jestoveraccess-state-badge,vault-row-lease-badge,access-requests-sdk.service→ 29 passed.lint-staged(ESLint + prettier) clean on all 13 changed files.