Dynamic feed and map icons - #451
Open
newmanw wants to merge 1 commit into
Open
Conversation
newmanw
force-pushed
the
feature/custom-feed-icon
branch
2 times, most recently
from
July 21, 2026 20:35
c7a55f1 to
583581b
Compare
restjohn
previously approved these changes
Jul 22, 2026
newmanw
force-pushed
the
feature/custom-feed-icon
branch
2 times, most recently
from
July 23, 2026 21:06
a0d9c94 to
80a1e89
Compare
newmanw
force-pushed
the
feature/custom-feed-icon
branch
from
July 27, 2026 18:40
80a1e89 to
d4d2f74
Compare
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
Feed and map icons are currently locked to whatever a service adapter hardcodes — there's no way for an admin to pick a custom icon for a feed or its map markers without shipping code. This PR makes feed/map icons dynamic and admin-configurable end to end: pick a registered icon, point at a source URL, or upload a file directly from the feed edit UI, with icons persisted server-side and rendered consistently across the feed panel, feed items, and the map.
What changed
Service
static_iconsMongo collection (migration032-add-static-icon-collection) with a unique/sparse index onsourceUrl, and a newSTATIC_ICON_WRITEpermission granted toADMIN_ROLE.entities.icons/app.api.icons/app.impl.iconsextended with aStaticIconStoreErrortype and richer error plumbing (iconSourceUrlFetchErrornow handlesnulland store errors, not just URL resolution failures) so failures fetching or storing icon content surface as properInfrastructureErrors instead of being swallowed as invalid input.adapters.icons.content_store.file_system,adapters.icons.controllers.web, andadapters.icons.db.mongooseupdated to support the new storage/lookup paths, with corresponding test coverage added/expanded.app.impl.feeds/app.tswire the icon service into the feed pipeline so a feed'smapStyle.iconis no longer restricted to a source-URL-only reference — it now accepts the sameStaticIconReferenceunion (registered id, source URL, or uploaded file) as the feed icon itself.Web app
feed-iconcomponent (core-lib/feed/feed-icon) — a standalone, reusable icon renderer that resolves anyIconReference(material icon name, registered icon id, source URL, or localFile) to a masked background image, handling blob URL lifecycle cleanup on destroy.static-icon-form-fieldreworked to support file uploads in addition to registered/source-URL icons:onSelectIconnow reads the chosen file, a newIconRefType.Fileform value round-trips through the reactive form, and icon preview resolution branches on file vs. remote fetch.feed.model.ts:MapStyle.iconwidened fromSourceUrlStaticIconReferenceto the fullStaticIconReference, andFeedPostnow also carries an optionalmapStyle, so admins can set a custom map marker icon at feed-creation/edit time, not just a display icon.admin-feed-edit-configuration,admin-feed-edit,feed-edit.model,feed-edit.service) updated to read/write the new icon reference shape and pass it through to the create/update feed request.feed-iconcomponent instead of ad-hoc image tags.Why this shape
StaticIconReference(rather than a separate map-specific icon type) keeps the icon-selection UX and validation identical whether you're picking a feed icon or a map icon — one form field, one component, one code path.feed-icon) rather than duplicated inline everywhere icons render, so blob URL cleanup and the id/sourceUrl/file/material-name branching logic lives in exactly one place.Test plan
service: run updated/added specs foradapters.icons.*,app.feeds, andapp.iconsweb-app: run specs forfeed-icon,static-icon-form-field,admin-feed-edit-configuration,feed-panel-tab,feed-item032on a dev Mongo instance: collection + index created,STATIC_ICON_WRITEadded toADMIN_ROLE, and confirmdowncleanly reverts the permission