From 4a19699e8f3d9879debef077414360e977311de2 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 1 Feb 2026 00:25:09 -0500 Subject: [PATCH] feat(templates): add types for progress, unlinked books, and shelf mappings Add template data types for Phase 9 frontend features: - ProgressItemData: For reading progress visualization with sync source - UnlinkedBookData: For unmatched books requiring manual linking - PotentialMatchData: For book matching suggestions - DeviceShelfMappingData: For collection-to-shelf mappings Also adds Theme field to User type for theme support. --- templates/types.go | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/templates/types.go b/templates/types.go index f8c2d62..9605fb2 100644 --- a/templates/types.go +++ b/templates/types.go @@ -5,6 +5,7 @@ type User struct { Username string Email string Role string + Theme string } type PageData struct { @@ -76,3 +77,49 @@ type QueueItemData struct { Attempts int32 CreatedAt string } + +type DeviceShelfMappingData struct { + ID string + CollectionID string + CollectionName string + DeviceShelfName string + SyncDirection string + CreatedAt string +} + +type ProgressItemData struct { + MediaItemID string + Title string + Author string + CoverImagePath string + CurrentPage int32 + TotalPages int32 + ProgressPercentage float64 + LastUpdated string + DeviceName string + DeviceType string + DeviceIcon string + EpubCFI string +} + +type UnlinkedBookData struct { + ProgressID string + DeviceID string + DeviceType string + DeviceName string + FilePath string + SHA256 string + TitleFromDevice string + LastSyncTime string + ConfidenceScore float64 + PotentialMatches []PotentialMatchData +} + +type PotentialMatchData struct { + MediaItemID string + Title string + Author string + CoverImagePath string + MatchMethod string + Confidence float64 +}