agent_ui: Fix label for image mentions (#52995)

This PR fixes an issue where an image mention would have its label reset
to just "Image", instead of persisting the original label, when the
prompt got submitted.

Closes #48564

Release Notes:

- agent: Fixed image mention labels by persisting the file name after
submitting the prompt
- agent: Fixed directory mentions being incorrectly parsed as files when
pasting into prompt editor

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
7e27171174Danilo Leal committed on 4/6/2026, 3:16:58 PM· committed by GitHubparentd0a61a4
6 files changedLine totals unavailable