Usercards and links in markdown preview window

One issue I hit regularly is that I want to follow links and expand usercards in the preview window. I find I get a lot more context about a user I am mentioning by visiting the card (and soon thanks to work by @featheredtoast groups)

Do we want to amend it so

  1. Usercards always can be expanded in preview?
  2. Link can somehow be opened from preview (ctrl or shift click or something like that)?
5 Likes

No links, I think that’s an idea fraught with peril, but I see no downside for usercards.

Sure, we can hold off on links for now (CTRL click is probably too ninja anyway so this would be building a feature for 1 person).

@featheredtoast can you take user card expansion in preview as part of your new user card work for groups, it is particularly useful for groups cause you get so much more interesting context.

1 Like

Certainly, I’ll tackle that next.

4 Likes

Just for the record you’re not the only person that tries to Ctrl + click links in preview, I do it all the time. Fortunately, right click and open in new tab does work (at least in Chrome on Windows), so I have a workaround.

8 Likes

wow I did not know this! thanks for letting me know!

1 Like

I would find both of these very helpful.

Maybe it’s obvious to others but I don’t think I folllow. What’s the peril?

Navigating away from what you are currently editing, by clicking through to a completely different web page.

1 Like

What if the links in the preview always open in a new tab, regardless of the site setting or user preference? Would that address your concern?

Opening links via shift/ctrl was pretty trivial and I honestly don’t see a risk – normal link clicks will still be prevented. I do not recall ever having accidentally ctrl-clicked a link.

I’m working now on refactoring the user cards a little bit, and nailing down positioning when they appear in the preview window.

4 Likes

Just to throw my hat in the pool, I click links in the preview every day. :man_facepalming:

The right-click trick is one I’ve used for a long time to get around it. I usually try ctrl+clicking them first and then when that fails I go to right-click it. If ctrl+click was allowed, it would save a click without navigating away from the edit window. But I’m also aware of the potential danger here.

5 Likes

Usercards and group cards now appear when you click on mentions in the preview panel: https://github.com/discourse/discourse/commit/252dd328952126f487bfcf4f3dcf95acc522b566

Notes:

  • The usercard position is ‘fixed’ when brought up in the preview, so scrolling doesn’t move it.
  • The z index is raised above the preview window only for this case.
  • When the card will be below the bottom of the screen, it card appears above its mentioned link instead.

usercards-preview-window

9 Likes