Repository navigation
profile: new component for the public persona (closes #52) - #53
Merged
Merged
Conversation
New mountable component owning handle, display name, bio, avatar URL, and bio links, keyed by an opaque host-supplied user key (the host's users table stays the host's FK hub). This commit adds the module scaffold, the goose migration (profile_goose_db_version), the sqlc-generated queries, the store with claim-once handle semantics, and the host-facing resolver types in profileuser. Handles are lowercase-normalized text with a plain UNIQUE constraint rather than citext, so the component never needs CREATE EXTENSION. #52 Co-Authored-By: Claude Fable 5 <[email protected]>
Handlers follow the timeline/faq pattern: host-supplied resolver middleware, same-origin CSRF guard failing closed, pages rendered through infodancer/ui's ui/document with a host Chrome hook. Bio markdown is sanitized at render time via ui/markdown's untrusted-comment preset; links render with rel="me nofollow ugc". The identicon endpoint serves a deterministic SVG built only from hash-derived integers, with nosniff and default-src 'none' headers. Avatar upload goes through an injected ingest hook so the media pipeline is substitutable in tests. Tested against an in-memory store fake: auth gates, CSRF, handle claim/immutability/reservations, link validation, sanitization, card escaping. #52 Co-Authored-By: Claude Fable 5 <[email protected]>
Config mirrors the suite conventions (DB + Resolver required, BasePath, Chrome, CSRF, AutoMigrate) and wires avatar uploads to media.Ingest when both media stores are configured, storing the canonical URL media returns. Module.Card exposes the embeddable avatar+name unit; Module.Store exposes the data layer for host-side seeding during migrations from bespoke schemas. The end-to-end module test (gated on TEST_DATABASE_URL) drives a full save/view cycle, cross-user handle uniqueness, the card, the identicon, and migration idempotence against real Postgres. #52 Co-Authored-By: Claude Fable 5 <[email protected]>
Adds profile to go.work, the root Taskfile module list, and the CI matrix. The integration module gains shared-database coexistence checks (prefixed table + dedicated goose version table alongside contact's) and Postgres store tests covering upsert round-trips, claim-once handle semantics, cross-user uniqueness via the DB constraint, and avatar updates. #52 Co-Authored-By: Claude Fable 5 <[email protected]>
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
Implements #52: a new mountable
profilecomponent owning the public persona -- claimable handle, display name, markdown bio, avatar, and bio links -- keyed by an opaque host-supplied user key so the host's users table stays the host's FK hub.Shape
Follows the timeline/faq component pattern throughout:
New(Config)/Routes()/Migrate(ctx), host-suppliedprofileuser.Resolver, ui/document chrome with a per-requestChromehook, dedicatedprofile_goose_db_versiontable, sqlc + pgx/v5, handlers over a small store interface.CREATE EXTENSION). 3-32 chars, alphanumerics + interior hyphens; claim-once, admin-only rename; built-in reserved set (route words, authority names) extendable viaConfig.ReservedHandles. One deliberate deviation from the issue text, which said citext -- a mountable component should not assume extension-creation privileges.ui/markdown's untrusted-comment preset (safe-scheme links only).rel="me nofollow ugc".media.Ingest(re-encode, metadata strip, content-address); the profile stores the canonical URL media returns. Enabled only when both media stores are configured. Fallback is a deterministic SVG identicon derived from the handle, served with nosniff +default-src 'none'(no seed content is echoed into the SVG).Module.Card(ctx, userKey)renders the embeddable avatar+name unit for forum posts, rosters, and bylines.Open questions from #52, as resolved here
Testing
module_test.goend-to-end against Postgres (gated onTEST_DATABASE_URL): full save/view cycle, cross-user uniqueness, card, identicon, migration idempotence.task buildacross all modules.Closes #52
🤖 Generated with Claude Code