Skip to content

[Feature] Structured role lists for organizations #274

@banisterious

Description

@banisterious

Problem / Use case

Organization membership roles are currently freeform text — users manually type a role string each time they assign a person to an org. This causes typos, inconsistency (e.g., "Commander" vs "commander" vs "Comander"), and repetitive data entry for organizations with many members in well-defined roles. The role-order config on the charted-roots-members block helps with display ordering, but it must be maintained separately per block and doesn't prevent input errors.

Raised in #273 as part of a broader rank customization request.

Proposed solution

Add a roles property to organization note frontmatter that defines the valid roles and their display order for that organization:

---
cr_type: organization
cr_id: org-city-guard
name: "City Guard"
org_type: military
roles:
  - Commander
  - Captain of the Guard
  - Lieutenant
  - Sergeant
  - Guard
---

The list order defines rank/display order (first = highest). This is stored on the org note itself — no new entity type or note files.

What this enables

1. Role picker in membership modals
When assigning a role in the Add Membership or Manage Members modals, show a dropdown populated from the org's roles list instead of a plain text input. Freeform entry remains available for one-off roles not in the list.

2. Automatic members block ordering
If the org has a roles list, the charted-roots-members renderer uses it as the default role order — no role-order block config needed. Block-level role-order overrides if specified.

3. Per-org-type role templates in settings
Define default role lists for each organization type (military, noble_house, guild, etc.). When creating a new "military" org, the roles property pre-populates with the template. Users can customize per org.

4. Cross-org role comparison
Position in the list gives an implicit numeric level (index 0 = highest). Sufficient for sorting and display without a separate ranking system.

Implementation scope

Area Change Complexity
Organization schema Add roles: string[] to OrganizationFrontmatter and OrganizationInfo Low
Settings Add defaultRolesForOrgType: Record<string, string[]> templates Low
Create org modal Pre-populate roles from org-type template; editable list UI Medium
Add membership modal Role dropdown from org's roles list (with freeform fallback) Medium
Manage members modal Same role dropdown Medium
Members renderer Use org's roles as default ordering when no role-order config Low

What this intentionally defers

These capabilities from #273 are not in scope but could be layered on later:

  • Ranks as standalone browsable entities with their own cr_type
  • Parent/child rank hierarchies
  • Rank display as person titles
  • Rank start/end dates separate from membership dates
  • Cross-org rank comparison via explicit L0–L15 levels

Related

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestproposalHas a concrete design ready for review before implementation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions