Skip to content

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Jan 14, 2026

Summary by CodeRabbit

  • New Features

    • Star-rating filter UI added with clickable/keyboard-accessible stars.
    • Interactive 5-star photo rating input shown for eligible users.
    • Photo store now supports a rating filter and filtered views.
  • Documentation

    • Multiple feature specs marked Implemented; roadmap and architecture map updated.
  • Localization

    • Added rating filter translation keys across all supported languages.
  • Refactor

    • Selection and event handling migrated from index-based to ID-based (numeric → string IDs).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

Multiple docs updated; new gallery filter translations added across languages; photo rating UI and store filtering introduced; selection system migrated from index-based to ID-based across components, composables, and stores; several Vue components adjusted to emit/accept IDs instead of numeric indices.

Changes

Cohort / File(s) Summary
Spec docs
docs/specs/4-architecture/features/001-photo-star-rating/spec.md, .../002-worker-mode/spec.md, .../003-album-computed-fields/spec.md, .../004-album-size-statistics/spec.md, .../006-photo-rating-filter/spec.md, .../008-shared-albums-visibility/spec.md, .../009-rating-ordering/spec.md
Updated status/timestamps (Draft → Implemented / In Progress) and last-updated dates; no functional changes.
Feature tasks & roadmap
docs/specs/4-architecture/features/006-photo-rating-filter/tasks.md, docs/specs/4-architecture/roadmap.md, docs/specs/4-architecture/knowledge-map.md
Task checklists updated to implemented/completed, roadmap/knowledge-map updated with feature progress and new PhotoThumbPanelControl/PhotosState entries.
Translations (gallery)
lang/{ar,cz,de,el,en,es,fa,fr,hu,it,ja,nl,no,pl,pt,ru,sk,sv,vi,zh_CN,zh_TW}/gallery.php
Added top-level filter (or layout.filter) group with by_rating and n_stars_or_higher keys in ~21 language files.
Photo rating UI & overlay
resources/js/components/gallery/albumModule/PhotoThumbPanelControl.vue, resources/js/components/gallery/photoModule/PhotoRatingOverlay.vue, resources/js/components/icons/StarRow.vue
Added star-rating filter UI (5 interactive stars, keyboard/ARIA support); overlay now supports interactive rating submission and hover state; small styling tweak in StarRow.
Photo store additions
resources/js/stores/PhotosState.ts
Added PhotoRatingFilter type, photoRatingFilter state, setPhotoRatingFilter action, and getters hasRatedPhotos, filteredPhotos, filteredPhotosTimeline.
Selection refactor — components
resources/js/components/gallery/albumModule/{AlbumPanel.vue,AlbumThumbPanel.vue,AlbumThumbPanelList.vue,PhotoThumbPanel.vue,PhotoThumbPanelList.vue}, resources/js/components/gallery/thumbs/PhotoThumb.vue
Migrated props/emits from index-based to id-based: removed idxShift/iter/isLazy where noted, added isInteractive? prop, updated emits payloads to use id: string and updated template bindings.
Selection refactor — views & panels
resources/js/views/gallery-panels/{Albums.vue,Favourites.vue,Search.vue,Timeline.vue}, resources/js/components/gallery/searchModule/ResultPanel.vue, resources/js/components/gallery/tagModule/TagPanel.vue
Updated useSelection/useContextMenu destructuring and handler names; photoClick / routing now accept photoId: string; renamed bindings (photoSelectselectPhoto, photoMenuOpencontextMenuPhotoOpen, albumMenuOpencontextMenuAlbumOpen, albumClickalbumSelect).
Selection refactor — composables & stores
resources/js/composables/album/dragAndSelect.ts, resources/js/composables/contextMenus/contextMenu.ts, resources/js/composables/selections/selections.ts, resources/js/stores/ModalsState.ts, resources/js/stores/...
Replaced index-based selection fields (selectedPhotosIdx, selectedAlbumsIdx) with ID-based counterparts (selectedPhotosIds, selectedAlbumsIds); updated helpers (e.g., reduceIntersection) and public APIs to accept/return IDs; adjusted context menu handlers to operate on IDs.
Rating logic
resources/js/composables/photo/useRating.ts
Clicking the current rating now clears it (toggle off); toast duration shortened from 3000ms to 1000ms.
Small/ancillary edits
resources/js/components/gallery/albumModule/AlbumPanel.vue, other listed components
Various renames, event-handler remaps, and routing updates to align with id-based selection and new composition outputs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 I hopped from indices to names,
Five little stars now play bright games,
In many tongues the labels sing,
IDs parade — a tidy spring,
I nibbled bugs and left a trail of light.

🚥 Pre-merge checks | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.07%. Comparing base (566db27) to head (52ebb14).
⚠️ Report is 2 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria marked this pull request as ready for review January 23, 2026 21:05
@ildyria ildyria requested a review from a team as a code owner January 23, 2026 21:05
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 13

🧹 Nitpick comments (8)
lang/de/gallery.php (1)

64-67: Consider localizing the new filter strings for German UI consistency.
If German translations are available, replacing the English labels will keep the locale experience consistent with other translated entries.

lang/es/gallery.php (1)

65-68: Consider localizing the new filter strings for Spanish UI consistency.
If translations are available, replacing the English labels will improve the Spanish locale experience.

lang/vi/gallery.php (1)

65-68: Consider localizing the new filter strings for Vietnamese UI consistency.
If translations are available, replacing the English labels will improve the Vietnamese locale experience.

resources/js/components/gallery/albumModule/PhotoThumbPanelControl.vue (1)

3-7: Keep the filter controls visible when a filter is active.
If photoRatingFilter stays set while hasRatedPhotos is false, the UI disappears and users can’t clear the filter. Consider gating on either condition.

♻️ Suggested adjustment
-		v-if="photosStore.hasRatedPhotos"
+		v-if="photosStore.hasRatedPhotos || photosStore.photoRatingFilter !== null"
resources/js/composables/album/dragAndSelect.ts (1)

230-242: Consider indexing selectables to avoid O(n²) lookups.

For large albums, repeated find calls can get expensive. A small Map-based index keeps this O(n).

♻️ Proposed refactor
 function reduceIntersection<Model extends { id: string }>(
 	intersection: string[],
 	selectables: Model[],
 	validator: (i: Model) => boolean,
 ): string[] {
-	return intersection.reduce((result: string[], id) => {
-		const item = selectables.find((p) => p.id === id && validator(p));
-		if (item) {
-			result.push(item.id);
-		}
-		return result;
-	}, []);
+	const byId = new Map(selectables.map((item) => [item.id, item]));
+	return intersection.reduce((result: string[], id) => {
+		const item = byId.get(id);
+		if (item && validator(item)) {
+			result.push(item.id);
+		}
+		return result;
+	}, []);
 }
resources/js/views/gallery-panels/Favourites.vue (1)

92-104: Consider converting async/await to .then() pattern.

As per coding guidelines, Vue3 components should avoid async/await and use .then() instead. This applies to the onMounted callback.

♻️ Suggested refactor
-onMounted(async () => {
-	const results = await Promise.allSettled([layoutStore.load()]);
-
-	results.forEach((result, index) => {
-		if (result.status === "rejected") {
-			console.warn(`Promise ${index} reject with reason: ${result.reason}`);
-		}
-	});
-
-	if (results.every((result) => result.status === "fulfilled")) {
-		setScroll();
-	}
-});
+onMounted(() => {
+	Promise.allSettled([layoutStore.load()]).then((results) => {
+		results.forEach((result, index) => {
+			if (result.status === "rejected") {
+				console.warn(`Promise ${index} reject with reason: ${result.reason}`);
+			}
+		});
+
+		if (results.every((result) => result.status === "fulfilled")) {
+			setScroll();
+		}
+	});
+});
resources/js/stores/ModalsState.ts (1)

57-58: Consider renaming for consistency.

The properties nonHoverSelectablePhotosIdx and nonHoverSelectableAlbumsIdx store string IDs (per the type annotation string[]), but the Idx suffix suggests numeric indices. For consistency with the new selectedPhotosIds/selectedAlbumsIds naming, consider renaming these to nonHoverSelectablePhotosIds and nonHoverSelectableAlbumsIds.

resources/js/components/gallery/albumModule/AlbumThumbPanelList.vue (1)

33-45: Prefer function declarations for handlers.

Switch maySelect and menuOpen to function declarations per Vue coding guidelines.

♻️ Suggested refactor
-const maySelect = (id: string, e: MouseEvent) => {
+function maySelect(id: string, e: MouseEvent) {
  if (props.isInteractive === false) {
    return;
  }
  emits("clicked", id, e);
-};
+}
 
-const menuOpen = (id: string, e: MouseEvent) => {
+function menuOpen(id: string, e: MouseEvent) {
  if (props.isInteractive === false) {
    return;
  }
  emits("contexted", id, e);
-};
+}

As per coding guidelines, avoid const fn = () => {} in Vue components.

@ildyria ildyria merged commit c0741fd into master Jan 23, 2026
43 checks passed
@ildyria ildyria deleted the rating-sorting branch January 23, 2026 22:06
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