IceCubesApp icon indicating copy to clipboard operation
IceCubesApp copied to clipboard

Feature request: editing a post with an image should allow adding/editing the photos description/alt-text

Open joebarbere opened this issue 2 years ago • 3 comments

Given: You've already created a post with an image included, and without any description/alt-text for the image When: The user edits the post Then: The user should be able to update the description/alt-text of the image

There is some code here that prevents the add/edit description menu item from showing, which is intended due to how the Mastodon API works I assume.

https://github.com/Dimillian/IceCubesApp/blob/main/Packages/Status/Sources/Status/Editor/Components/StatusEditorMediaView.swift#L124

if !viewModel.mode.isEditing {
      Button {
        editingContainer = container
      } label: {
        Label(container.mediaAttachment?.description?.isEmpty == false ?
          "status.editor.description.edit" : "status.editor.description.add",
          systemImage: "pencil.line")
      }
    }

Removing the if block will allow the following workflow (albeit with some rough edges):

  1. Select the image and delete
  2. Add the image back
  3. Select the image and be able to add a description

If the user tries to Add/edit the description without deleting the original image first, the change will not go through. Perhaps we could programmatically delete the image first and then re-add prior to displaying the modal? Maybe there is a way to check if the original image was removed, and not display the add/edit description menu item in that case?

I know this is not the best workflow, but at least it gives the user an option to add descriptive text to the image, without having to delete the whole post, and start from scratch.

joebarbere avatar Jan 26 '23 03:01 joebarbere

Ah found this https://github.com/mastodon/mastodon/issues/20325, so I guess this is not supported in the API yet.

I'm still going to see if tracking whether the image was deleted first is possible. Then at least we could show the Add description menu item on new images for existing posts.

joebarbere avatar Jan 28 '23 14:01 joebarbere

Yes once the API support it I'll do it :)

Dimillian avatar Jan 28 '23 18:01 Dimillian

v4.1.0 has now added support to edit the ALT text https://github.com/mastodon/mastodon/pull/20878 I'm new to Swift but I'll try making these changes.

joebarbere avatar Feb 11 '23 15:02 joebarbere