Skip to content

Add alt-text to Image widget#1528

Merged
PoignardAzur merged 1 commit intolinebender:mainfrom
PoignardAzur:decorative
Dec 11, 2025
Merged

Add alt-text to Image widget#1528
PoignardAzur merged 1 commit intolinebender:mainfrom
PoignardAzur:decorative

Conversation

@PoignardAzur
Copy link
Copy Markdown
Contributor

@PoignardAzur PoignardAzur commented Dec 10, 2025

Code is roughly copy-pasted from the canvas PRs.

Code is roughly copy-pasted from the Canvas PRs.
Comment on lines +168 to +170
if let Some(alt_text) = &self.alt_text {
node.set_description(&**alt_text);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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();
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, each time the accessibility method is called, you get a new node from scratch. You don't need to clear anything.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah ok, good to know, then I need to correct that in #1519 too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You'd have to ask Matt.

Copy link
Copy Markdown
Member

@Philipp-M Philipp-M left a comment

Choose a reason for hiding this comment

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

LGTM

@PoignardAzur PoignardAzur added this pull request to the merge queue Dec 11, 2025
Merged via the queue into linebender:main with commit 4d06ae3 Dec 11, 2025
17 checks passed
@PoignardAzur PoignardAzur deleted the decorative branch December 11, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants