feat(admin): show full name beside username in client authorizations#197
Merged
Conversation
- Display the authorizing user's full name in parentheses next to their username on the admin client authorizations view - Thread FullName from the User model through the authorization service, handler, and page props - Fall back to username alone when a user has no full name - Add a service test covering both named and nameless users
Contributor
There was a problem hiding this comment.
Pull request overview
Adds FullName to the admin client authorizations view-model pipeline so the UI can render username (full name) for easier user identification, with a graceful fallback when the full name is empty.
Changes:
- Extend the client-authorization display models (
UserAuthorizationWithUser,ClientAuthorizationDisplay) to includeFullName. - Thread
FullNamethrough service → handler → template rendering for/admin/clients/:id/authorizations. - Add a unit test to verify user detail resolution (username/full name/email) for users with and without a full name.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/templates/props.go | Adds FullName to the admin authorizations view model. |
| internal/templates/admin_client_authorizations.templ | Renders full name in parentheses next to username when present. |
| internal/services/authorization.go | Populates FullName when resolving user details for client authorizations. |
| internal/services/authorization_test.go | Adds test coverage for resolved user details (including full name). |
| internal/handlers/client.go | Plumbs FullName into template props for the admin authorizations page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Render the full-name parenthetical via a Go string expression so the leading space cannot be collapsed by formatters/minifiers. - Assert the nameless user's email in the resolution test to guard against regressions independent of the FullName case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Move the full-name parenthetical out of the username span so the outer span emits no incidental whitespace around the username; the explicit concatenated space remains the stable separator. - Assert exactly two authorizations are returned in the resolution test to catch unexpected extra rows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The admin client authorizations view (
/admin/clients/:id/authorizations) showed only each authorizing user'susername. This PR adds the user's full name in parentheses beside it —username (fullname)— so admins can identify users at a glance. When a user has no full name, the display falls back tousernamealone.The
Usermodel already storedFullName; it simply wasn't carried into this view. This PR threads it through the existing chain.AI Authorship
Change classification
Plan reference
No plan.md. Goal: show
username (fullname)instead of bareusernamein the client authorizations User column, gracefully omitting the parenthetical when no full name exists.Verification
TestListClientAuthorizations_ResolvesUserDetailscovering a user with a full name (resolvesUsername+FullName+Email) and a user without one (FullNamestays empty)ListClientAuthorizationstests still passmake generate(clean),make fmt(clean),make build(OK),make lint(0 issues)/admin/clients/<id>/authorizationsfor a client with consenting users; confirm users with a full name renderusername (fullname)and users without one render justusername. The generated templ emits a literal space, so it readsalice (Alice Anderson), notalice(Alice Anderson).Verifiability check
FullNameflows handler → props → templateRisk & rollback
FullNamecan't produce stray().git revertor close the PR. No migrations.Reviewer guide
internal/templates/admin_client_authorizations.templ— the conditional render (confirm the space between username and the parenthetical) — andinternal/services/authorization.go—FullNamepopulation inListClientAuthorizations.internal/handlers/client.go,internal/templates/props.go(one-field plumbing), and the new test ininternal/services/authorization_test.go.🤖 Generated with Claude Code