fix(timeline): CodeRabbit review corrections
- Fix cols overflow: use (containerWidth - GAP) formula so the grid
never exceeds the container width
- Explicitly pin "unknown" date keys to the end of the sort rather than
relying on alphabetical accident ("u" > digits)
- Guard buildLabel against non-YYYY-MM keys with finite/range checks
and an isNaN fallback to "Unknown Date"
- Clear similarSourceFolderId, similarFolderId, and similarCrop when
switching to the timeline view so all similar-state is consistently
reset
This commit is contained in:
+1
-1
@@ -906,7 +906,7 @@ export const useGalleryStore = create<GalleryState>((set, get) => ({
|
||||
|
||||
setView: (activeView) => {
|
||||
if (activeView === "timeline") {
|
||||
set({ activeView, sort: "taken_asc", images: [], loadedCount: 0, collectionTitle: null, similarSourceImageId: null, similarHasMore: false, imageLoadError: null });
|
||||
set({ activeView, sort: "taken_asc", images: [], loadedCount: 0, collectionTitle: null, similarSourceImageId: null, similarSourceFolderId: null, similarFolderId: null, similarHasMore: false, similarCrop: null, imageLoadError: null });
|
||||
void get().loadImages(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user