PolymerLabs / project-health

Apache License 2.0
9 stars 3 forks source link

New read activity spot does not go away when "right-click -> open in new tab" a link #557

Open TimvdLippe opened 6 years ago

TimvdLippe commented 6 years ago

The Problem

I tend to "ctrl + click" a lot of my URLs, to not accidentally move from my current tab. Luckily, Project health has target=_blank so this shouldn't happen. Still, I am used to "ctrl + click" my way through the internet.

However, when I "right click -> open link in new tab" (rather than just click or "ctrl + click"), the "new read activity" spot that is next to an outgoing PR is not removed. The outcome of the two methods is the same nonetheless, e.g. a new tab opens with the corresponding URL.

A spot next to a link: image

Expected Behavior

When I "right click -> open link in new tab" on a link with new read activity, it should become read.

Links to Relevant PR's / Issues

n/a

samuelli commented 6 years ago

That's a good point @TimvdLippe. However, I'm not sure if there's really any way to detect this case.

One (rather complex) solution would be to change all the URLs to internal URLs so that we can track which ones you went to, regardless of how you opened them. That may be more complex than needed?

TimvdLippe commented 6 years ago

Hm, yes that seems too complex. While we can not capture the "new tab" after a right click, I think listening for oncontextmenu might be just sufficient (https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/oncontextmenu) ?