Skip to content

feat(auth): let child apps add sections to Settings → Profile - #687

Open
adenarc wants to merge 1 commit into
NEARBuilders:mainfrom
adenarc:feat/profile-sections
Open

adenarc wants to merge 1 commit into
NEARBuilders:mainfrom
adenarc:feat/profile-sections

Conversation

@adenarc

@adenarc adenarc commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Child apps can now add their own sections to Settings → Profile without claiming /settings/profile locally.

How it works

  • New profile auth variable: profile.sections, up to 5 entries of { id, title, description?, url }. url is an app path; id is kebab-case and unique.
  • The page fetches each url with the user's session and renders the sections below the profile fields, in config order. The response is { items: [{ title, description?, meta?, href? }], empty?, incomplete?, link?: { href, label } }. Hrefs must be app paths or https:// URLs, the same rule as onboard.
  • If a section fails or returns something that doesn't match, only that section shows an error with Retry. The rest of the page keeps working.
  • An invalid profile config shows no sections.

I went with data from an endpoint rather than a remote component. Plugin UIs are grafted routes, so loading a component from the child's UI remote inside the auth page would be a much bigger runtime change. This follows the same pattern as onboard.community.url from #662.

City Node will use it for a member's attendance record across communities (NEARBuilders/citynode.app#400): one section with event, community and date per row, plus an incomplete note when upstream listings may be truncated.

The redeem hook mentioned in the issue isn't part of this PR.

Tested

  • New unit tests for the config parsing (ui/src/lib/profile-sections.test.ts) and component tests on the Profile page: items, links, incomplete note, one failing section next to a working one, retry, invalid response, empty text, and no fetch when nothing is configured
  • plugins/auth vitest: 464 passed
  • pnpm typecheck and biome check pass. lint:effect (oxlint) doesn't run locally: it fails to parse its own preset config (Unknown plugin: 'effecttsgo') before linting anything, so CI is the check for that one

Not tested: not checked in a browser or at 375px yet.

Closes #661

…ilders#661)

- profile auth variable: up to 5 sections, each { id, title, description?, url }
- each section fetches its app path and renders items, an empty text, an incomplete note and a header link
- a failed or invalid section shows an error with Retry; the rest of the page keeps working
@adenarc

adenarc commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@elliotBraem ready for review when you get a chance, City Node #400 needs this

@elliotBraem elliotBraem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking in preference of another pattern

This branch has not been deployed

No deployments
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.

auth plugin: let child apps add a section to Settings → Profile

2 participants