Allow Title-Only Onebox

AI-generated summary

The Allow Title-Only Onebox plugin, created by dsims, enables oneboxes for links without description or image metadata. pmusaraj suggested adopting this behavior in core, which martin agreed with and created a PR to add this feature. The plugin’s life was short-lived, as the core update made it redundant. dsims jokingly referred to it as the “World’s fastest deprecated plugin”. The community, including pmusaraj and lindsey, appreciated the quick resolution and adoption of the feature in core.

:information_source: Summary Enables title-only oneboxes
:hammer_and_wrench: Repository Link https://github.com/dsims/discourse-onebox-title-only
:open_book: Install Guide How to install plugins in Discourse

Feature

If a linked webpage is missing description or image metadata, Discourse will normally leave it as a URL and not onebox it. This plugin changes that behavior to allow for title-only oneboxes.

Example:

becomes
Screenshot 2025-02-24 at 10.02.36 PM

15 Likes

Cool, thanks for writing and publishing the plugin.

Maybe we should adopt this in core? Seems like a better default to me.

9 Likes

The description requirement was actually removed at one point (way back when it was a standalone gem) but then it was reverted a few months later, so I assume there was some reasoning not to do it.

I have only seen a handful of URLs in the wild that match this scenario, so I imagine there are some edge cases where it doesn’t look right.

3 Likes

@dsims it’s not clear at all why this behaviour of allowing oneboxes with no descriptions was backtracked here FIX: do not show title only oneboxes by arpitjalan · Pull Request #448 · discourse/onebox · GitHub , so we will just add this behaviour back into core, no need for a plugin. Will try for a quick PR today for this.

5 Likes

PR is here:

https://github.com/discourse/discourse/pull/31518

9 Likes

One thing I did not address is that the composer preview still has a message implying that there is an issue generating the onebox.

5 Likes

Ah thanks for letting me know, I didn’t see this because I posted too fast when testing. Fixing in the same PR…

5 Likes

Thanks! World’s fastest deprecated plugin? :joy:

10 Likes

6 Likes

Awesome, thanks for the plugin @dsims, its short-lived life served a purpose, it led to a fix in core (with benefits for all).

And thanks for the quick adoption in core @martin!

11 Likes