Skip to content

feat: allow host apps to register custom sections in team settings #41

@anilcancakir

Description

@anilcancakir

Summary

Allow host applications to inject custom form sections (cards) into the team settings view. Currently team settings only shows name, members, and invitations. Apps need a way to add project-specific settings (billing, integrations, preferences, etc.) without overriding the entire view.

Current Behavior

  • Team settings view (MagicStarterTeamSettingsView) renders three fixed sections: General (name), Members, Invitations
  • The only extensibility option is full view override via MagicStarter.view.register('teams.settings', ...), which forces the app to reimplement all existing sections

Proposed Behavior

Add a section registration API that lets host apps append custom SectionCard widgets to the team settings page:

MagicStarter.teamSettings.registerSection(
  key: 'billing',
  order: 10,
  builder: (context, team) => SectionCard(
    title: 'Billing',
    children: [
      // Custom billing form fields
    ],
  ),
);
  • Sections are rendered after the built-in sections, ordered by order value
  • Each section receives the current team context
  • Sections can be removed by key: MagicStarter.teamSettings.removeSection('billing')
  • Registration happens in the app's service provider boot(), before navigation renders

Acceptance Criteria

  • MagicStarter.teamSettings.registerSection(key:, order:, builder:) API exists
  • Custom sections render in team settings view after built-in sections
  • Sections are sorted by order (lower = higher on page)
  • removeSection(key) removes a registered section
  • Duplicate key registration replaces the previous section (no duplicates)
  • Works with existing feature gate (hasTeamFeatures())

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