IceCubesApp
IceCubesApp copied to clipboard
Feature request: editing a post with an image should allow adding/editing the photos description/alt-text
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):
- Select the image and delete
- Add the image back
- 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.
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.
Yes once the API support it I'll do it :)
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.