Add profile picture library with multi-upload and dataset propagation#116
Merged
Conversation
Public site now honors the "Show profile picture" toggle across /, /<lang>, and /v/<slug>. Also reshapes the single-file picture model into a library modeled on the existing logo system so users can: - Upload multiple pictures and pick any of them from a grid - Enable "Apply to all datasets" (default on) to mirror the current picture across every saved dataset snapshot - Disable the toggle to keep per-dataset pictures; language siblings added to a dataset inherit the sibling's picture via the existing sibling copy - Delete unused library entries; in-use entries return 409 - Reuse pictures via a new `/api/profile-pictures` library plus `/api/profile/picture/select` endpoint The legacy `uploads/picture.jpeg` is promoted to a first-class library entry on first run so existing installs keep their picture. https://claude.ai/code/session_01PtvFP46WXZ9FsPrsq9nmTu
When the user uploads, selects, or removes a profile picture while editing a localized dataset, every language sibling in the same language_group now receives the same filename even when the "Apply to all datasets" toggle is off. Unrelated datasets stay on their own picture. The admin now passes the active dataset id with each picture operation so the server can look up the sibling group and mirror the change. https://claude.ai/code/session_01PtvFP46WXZ9FsPrsq9nmTu
Previously, enabling "Open to Work" while disabling "Show profile picture" left the colored gradient circle visible in the header, because the OTW overlay was forcing the profile-image container to `display: flex` to give the badge a host element. The OTW badge is decoration on the picture, so it no longer renders when the picture is hidden. Disabling the picture now really removes the entire header circle on both admin and public-readonly renderers. https://claude.ai/code/session_01PtvFP46WXZ9FsPrsq9nmTu
Collapse 1.32.0 / 1.32.1 / 1.32.2 into a single 1.32.0 entry so the feature and its follow-up fixes ship as one version. No functional change. https://claude.ai/code/session_01PtvFP46WXZ9FsPrsq9nmTu
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.
Description
Implements a profile picture library system that allows users to upload and manage multiple profile pictures, similar to the existing company logo library. Key features include:
profile_<timestamp>.<ext>in the uploads directorypicture_propagateflag (default: enabled) that mirrors the active picture filename into all saved dataset snapshots when toggled onuploads/picture.jpeginto the new library format on first runprofile_picture_enabled,picture_filename) are now exposed in public/api/profileand/api/cvendpointsType of Change
Implementation Details
Backend Changes (
src/server.js)picture_filenameandpicture_propagatecolumns to the profile table with migrationsPOST /api/profile/picture— upload a new picture (stored with timestamp)PUT /api/profile/picture/select— reuse an existing picture from the libraryGET /api/profile-pictures— list all pictures within_useflagDELETE /api/profile-pictures/:filename— delete unused pictures (returns 409 if in use)propagateProfilePictureToDatasets()helper mirrors filename changes into all saved dataset snapshots when enabledisValidProfilePictureName()to prevent directory escape attacksFrontend Changes (
public/shared/admin.js)uploadProfilePicture()refactored to handle three modes: new upload, reuse from library, or deleteshowPicturePicker(),selectExistingPicture(),deleteUnusedPicture()functions manage library interactionsPublic Display (
public-readonly/index.html,public/shared/scripts.js)picture_filenamefrom the database instead of hardcodedpicture.jpegprofile_picture_enabledflag to show/hide the picture containerInternationalization
form.apply_picture_globallyform.delete_pictureform.no_pictures_availableTests
in_useflagChecklist
npm test— 13 new tests added to backend.test.js)package.json(1.31.0 → 1.32.0),version.json(1.31.0 → 1.32.0)CHANGELOG.mdupdated with new entry under [1.32.0]t()function and i18n keysencodeURIComponent()in URLshttps://claude.ai/code/session_01PtvFP46WXZ9FsPrsq9nmTu