I suspect that we’re talking 2 different pieces of the pie.
Image formats (like .webp) should be directly supported with internal viewers & have thumbnailing.
But other media file types (like .rtf, .pdf, .mov), should leverage external viewers but have thumbnailing.
Bruce Jackson pushed a commit that adds PDF thumbnailing in June 2022.
A .txt file would be unusual for an attached media object type. Should that be brought in as a Note?