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(mobile): Home screen customization options #1563

Merged
merged 15 commits into from
Feb 9, 2023

Conversation

matthinc
Copy link
Contributor

@matthinc matthinc commented Feb 5, 2023

This PR brings some minor improvements to the main asset grid:

  • Fix: Changing preferences is faster now and does not result in endless "Building asset grid" loops any more
  • Staggered layout: An alternative layout where photos are scaled according to their aspect ratio
  • Group by months instead of days setting: Useful for users with few assets
  • Minor refactorings and clean-ups
  • Rename DayTitleText to GroupDividerTitle

Screenshot 2023-02-05 at 21 35 21

Screenshot 2023-02-06 at 20 53 11

Screenshot 2023-02-08 at 22 25 17

Screenshot_2023-02-08_at_22_25_03

@vercel
Copy link

vercel bot commented Feb 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
immich-code-coverage ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 9, 2023 at 5:10PM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
immich ⬜️ Ignored (Inspect) Feb 9, 2023 at 5:10PM (UTC)

@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 6, 2023 19:56 Inactive
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 6, 2023 20:15 Inactive
@matthinc
Copy link
Contributor Author

matthinc commented Feb 6, 2023

I removed ref.invalidate(assetProvider) from the asset grid related settings and instead just trigger a rebuild of the asset grid data structure. This brings noticeable performance benefits.

@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 8, 2023 12:21 Inactive
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 8, 2023 21:25 Inactive
@matthinc matthinc marked this pull request as ready for review February 8, 2023 21:41
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 8, 2023 21:41 Inactive
martyfuhry
martyfuhry previously approved these changes Feb 9, 2023
Copy link
Contributor

@martyfuhry martyfuhry left a comment

Choose a reason for hiding this comment

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

Excellent! Works great for me. I wish I could think of a better name than "Dynamic layout", though...

All of my comments are super nit-picky and not concerning at all. I just wanted to call attention to a few places which may make maintenance simpler later.

@@ -12,6 +12,10 @@
"album_viewer_appbar_share_leave": "Leave album",
"album_viewer_appbar_share_remove": "Remove from album",
"album_viewer_page_share_add_users": "Add users",
"asset_list_layout_settings_dynamic_layout_title": "Dynamic layout",
Copy link
Contributor

Choose a reason for hiding this comment

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

Got a better name than "Dynamic layout"? I can't think of anything, but maybe someone more creative than I am can...

Copy link
Contributor

Choose a reason for hiding this comment

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

Great Scott! "Creative Layout"! Or Proportional? Adaptive? Smart?

bool last = asset.id == row.assets.last.id;

return Container(
key: Key("asset-${asset.id}"),
width: size,
width: size * row.widthDistribution[index],
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a safe access, too? It looks good, but it's not immediately obvious to me why row.widthDistribution.length is related to row.assets.length.

@martyfuhry
Copy link
Contributor

martyfuhry commented Feb 9, 2023

Oh shoot, my wife found a bug:
image

I've enabled "Group by month" here. But both are labeled "February 2023" when the lower one should be "January 2023".

She wants contribution credit.

@martyfuhry

This comment was marked as outdated.

@martyfuhry martyfuhry dismissed their stale review February 9, 2023 02:44

Found a few bugs.

@matthinc
Copy link
Contributor Author

matthinc commented Feb 9, 2023

The "slide up to see exif data panel" is broken.

image

That's another "debug only error" because some key is missing in some JSON response.

@martyfuhry
Copy link
Contributor

That's another "debug only error" because some key is missing in some JSON response.

I wondered that. But it's broken in profile, too. Wouldn't those asserts be stripped in a profile run? I'll try it against main later to be sure.

@martyfuhry
Copy link
Contributor

That's another "debug only error" because some key is missing in some JSON response.

I wondered that. But it's broken in profile, too. Wouldn't those asserts be stripped in a profile run? I'll try it against main later to be sure.

It's busted in main, too. So I'm not concerned with it here. Sorry for the distraction!

@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 14:52 Inactive
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 14:57 Inactive
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 15:00 Inactive
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 15:02 Inactive
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 15:20 Inactive
@matthinc
Copy link
Contributor Author

matthinc commented Feb 9, 2023

Thanks @martyfuhry for sorting out the timezone related bug.

@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 15:25 Inactive
@matthinc matthinc changed the title feat(mobile): Staggered Home Layout feat(mobile): Home screen customization options Feb 9, 2023
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 15:35 Inactive
@vercel vercel bot temporarily deployed to Preview – immich-code-coverage February 9, 2023 17:10 Inactive
@alextran1502 alextran1502 merged commit fd13265 into main Feb 9, 2023
@alextran1502 alextran1502 deleted the feat/staggered-home-layout branch February 9, 2023 17:35
samip5 pushed a commit to samip5/immich that referenced this pull request Feb 9, 2023
* Try staggered layout for home page

* Introduce setting for dynamic layout

* Fix some provider related bugs

* Make asset grouping configurable

* Add translation keys, refactor group title

* Rename enum values

* Fix enum names

* Reformat long if statement

* Fix timezone related bug

* Minor clean up

* Fix unit test

* Add second assets check back to home screen
alextran1502 added a commit that referenced this pull request Feb 14, 2023
* feat(server/web): Initial support for RAF and SRW RAW formats.

* It should return the promise.

* Better comment

* feat(server/web): file-uploader needed changes.

* Remove un-used imports

* The failing test.. is no longer failing.

* Run prettier

* Original implementation with just a catch block added.

* feat(server): Some tests and specific handling for the two raw formats

* feat(web): Helper for raw image type.

* Handling of mimetype on server

* Handling of mimetypes on web with a map

* Bring back the acceptedfile filter

* Fix the asset-upload tests after changes

* acceptedFile is not usable due to type being empty from browser.

* Switch needs to use lowercase variants.

* Address Discord comments

* feat(mobile): Library page rework (album sorting, favorites) (#1501)

* Add album sorting

* Change AppBar to match photos page behaviour

* Add buttons

* First crude implementation of the favorites page

* Clean up

* Add favorite button

* i18n

* Add star indicator to thumbnail

* Add favorite logic to separate provider and fix favorite behavior in album

* Review feedback (Add isFavorite variable)

* dev: style buttons

* dev: styled drop down button

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>

* feat(mobile): Tap to enter immersive mode on gallery viewer (#1546)

* feat(mobile): Removed stay logged in checkbox and made it enabled by default (#1550)

* removed stay logged in checkbox and made it enabled by default

* adds padding to login button

* removed all isSaveLogin

* fix: logout would re-login with previous credential upon app restart

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>

* chore(server): remove token when logged out (#1560)

* chore(mobile): invoke logout() on mobile app

* feat: add mechanism to delete token from logging out endpoint

* fix: set state after login sequence success

* fix: not removing token when logging out from OAuth

* fix: prettier

* refactor: using accessTokenId to delete

* chore: pr comments

* fix: test

* fix: test threshold

* feat(deployment): support docker secrets (#1254)

* Support secrets

* Rewrite to support sh

* Remove JWT_SECRET

* fix(mobile): Added flutter native splash and splash screens (#1520)

* rebasing

* added launch background image to repository

---------

Co-authored-by: Marty Fuhry <marty@fuhry.farm>

* refactor(mobile): introduce Album & User classes (#1561)

replace usages of AlbumResponseDto with Album
replace usages of UserResponseDto with User

* feat(mobile): Multiselect add to favorite from the timeline (#1558)

* multiselect add to favorites

* feat(server): add updatedAt to Asset, Album and User (#1566)

* feat: add updatedAt info to DTO and generate api

* chore: remove unsued file

* chore: Add update statement to add/remove asset/user to album

* fix: test

* chore(server): update package-lock.json to match package.json (#1573)

* chore(server) Add user FK to album entity (#1569)

* chore(deps): bump docker/setup-buildx-action from 2.4.0 to 2.4.1 (#1575)

Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(server): make owner as required response for AlbumResponseDto (#1579)

* feat(GitHub): update bug and feature request template (#1584)

* dev: Reusing template from Home Assistant

* dev: add bug report template

* fix: template

* dev: change type

* dev:

* dev: add default labels

* dev: Add default title

* dev: add feature request template

* remove feature request from markdown

* dev: frontmatter

* fix(GitHub): feature request template

* fix(GitHub): feature request form has wrong type for textarea

* feat(mobile): Responsive layout improvements with a navigation rail and album grid (#1583)

* feat(proxy): Initial IPv6 support (#1577)

* fix(server): Create album response doesn't have owner property as required (#1704)

* feat(web): allow uploading more file types (#1570)

* feat(web): allow uploading more file types

* fix(web): make filename extension lowercase

* refactor(mobile): add Isar DB & Store class (#1574)

* refactor(mobile): add Isar DB & Store class

new Store: globally accessible key-value store like Hive (but based on Isar)

replace first few places of Hive usage with the new Store

* reduce max. DB size to prevent errors on older iOS devices

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>

* feat(mobile): Home screen customization options (#1563)

* Try staggered layout for home page

* Introduce setting for dynamic layout

* Fix some provider related bugs

* Make asset grouping configurable

* Add translation keys, refactor group title

* Rename enum values

* Fix enum names

* Reformat long if statement

* Fix timezone related bug

* Minor clean up

* Fix unit test

* Add second assets check back to home screen

* [Localizely] Translations update (#1707)

* fix(server): get shared link album info doesn't contain owner property (#1708)

* Version v1.46.0

* feat(server/web): file-uploader needed changes.

* Add raf and srw to the file names.

* Remember to add the extensions to fileSelector.

* Removed the getMimeType function on server as shouldn't be needed anymore.

* Revert "Removed the getMimeType function on server as shouldn't be needed anymore."

It is required still.

This reverts commit fc766dd.

* Should use proper mimetypes.

* fix linter

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Matthias Rupp <matthias.rupp@posteo.de>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
Co-authored-by: martyfuhry <martyfuhry@gmail.com>
Co-authored-by: James <jdm12989@gmail.com>
Co-authored-by: Marty Fuhry <marty@fuhry.farm>
Co-authored-by: Fynn Petersen-Frey <zoodyy@users.noreply.github.com>
Co-authored-by: Zack Pollard <zackpollard@ymail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
Co-authored-by: Immich Release Bot <bot@immich.app>
@lazyzyf
Copy link

lazyzyf commented Apr 23, 2023

can this great feature be implemented on web version as well? Thanks.

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.

None yet

4 participants