Skip to content

Add support for toggle select on mobile view#4416

Merged
ildyria merged 3 commits into
masterfrom
add-toggle-select-on-mobile
Jun 13, 2026
Merged

Add support for toggle select on mobile view#4416
ildyria merged 3 commits into
masterfrom
add-toggle-select-on-mobile

Conversation

@ildyria

@ildyria ildyria commented Jun 13, 2026

Copy link
Copy Markdown
Member

Fixes #1585

Summary by CodeRabbit

  • New Features

    • Touch-select mode for albums and photos with a header toggle, multi-select gestures, and context-menu integration
    • Visual selection indicators and overlays appear when touch-select mode is active
  • Localization

    • Added UI strings for toggling touch-select mode and for photo actions across many languages

@ildyria ildyria requested a review from a team as a code owner June 13, 2026 11:17
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 527c76ee-4c7e-45d7-8591-375ca26debc2

📥 Commits

Reviewing files that changed from the base of the PR and between dd3c877 and e2d1528.

📒 Files selected for processing (23)
  • lang/ar/gallery.php
  • lang/bg/gallery.php
  • lang/cz/gallery.php
  • lang/de/gallery.php
  • lang/el/gallery.php
  • lang/en/gallery.php
  • lang/es/gallery.php
  • lang/fa/gallery.php
  • lang/fr/gallery.php
  • lang/hu/gallery.php
  • lang/it/gallery.php
  • lang/ja/gallery.php
  • lang/nl/gallery.php
  • lang/no/gallery.php
  • lang/pl/gallery.php
  • lang/pt/gallery.php
  • lang/ru/gallery.php
  • lang/sk/gallery.php
  • lang/sv/gallery.php
  • lang/tr/gallery.php
  • lang/vi/gallery.php
  • lang/zh_CN/gallery.php
  • lang/zh_TW/gallery.php
✅ Files skipped from review due to trivial changes (15)
  • lang/es/gallery.php
  • lang/ru/gallery.php
  • lang/el/gallery.php
  • lang/sk/gallery.php
  • lang/pt/gallery.php
  • lang/vi/gallery.php
  • lang/zh_CN/gallery.php
  • lang/fr/gallery.php
  • lang/fa/gallery.php
  • lang/nl/gallery.php
  • lang/ar/gallery.php
  • lang/bg/gallery.php
  • lang/no/gallery.php
  • lang/hu/gallery.php
  • lang/pl/gallery.php
🚧 Files skipped from review as they are similar to previous changes (5)
  • lang/de/gallery.php
  • lang/zh_TW/gallery.php
  • lang/it/gallery.php
  • lang/tr/gallery.php
  • lang/cz/gallery.php

📝 Walkthrough

Walkthrough

This PR implements touch-select mode across the gallery: new togglable store flag and action, selection composables updated, thumbnail and list components render overlays/indicators and emit selection events, events propagate to AlbumPanel, header adds toggle and context-menu trigger, and translations added.

Changes

Touch-select mode for album and photo galleries

Layer / File(s) Summary
Store state and toggle action
resources/js/stores/ModalsState.ts
Store includes new is_touch_select_mode boolean flag and toggleTouchSelectMode() action that flips the flag and clears selections when disabling.
Photo and album selection composables
resources/js/composables/selections/selections.ts
photoSelect and albumSelect handlers now read is_touch_select_mode and treat it like Ctrl/Meta modifiers for individual item toggle selection, while preserving shift-based range selection when the mode is off.
Album thumbnail UI and emits
resources/js/components/gallery/albumModule/thumbs/AlbumThumb.vue, resources/js/components/gallery/albumModule/AlbumListItem.vue
AlbumThumb and AlbumListItem add touch-select overlays with selection indicators (check icons), new touchSelect/selected emit events, and maySelect handlers that route clicks based on mode state.
Album component event hierarchy
resources/js/components/gallery/albumModule/AlbumThumbPanelList.vue, resources/js/components/gallery/albumModule/AlbumListView.vue, resources/js/components/gallery/albumModule/AlbumThumbPanel.vue, resources/js/components/gallery/albumModule/AlbumPanel.vue
Selection events from thumbnails bubble through the view hierarchy; AlbumPanel wires AlbumHeader's open-context-menu event to a handler that opens photo or album context menu based on current selection.
Photo thumbnail UI and selection
resources/js/components/gallery/albumModule/PhotoThumbPanelList.vue, resources/js/components/gallery/albumModule/thumbs/PhotoThumb.vue
PhotoThumbPanelList checks is_touch_select_mode in selection handler; PhotoThumb renders conditional touch-select indicator overlay with styling based on isSelected prop.
Header UI: touch-device toggle and context menu
resources/js/components/headers/AlbumHeader.vue
Header adds touch-device selection toggle button (visible when isTouchDevice()) with dynamic icons, and conditional context-menu ellipsis button that emits openContextMenu event based on selection state.
UI translation strings
lang/en/gallery.php, lang/*/gallery.php
Added toggle_touch_select and photo_actions localization keys under the album array across locales.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes


Poem

🐰 I tapped the albums, one, two, three,
A little hop, a gentle key.
Checks appeared like moonlit dots,
I boxed my memories, tied with lots.
Hooray — touch selects for you and me!

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
resources/js/components/gallery/albumModule/AlbumThumbPanel.vue (1)

30-87: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Timeline view sections missing @selected event handlers.

The non-timeline grid view (lines 17, 25) correctly wires @selected="propagateSelected" to both AlbumListView and AlbumThumbPanelList. However, the timeline view sections have four instances of these components (lines 43-49, 51-57, 69-75, 77-83) that are missing the @selected handler. This means touch-select mode will not work when the timeline view is active, breaking the feature for users with timeline enabled.

🔧 Proposed fix

Add @selected="propagateSelected" to all four timeline component instances:

 <AlbumListView
   v-if="album_view_mode === 'list'"
   :albums="slotProps.item.data"
   :selected-ids="props.selectedAlbums"
   `@clicked`="propagateClicked"
+  `@selected`="propagateSelected"
   `@contexted`="propagateContexted"
 />

 <AlbumThumbPanelList
   v-else
   :albums="slotProps.item.data"
   :selected-albums="props.selectedAlbums"
   `@clicked`="propagateClicked"
+  `@selected`="propagateSelected"
   `@contexted`="propagateContexted"
 />

Repeat for the v-else section at lines 69-83.

🧹 Nitpick comments (1)
resources/js/components/gallery/albumModule/AlbumThumbPanel.vue (1)

123-125: 💤 Low value

Consider adding propagateSelected to the usePropagateAlbumEvents composable.

The existing propagateClicked and propagateContexted handlers are provided by the usePropagateAlbumEvents composable (line 121), but propagateSelected is manually defined here with identical logic. This creates minor code duplication and pattern inconsistency.

♻️ Suggested refactor

Add propagateSelected to the composable and destructure it on line 121:

-const { propagateClicked, propagateContexted } = usePropagateAlbumEvents(emits);
+const { propagateClicked, propagateSelected, propagateContexted } = usePropagateAlbumEvents(emits);

Then remove lines 123-125.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 36cadd23-d18a-4b27-adc6-d292695b1ff3

📥 Commits

Reviewing files that changed from the base of the PR and between 079839a and 9465021.

📒 Files selected for processing (12)
  • lang/en/gallery.php
  • resources/js/components/gallery/albumModule/AlbumListItem.vue
  • resources/js/components/gallery/albumModule/AlbumListView.vue
  • resources/js/components/gallery/albumModule/AlbumPanel.vue
  • resources/js/components/gallery/albumModule/AlbumThumbPanel.vue
  • resources/js/components/gallery/albumModule/AlbumThumbPanelList.vue
  • resources/js/components/gallery/albumModule/PhotoThumbPanelList.vue
  • resources/js/components/gallery/albumModule/thumbs/AlbumThumb.vue
  • resources/js/components/gallery/albumModule/thumbs/PhotoThumb.vue
  • resources/js/components/headers/AlbumHeader.vue
  • resources/js/composables/selections/selections.ts
  • resources/js/stores/ModalsState.ts

Comment thread resources/js/components/headers/AlbumHeader.vue

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4d584224-728d-4e24-9bf1-f08dc43b7a34

📥 Commits

Reviewing files that changed from the base of the PR and between 9465021 and dd3c877.

📒 Files selected for processing (23)
  • lang/ar/gallery.php
  • lang/bg/gallery.php
  • lang/cz/gallery.php
  • lang/de/gallery.php
  • lang/el/gallery.php
  • lang/es/gallery.php
  • lang/fa/gallery.php
  • lang/fr/gallery.php
  • lang/hu/gallery.php
  • lang/it/gallery.php
  • lang/ja/gallery.php
  • lang/nl/gallery.php
  • lang/no/gallery.php
  • lang/pl/gallery.php
  • lang/pt/gallery.php
  • lang/ru/gallery.php
  • lang/sk/gallery.php
  • lang/sv/gallery.php
  • lang/tr/gallery.php
  • lang/vi/gallery.php
  • lang/zh_CN/gallery.php
  • lang/zh_TW/gallery.php
  • resources/js/components/gallery/albumModule/thumbs/AlbumThumb.vue
✅ Files skipped from review due to trivial changes (10)
  • lang/no/gallery.php
  • lang/es/gallery.php
  • lang/pl/gallery.php
  • lang/it/gallery.php
  • lang/nl/gallery.php
  • lang/sk/gallery.php
  • lang/fr/gallery.php
  • lang/ru/gallery.php
  • lang/sv/gallery.php
  • lang/tr/gallery.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/js/components/gallery/albumModule/thumbs/AlbumThumb.vue

Comment thread lang/pt/gallery.php Outdated
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.44%. Comparing base (079839a) to head (e2d1528).
⚠️ 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 merged commit 0ef93cc into master Jun 13, 2026
45 checks passed
@ildyria ildyria deleted the add-toggle-select-on-mobile branch June 13, 2026 17:30
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.

[Enhancement] Select multiple photos on mobile

1 participant