Skip to content

feat(relationships): system relationships (types + member/group edges) - #26

Merged
SiteRelEnby merged 1 commit into
mainfrom
feat/system-relationships
Jul 14, 2026
Merged

SiteRelEnby merged 1 commit into
mainfrom
feat/system-relationships

Conversation

@SiteRelEnby

Copy link
Copy Markdown
Collaborator

Brings the system relationships feature to Android, matching web. Despite the name it is entirely intra-system: a private graph a user draws among their own members (and groups). No cross-system/federation, no request/accept flow, no external identity - the counterparty is always another member/group already in the account.

Two layers

Relationship types (Settings > System > Relationships) - a per-system vocabulary:

  • Create / edit / delete, with a Kind: symmetric (one label, e.g. partner), directional (two labels, e.g. parent / child), or either (both, with an optional "mutual").
  • Optional preset picker to prefill the form (partner, parent/child, protector, ...).
  • Kind is immutable after creation (server-enforced) - the edit dialog says so.
  • Delete cascades its edges; the confirm dialog warns.

Edges - a reusable RelationshipsEditor embedded on member and group screens:

  • Add/remove relationships from a member or group's edit screen; the member/group profile shows them read-only.
  • Pick the other party from a dropdown, and (for directional/either types) the direction or a mutual flag.
  • Labels + direction are resolved server-side per viewpoint, so the client renders RelationshipFromViewpoint as-is (direction glyph + label: other name). No edit-in-place for edges (delete + recreate), matching the backend.

Notable details

  • Payload builder (buildRelationshipEdge) mirrors web's handleAdd (source/target orientation for forward vs reverse, mutual normalisation for either) and is pure + unit-tested.
  • New models in RelationshipModels.kt (string-typed enums per project convention) + a // Relationships group of 10 endpoints in SheafApiService.kt.
  • Endpoints require token scopes relationships:read/write/delete; the main-app session token has them (web works). A 403 would be a backend/token concern.

Deferred (follow-up)

  • The whole-system force-directed graph view (/relationships/graph) - a dedicated Compose-canvas PR.
  • A Sheaf/OpenPlural import toggle for relationships (backend already exports/imports them).

Testing

  • RelationshipEdgePayloadTest: symmetric, directional forward/reverse (source swap), either+mutual, either-directional, mutual-ignored-for-non-either, visibility always private.
  • :app:assemblePlayRelease + :wear:assembleRelease green (through R8); unit suite green; em-dash clean.
  • Not device-tested here; worth a pass: define a type of each Kind; add member relationships of each and confirm the label + direction glyph render from the viewpoint; toggle Mutual on an either type; remove one; repeat on a group; delete a type and confirm its edges vanish (cascade); confirm dup-name / duplicate-pair (409) surface a readable error.

Brings the intra-system relationships feature to Android, matching web. It
maps how a user's own members (and groups) relate to each other - there is
no cross-system/federation, request/accept flow, or external identity.

Two layers:
- Relationship types (Settings > System > Relationships): a per-system
  vocabulary. Create/edit/delete with a Kind of symmetric (one label),
  directional (two labels), or either (both, with an optional mutual),
  optionally starting from a preset. Kind is immutable after creation
  (server-enforced); deleting a type warns that it cascades its edges.
- Edges: add/remove relationships from a member or group's edit screen,
  picking the other party and (for directional/either types) the direction
  or a mutual flag. The member/group profiles show them read-only. Labels
  and direction are resolved server-side per viewpoint, so the client just
  renders them; the reusable RelationshipsEditor works for both scopes.

The edge-create payload builder (source/target orientation, mutual
normalisation) mirrors web's handleAdd and is unit-tested.

The whole-system force-directed graph view is deferred to a follow-up.
@SiteRelEnby
SiteRelEnby merged commit d231171 into main Jul 14, 2026
1 check passed
@SiteRelEnby
SiteRelEnby deleted the feat/system-relationships branch July 14, 2026 01:42
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.

1 participant