Skip to content

Add Admin > Edit Album XML#697

Merged
danactive merged 35 commits intomainfrom
feature/admin-edit
Feb 5, 2026
Merged

Add Admin > Edit Album XML#697
danactive merged 35 commits intomainfrom
feature/admin-edit

Conversation

@danactive
Copy link
Owner

@danactive danactive commented Jan 31, 2026

…iltered view, while Clear anchors you to the photo while blowing away the filters.
@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
history Ready Ready Preview, Comment Feb 4, 2026 2:17am

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reintroduces and expands “Admin > Edit Album” functionality (dropped in v12) by adding raw XML fetching/editing and XML regeneration, alongside related navigation/search/map-filter UX improvements.

Changes:

  • Add Admin “Edit Album” raw-XML workflow: fetch raw album XML, edit fields (incl. geo/ref), multi-select edits, and generate copy/paste-ready XML.
  • Refactor shared item aggregation and improve search/map-filter UX (bookmarking, clear behavior, map filter toggle UI).
  • Update types/utilities to support raw vs camel-cased XML shapes and centralize search/reference helpers.

Reviewed changes

Copilot reviewed 40 out of 42 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/utils/search.ts Extracts matchCorpus boolean-search helper from hook for reuse/perf.
src/utils/reference.ts Centralizes reference URL building + XML ref transform.
src/types/common.d.ts Adds RawXmlItem/RawXmlAlbum and generalized XML casing types.
src/models/album.ts Makes XML transforms more tolerant (caption/city/title) and uses centralized reference transform.
src/models/tests/album.test.ts Updates tests to use new reference utility.
src/lib/xml.ts Adds raw XML parse options and overloads readAlbum for raw parsing.
src/lib/persons.ts Refactors to reuse shared “get all items” utility.
src/lib/paths.ts Adds shared helpers for photo/thumb/video paths.
src/lib/get-all-items.ts Adds shared item aggregation + keyword indexing helpers and mappers.
src/lib/generate-clusters.ts Minor refactor to avoid redundant H3 resolution caching.
src/lib/all.ts Refactors /all data generation to use shared helper.
src/hooks/useSearch.tsx Adds bookmarking + clear behavior changes; moves match logic to utility; new displayed-items plumbing.
src/hooks/usePersonsFilter.tsx Exposes new map-filter clearing state/coordinates.
src/hooks/useMemory.tsx Opens reference links in a new tab.
src/hooks/useMapFilter.ts Adds clear-state handling, displayed-items propagation, and faster selected-id lookup.
src/hooks/useBookmark.tsx Adds bookmark button to copy/update ?select= URL.
src/hooks/tests/useSearch.vitest.tsx Updates tests for new clear behavior and filename-based selection.
src/hooks/tests/useMemoryAndMapFilter.test.tsx Updates mock to match new useSearch return shape.
src/components/ThumbImg/styles.module.css Adds multi-select highlight style.
src/components/ThumbImg/index.tsx Adds multi-select styling and passes click event through.
src/components/SplitViewer/index.tsx Adjusts map centroid behavior during filter/clear.
src/components/SlippyMap/styles.module.css Adds CSS module styling for map filter toggle button.
src/components/SlippyMap/options.ts Minor precedence fix when choosing labels.
src/components/SlippyMap/index.tsx Replaces div-with-role with actual <button> and CSS module styling.
src/components/Persons/PersonsClient.tsx Adds ?select= handling to position gallery by filename.
src/components/All/Items.tsx Changes select-linking to use filename for global uniqueness.
src/components/All/AllClient.tsx Adds ?select= handling to position gallery by filename.
src/components/Album/AlbumClient.tsx Updates ?select= behavior to match filename-based selection and mark viewed.
src/components/AdminAlbum/useGeoCopy.tsx Adds geo clipboard helper (coords/Google Maps URL).
src/components/AdminAlbum/useEditCountPill.tsx Tracks edits across items and displays edits-since-generation pill; applies edits for XML generation.
src/components/AdminAlbum/Xml.tsx Removes old JSON textarea component.
src/components/AdminAlbum/Thumbs.tsx Reworks admin thumbs to operate on raw XML items and support multi-select.
src/components/AdminAlbum/Photo.tsx Updates admin photo rendering to use new path helpers and raw XML items.
src/components/AdminAlbum/Fields.tsx Adds full admin editing UI, geo/ref handling, keyword autocomplete, and XML generation output.
src/components/AdminAlbum/AdminAlbumClient.tsx Adds admin edit page logic: search by filename, keyboard navigation, multi-select editing, and XML loading.
package.json Bumps version and dependency versions.
package-lock.json Updates lockfile for dependency bumps.
app/global.css Moves mapbox control container hiding to global CSS.
app/api/admin/xml/[gallery]/[album]/route.ts Adds API route to fetch raw album XML.
app/api/admin/search/route.ts Adds API route to search filenames across galleries/albums.
app/api/admin/keywords/route.ts Adds API route to fetch indexed keywords for autocomplete.
CHANGELOG.md Adds v12.3.0 changelog entries reflecting new features/fixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danactive
Copy link
Owner Author

Addressed review comments:

  • useSearch.tsx: Synced visibleCount in useEffect when filtered.length changes (no state update during render). handleClear now proceeds without currentItem: clears keyword/map and updates URL to pathname when no identifier.
  • paths.ts: filenameAsJpg replaces only the final extension via lastIndexOf/slice. rasterPath and getVideoPaths use ternary so year is always a string.
  • reference.ts: buildReferenceUrl now encodes name with encodeURIComponent; return type simplified to string.
  • useMemory.tsx: Added rel="noopener noreferrer" to Link with target=_blank.
  • xml.ts: readAlbum uses rawParser when options === rawParseOptions, otherwise existing parser logic.
  • SplitViewer: Added dynamicCentroid to the clear-lock effect dependency array.
  • AdminAlbumClient: Removed unused searchResults state; handleSearch no longer uses setTimeout/mutate—sets album and currentIndex so effect picks up when data arrives. Use of searchResults removed.
  • useGeoCopy.tsx & Fields.tsx: Added aria-label to IconButtons that only show emoji.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 44 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@danactive danactive merged commit 66e2a55 into main Feb 5, 2026
24 checks passed
@danactive danactive deleted the feature/admin-edit branch February 9, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants