Usercards and links in markdown preview window


(Sam Saffron) #1

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)?

(Jeff Atwood) #2

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


(Sam Saffron) #3

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.


(Jeff Wong) #4

Certainly, I’ll tackle that next.


(Joshua Rosenfeld) #6

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.


(Sam Saffron) #7

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


(Dave McClure) #8

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?


(Jeff Atwood) #9

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


(Dave McClure) #10

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?


(Jeff Wong) #11

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.


(Joe Buhlig) #12

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.


(Jeff Wong) #13

Usercards and group cards now appear when you click on mentions in the preview panel: show card on preview panel. · discourse/discourse@252dd32 · GitHub

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


(Jeff Wong) #14