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

Change design of edit media modal in web UI #33516

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Jan 8, 2025

Includes an upgrade to Tesseract.js which according to the docs should be about 10x faster than the previous version we used.

grafik


Fixes MAS-258

@Gargron Gargron added the ui Front-end, design label Jan 8, 2025
@Gargron Gargron force-pushed the feature-alt-text-modal branch 3 times, most recently from 76947c2 to 7162a18 Compare January 10, 2025 00:58
@Gargron Gargron marked this pull request as ready for review January 10, 2025 01:07
@Gargron Gargron force-pushed the feature-alt-text-modal branch 4 times, most recently from 76f09c3 to a88508a Compare January 10, 2025 15:29
@mjankowski mjankowski added the javascript Pull requests that update Javascript code label Jan 10, 2025
@cadusilva
Copy link

A small feedback: the keyboard shortcut CTRL + Enter to apply the alt-text and close the modal is missing in the new design, could it be brought back?

Other than that, I liked the changes. It's cleaner and minimalist, right to the point.

@cadusilva
Copy link

Oh and this PR seems to break the CSS style of buttons (in the image, the Custom Emojis page).

image

@Gargron Gargron force-pushed the feature-alt-text-modal branch from a88508a to 309aecd Compare January 18, 2025 08:57
@Gargron
Copy link
Member Author

Gargron commented Jan 18, 2025

I've restored Ctrl + Enter and button styles in the admin UI.

@cadusilva
Copy link

I've restored Ctrl + Enter and button styles in the admin UI.

Thank you!

I applied the new code and noticed that it's possible to describe the image without a limit of characters, but when the user clicks the Done button, a message Oops! An unexpected error occurred appears as there is a limit.

Also, a nitpick suggestion: to focus the text field when the modal opens, so it's ready to write the description.

@cadusilva
Copy link

Another thing I just noticed: in the previous design, when the user type something and by mistake press Esc or something equivalent, there's a prompt about discarding everything or to cancel and go back to typing the alt-text. With the new design, when the user press cancel in this scenario and go back to typing, everything written is gone.

@Gargron Gargron force-pushed the feature-alt-text-modal branch 3 times, most recently from 84c1be1 to 4444993 Compare January 21, 2025 07:33
@Gargron Gargron requested a review from ClearlyClaire January 21, 2025 07:39
@Gargron
Copy link
Member Author

Gargron commented Jan 21, 2025

All addressed.

@ClearlyClaire
Copy link
Contributor

I have yet to investigate why this happens, and I have not reviewed the code yet, but the following fails:

  1. uploading a media attachment
  2. editing its description once
  3. editing its description a second time
  4. sending the post

When doing this, the description from step 2, not step 3, is persisted.

@Gargron Gargron force-pushed the feature-alt-text-modal branch from 4444993 to a32193b Compare January 21, 2025 09:55
@cadusilva
Copy link

All addressed.

When clicking the Edit or ALT buttons, the text field to type the alt-text is not focused. But if this nitpick is not planed, no problem.

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

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

This is a fairly big change that deals with a redesign, multiple refactors, a dependency update and a few unrelated CSS changes. I would have appreciated if it were split in easier-to-review, more logical commits. As it stands, I have not been able to do an in-depth review, only skim over the code and test the functionality.

Also, it might be useful to have system tests for the different edit flows, as they are complex and were broken at multiple points in this PR.

app/javascript/mastodon/reducers/modal.ts Show resolved Hide resolved
@Gargron Gargron enabled auto-merge January 21, 2025 11:33
@Gargron Gargron added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit 11786f1 Jan 21, 2025
35 checks passed
@Gargron Gargron deleted the feature-alt-text-modal branch January 21, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code ui Front-end, design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants