Skip to documentation

Design system / Molecules

Molecule / Member management

ReviewerCategoryAssigner

ReviewerCategoryAssigner shows Assigned and Available categories with compact plus/minus buttons. Individual and bulk commands each emit one complete selection.

Live example

Live preview

Current component with fictional data. Example changes are not persisted.

Fictional reviewer with local controls. No requests are sent.

  • Jordan Juror

    juror@example.test

    Account linked

    Assigned categories

    No explicit assignments means this reviewer can review all categories.

    Assigned categories

    Available categories

Responsibility

Category assignment is a separate reviewer-owned concern. It composes below MemberCard's identity/actions without adding reviewer policy to shared anatomy.

Public contract

The table describes supported inputs, exported parts and caller responsibilities. A callback supplies a command, such as saving a draft. These notes are maintained manually; check current source types before integration.

Maintained component API notes; current source is authoritative
Prop / partTypeRequirementResponsibility
categories / assignedEditionCategoryOption[] / string[]RequiredEdition choices and controlled selected keys.
canEdit / disabledbooleanRequired / optionalRead-only labels without capability; permitted controls disabled during writes.
onChange(keys: string[]) => void | Promise<void>RequiredOne complete selection for individual or bulk intents. The hook persists one request, not repeated toggles.

API notes are curated documentation, not generated types. The source linked above is the current implementation; update these notes alongside API changes.

State and behavior

Identify which values the caller controls and which behavior the component or underlying primitive owns. A local example does not supply persistence, authorization or a complete product lifecycle.

The caller controls assigned keys. Available category buttons use green plus icons; assigned category buttons use red minus icons. Each individual or bulk action emits one complete selection through onChange. While focus remains in the assigner, the heading holds focus during a pending move; the enabled category regains focus after acknowledgement. The product hook owns requests and rollback. No explicit assignments means unrestricted category eligibility under existing policy; the interface states this beside the controls.

Dependencies

  • Button
  • Text
  • Lucide Plus / Minus
  • React useId / useRef / useLayoutEffect
  • EditionCategoryOption (type-only)

Token and styling contract

These notes identify theme roles, utilities and direct style values used by the source. Direct colors or timings are implementation exceptions, not recommendations to bypass the theme.

text-success / text-destructive
Semantic green plus and red minus icons, with accessible action labels independent of color.
container grid / gap-3
Sections stack in narrow cards and form two columns when space permits.
Button xs / text-xs / size-3 icons
Compact category and bulk controls use the existing fluid type scale, wrap long labels and retain focus/busy treatments.

Boundaries and limitations

  • No account editing, raw endpoints, global state or authorization resolution.
  • Unassign all clears explicit filters; it does not exclude a reviewer or revoke review access.
  • Known categories keep catalog order; unknown saved keys remain visible and removable.

Where to make a change

Change transfer presentation here; change payload/lifecycle in useRoundReviewers. Shared MemberCard only receives a body slot.

Selected real uses

RoundReviewersPanel

The instance supplies the assigner through renderMemberBody; the hook persists one canonical whole-list update and rolls back failures.

Repository path: src/app/(tenants)/console/[tenantCode]/admin/programs/[programCode]/editions/[editionCode]/review-rounds/components/roundReviewersPanel.tsx

These traces describe selected uses, not every dependency. Repository-only paths are shown as references; only approved files have public source views.

Usage contract

<ReviewerCategoryAssigner categories={categories} assigned={reviewer.categories} canEdit={capabilities.canEditCategories} disabled={saving} onChange={setCategories} />

Illustrative consumer bindings, not a self-contained product workflow. Live examples supply only local state or explicit fictional props.

All molecules
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.