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

refactor(web): descriptions #6517

Merged
merged 14 commits into from
Jan 22, 2024
Merged

refactor(web): descriptions #6517

merged 14 commits into from
Jan 22, 2024

Conversation

martabal
Copy link
Member

@martabal martabal commented Jan 19, 2024

What's changed

  • Edit the album description directly in the textarea like the description in the detail panel
  • Refactor auto-grow textarea as suggested by fix(web): album description #6512 (comment)
  • Keep the break lines in the description when viewing the asset with a shared link as a guest
  • Avoid useless API requests when clicking on the description in the detail panel when description has been focused out but not changed
  • Fix the escape shortcut on the album page when opening some modals
  • Update the description by pressing Ctrl + Enter

Screenshots

2024-01-20.01-07-24-2.mp4

@martabal martabal changed the title refactor: reusable autogrow for textArea refactor(web): reusable autogrow for textArea Jan 19, 2024
Copy link

cloudflare-pages bot commented Jan 19, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: adfc81d
Status: ✅  Deploy successful!
Preview URL: https://07e64535.immich.pages.dev
Branch Preview URL: https://fix-reusable-autogrow.immich.pages.dev

View logs

@martabal martabal changed the title refactor(web): reusable autogrow for textArea refactor(web): album description Jan 20, 2024
@martabal martabal changed the title refactor(web): album description refactor(web): descriptions Jan 20, 2024
Comment on lines -200 to -202
{#if !isOwner || api.isSharedLink}
<span class="break-words">{description}</span>
{:else}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you get rid of this span and convert it back to a placeholder? Did you test a multi-line description in a shared link, specifically going from short to long to see if it auto grows?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it works fine.

Original asset:

Screenshot from 2024-01-20 02-44-51

Before After
Screenshot from 2024-01-20 02-48-16 Screenshot from 2024-01-20 02-48-29

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

This doesn't work and re-introduces back an auto grow bug. In this video I click "next" to go to another asset with a longer description. The textarea does not auto-grow until I start typing.

Screencast.from.01-19-2024.09.08.42.PM.webm

@martabal martabal marked this pull request as draft January 20, 2024 02:11
@martabal martabal marked this pull request as ready for review January 20, 2024 02:16
@martabal
Copy link
Member Author

martabal commented Jan 20, 2024

This doesn't work and re-introduces back an auto grow bug. In this video I click "next" to go to another asset with a longer description. The textarea does not auto-grow until I start typing.

Oh right, I see what's the issue. Should be fixed. Thank your for the explanation

Screencast.from.2024-01-20.03-19-55.webm

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.

Hello, thank you for your work on this. It works very well.

One bug I notice is that you cannot see the description of the non-owned asset in a shared album.

@martabal
Copy link
Member Author

Hello, thank you for your work on this. It works very well.

One bug I notice is that you cannot see the description of the non-owned asset in a shared album.

Hello, thank you for testing it !
I can't reproduce this behavior. Can you precise how you discovered this bug ?

Asset owned by the user Asset not owned by the user
Screenshot from 2024-01-22 00-01-24 Screenshot from 2024-01-22 00-01-31

@alextran1502
Copy link
Contributor

@martabal Here is what I see. Probably a bug with a very long description

image

@martabal
Copy link
Member Author

@martabal Here is what I see. Probably a bug with a very long description

Really weird, I can't reproduce it. I tested all kind of descriptions (none, long, one line) with assets in shared albums, viewed from the owner, a non-owner and a guest and I can't reproduce this behavior 🤔

I changed a bit that logic in my latest commit, can you try it ?

@alextran1502 alextran1502 merged commit 3845fec into main Jan 22, 2024
24 checks passed
@alextran1502 alextran1502 deleted the fix/reusable-autogrow branch January 22, 2024 04:47
@alextran1502
Copy link
Contributor

@martabal the description is still showing up as a single line if you share the album in public shared link

@martabal
Copy link
Member Author

martabal commented Jan 22, 2024

Right, I forgot to update the description in the album-viewer.svelte 😓

Thanks for the info

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.

None yet

4 participants