Add alt-text to Image widget#1528
Merged
PoignardAzur merged 1 commit intolinebender:mainfrom Dec 11, 2025
Merged
Conversation
Code is roughly copy-pasted from the Canvas PRs.
Philipp-M
reviewed
Dec 10, 2025
Comment on lines
+168
to
+170
| if let Some(alt_text) = &self.alt_text { | ||
| node.set_description(&**alt_text); | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| if let Some(alt_text) = &self.alt_text { | |
| node.set_description(&**alt_text); | |
| } | |
| if let Some(alt_text) = &self.alt_text { | |
| node.set_description(&**alt_text); | |
| } else { | |
| node.clear_description(); | |
| } |
Contributor
Author
There was a problem hiding this comment.
Nope, each time the accessibility method is called, you get a new node from scratch. You don't need to clear anything.
Member
There was a problem hiding this comment.
Ah ok, good to know, then I need to correct that in #1519 too
Member
There was a problem hiding this comment.
What's the purpose of clear_description then? To correct mistakes you did earlier in the same method? Or do you sometimes get mutable node references after all?
Contributor
Author
There was a problem hiding this comment.
You'd have to ask Matt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code is roughly copy-pasted from the canvas PRs.