Skip to content

Rule Groups: named collections of rules with accordion UI #1

@martinjms

Description

@martinjms

Summary

Add the ability to group individual rules into named "Rule Groups" that can be managed as a unit. This is a UI-only feature — on-chain, the rules are still flattened into a per-assembly rule list.

Motivation

Currently, each rule in a building group's policy is a single tribe or player entry. When managing many players (e.g. 20 paying customers, 15 friends, 5 officers), the flat list becomes hard to navigate.

Rule Groups let users organize rules semantically:

  • "Paying Players" — 20 individual player rules, all set to Allow
  • "Friends" — 15 players, Allow
  • "Banned" — 3 players, Deny
  • "Alliance" — 2 tribe rules, Allow

Proposed UX

  • Each rule group appears as an accordion row in the policy list
  • Collapsed: shows group name, member count, and the shared effect (Allow/Deny)
  • Expanded: shows all individual rules inside, each editable
  • The group can be enabled/disabled as a whole (toggling all members)
  • Individual rules inside can also be toggled independently
  • Groups are drag-to-reorder alongside individual rules in the priority list

Example

Building Group: "Alpha Sector Gates"
├── [T] [AWAR] Algorithmic Warfare        → Allow  ●
├── ▸ Paying Players (12 rules)           → Allow  ●    ← collapsed group
├── ▸ Banned Players (3 rules)            → Deny   ●    ← collapsed group
└── [*] Everyone                          → Deny   ●

Expanding "Paying Players":

├── ▾ Paying Players (12 rules)           → Allow  ●
│   ├── [P] Character #811880             → Allow  ●
│   ├── [P] Character #812345             → Allow  ●
│   ├── [P] Character #899001             → Allow  ○  ← disabled
│   └── ...

Technical Notes

  • UI only — stored in localStorage alongside existing SavedRule and PolicyEntry data
  • On-chain flattening: when "Apply" is clicked, groups are expanded into individual rules in the PTB
  • Rule ordering: group position in the list determines where its members appear in the flattened on-chain rule list
  • No Move contract changes needed

Out of Scope

  • On-chain rule group concept (not needed — the contract evaluates flat rule lists)
  • Nested groups (groups within groups)

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions