I always stumble upon questions which are in need of being closed. However, I often forget whether I voted to close a question or not, so I click on "close (x)", wait for the close dialog to load and see whether I've voted or not.

Why not make it clear from the very start? How about highlighting the "close (x)" link when a vote to close is already raised?

No vote raised:

enter image description here

Vote already raised:

enter image description here

  • 7
    If we're on it, the same for the delete links please. – πάντα ῥεῖ Dec 29 '18 at 11:32
  • 4
    And for flags too. – Wais Kamal Dec 29 '18 at 11:32
  • 2
    highlight all the things – rene Dec 29 '18 at 11:49
  • 3
    That might hurt page load performance as it now needs to check if any of the close votes belong to you and that is only beneficial for at most 5 users while all other visitors have to live with the performance penalty. On large sites like SO this will have a negative impact. Let's not do this. It is fixable with a User Script I guess. – rene Dec 29 '18 at 11:55
  • @rene Fair point – πάντα ῥεῖ Dec 29 '18 at 11:56
  • 1
    @rene how would a single if statement disrupt the whole page load? Just store the close vote with the user id of the user who raised it. You will loop through the 5 votes only, not through the users. – Wais Kamal Dec 29 '18 at 16:02
  • 1
    Yes, so that is either extra (denormalized) data or on extra join with the votes table, and yes on a single page view the performance loss is probably not measurable, but I can assure you it adds up given the traffic SO sees. – rene Dec 29 '18 at 16:09
  • 1
    Of course it adds up, to the storage significantly but only slightly to the performance. – Wais Kamal Dec 29 '18 at 17:50
  • If these links are changed, please make sure they're accessible to people with visual impairments. – Super Jade Dec 29 '18 at 20:51
  • 2
    @rene at least for the close vote dialog, the mouseover text already includes this information. Such highlighting would therefore be possible without extra queries. – amon Dec 30 '18 at 8:20

I think this can be done purely using CSS:

a.close-question-link[title^="You voted to close"] {
    color: red;

enter image description here

On the one hand the change is simple enough to add to a user style, and on the other hand the change is simple enough that SE can do it - and I'm not convinced that addition of a single CSS rule will have that much of a performance impact.

| improve this answer | |
  • "and I'm not convinced that addition of a single CSS rule will have that much of a performance impact." There's no direct information on the question site available, that this particular user voted to close the question, that could be used to control the conditional CSS settings. It would require another request to the server to get this info. – πάντα ῥεῖ Feb 28 at 16:30
  • You do realise that the text I'm checking has already been loaded on to the page? The check has been made anyway, is being made anyway, for you and all users. That's to say, the check already exists and runs right now, only the CSS is left, and the CSS doesn't require any additional request to the server. – muru Feb 29 at 0:56

As @rene pointed out in their comment, this might significantly hurt site load performance, and affect everyone loading the post, no matter if they were involved or not.

That seems to be an unfair trade, regarding having up to 5 users benefit to support their short minded recognition, beyond any others who didn't vote at all yet.

If you try to vote again, the system already informs you well, that you already did so.

| improve this answer | |
  • 1
    5 users vote, the others didn't. How is it unfair? Those who didn't vote this time probably would vote another time. Sharing is caring! – Wais Kamal Dec 29 '18 at 18:06

Not the answer you're looking for? Browse other questions tagged .