Skip to content

feat: Use Gravatar (opt-in)#105

Merged
rbarker-dev merged 1 commit intomainfrom
104-move-to-use-gravatar-or-default-image
Feb 17, 2026
Merged

feat: Use Gravatar (opt-in)#105
rbarker-dev merged 1 commit intomainfrom
104-move-to-use-gravatar-or-default-image

Conversation

@rbarker-dev
Copy link
Contributor

Description

This pull request introduces Gravatar profile picture support, allow users to use their Gravatar avatar as their profile image throughout the application. It adds a useGravatar boolean field to user profiles, updates the database schema and API documentation, implements Gravatar URL helpers in both backend and frontend, and ensures proper UI integration and security policy updates. The most important changes are grouped below:

Backend: Gravatar Support & Data Model Updates

  • Added a useGravatar boolean field to the User and UserUpdate structs in internal/model/user.go, updated the ToUpdateMap method, and extended tests to cover this field. [1] [2] [3] [4] [5] [6]
  • Created a new internal/gravatar/gravatar.go helper to generate Gravatar URLs, along with comprehensive unit tests. [1] [2]

API & Documentation

  • Updated the OpenAPI spec (api/openapi.yaml) and database schema docs to include the useGravatar field, with descriptions and example usage. [1] [2] [3] [4]
  • Updated the project structure documentation to reflect the new Gravatar helper modules in both backend and frontend. [1] [2]

Frontend: UI and Logic Integration

  • Added a toggle in the profile edit form (profile.html, profile.css) for users to enable/disable Gravatar, and updated form handling logic to persist this preference. [1] [2] [3] [4] [5] [6]
  • Implemented Gravatar image application logic in the frontend (gravatar.ts), ensuring profile and navigation images use Gravatar when enabled. Updated relevant TypeScript files to use this logic and listen for profile changes. [1] [2] [3] [4] [5] [6]

Security and Policy

  • Updated the Content Security Policy (CSP) to allow images from https://gravatar.com and added corresponding tests to ensure the policy is enforced. [1] [2]

Testing

  • Added/updated tests for profile update handling, model changes, Gravatar URL generation, and CSP enforcement to ensure robust coverage of new functionality. [1] [2] [3] [4] [5] [6]

Related Issue(s)

Signed-off-by: Roger Barker <roger@pandaswhocode.com>
@rbarker-dev rbarker-dev self-assigned this Feb 17, 2026
@rbarker-dev rbarker-dev linked an issue Feb 17, 2026 that may be closed by this pull request
@github-actions github-actions bot added the feat label Feb 17, 2026
@rbarker-dev rbarker-dev merged commit ad6781c into main Feb 17, 2026
6 checks passed
@rbarker-dev rbarker-dev deleted the 104-move-to-use-gravatar-or-default-image branch February 17, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to use gravatar or default image.

1 participant