Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add album keyboard shortcuts #16442

Conversation

knechtandreas
Copy link
Contributor

@knechtandreas knechtandreas commented Mar 1, 2025

Description

This PR adds some new keyboard shortcuts. Namely you can now hit 'l' or 'Shift' + 'l' from the single asset viewer to open the 'Add to album/shared album' modals. The modals have been improved as well such that up and down arrows can be used to select a specific album/create a new album. This makes organizing photos into albums much faster!

Here's a quick demo video of the changes:
https://www.youtube.com/watch?v=JHSzuAeZ2RU

Fixes #15712

I'll do a separate PR to make this work in bulk as well (by using 'x' and arrows to select photos from the timeline).

This is my first change in Immich and I'm a little rusty when it comes to coding, so please feel free to point out any improvements. I felt that the AddAlbumModal logic was a bit complex already (and distributed in templating code). I didn't really want to add to this, so I re-factored the logic of what to display in the modal out into a separate class and wrote a unit test for it.

How Has This Been Tested?

Lots of manual testing and I wrote a fairly detailed unit test to test what the add album modal displays as well as selecting different rows.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services)

@@ -0,0 +1,39 @@
<script lang="ts">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this out into its own component, since it now has to do selection and scrolling as well.

@@ -31,26 +34,53 @@
loading = false;
});

let filteredAlbums = $derived(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A lot of this logic was moved into the AlumModalRowConverter class, which is now unit tested.

@knechtandreas knechtandreas marked this pull request as ready for review March 1, 2025 01:01
@bo0tzz bo0tzz changed the title Feat/15712 add album keyboard shortcuts feat: add album keyboard shortcuts Mar 1, 2025
@knechtandreas
Copy link
Contributor Author

Sorry, a little new to the process here - what's the process for adding reviewers? Do I have to add some people, or do people just jump in themselves ?

@alextran1502
Copy link
Contributor

We will get to the PR. Thank you for your contribution

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ugh - as part of the PR feedback I've cleaned up the file/package names so it's all consistently called album-select-* now. I moved this file into the album-selection package as well, but for some reason the github review picks it up as a delete & add. The individual commit even shows it as a move: 2d2b074 🤷

Copy link
Contributor

@alextran1502 alextran1502 left a comment

Choose a reason for hiding this comment

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

Great execution, thank you!

@alextran1502 alextran1502 enabled auto-merge (squash) March 2, 2025 13:12
@alextran1502 alextran1502 merged commit 6bf2e8d into immich-app:main Mar 2, 2025
36 checks passed
knechtandreas added a commit to knechtandreas/immich that referenced this pull request Mar 2, 2025
…n-grid

* main: (22 commits)
  feat: add album keyboard shortcuts (immich-app#16442)
  fix(web): Default to context search on web (immich-app#16485)
  fix(mobile): Updated formatting of server address in networking (immich-app#16483)
  chore(mobile): rename log enum to lowercase (immich-app#16476)
  fix(web): Open huggingface.co link on settings page in new tab (immich-app#16470)
  fix(web): fix typos (immich-app#16466)
  fix(web): Fixed people list overflowing in advanced search (immich-app#16457)
  fix(web): unable to download live photo as anonymous user (immich-app#16455)
  fix(mobile): fix typos (immich-app#16456)
  chore: add 'not duplicate' checkbox to issue template (immich-app#16462)
  chore(mobile): post release task (immich-app#16437)
  feat(server): Shortened asset ID in storage template (immich-app#16433)
  chore: version v1.128.0
  fix: memories off by one (immich-app#16434)
  fix(server): stringify error log parameter to ensure correct overload (immich-app#16422)
  fix: duplicate memories (immich-app#16432)
  chore(server): trash e2e cleanup (immich-app#16423)
  fix(server): include deleted assets if searching offline assets (immich-app#16417)
  fix: user delete sync query sort by id (immich-app#16420)
  fix(mobile): background backup failing due to store (immich-app#16418)
  ...
@psla
Copy link

psla commented Mar 10, 2025

Amazing, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants