22

Currently, if you access a deleted question you will get a short message informing you that the question has been deleted. However, if you click on a direct link to a deleted answer or comment (which you can get via notifications), nothing is displayed.

This is naturally quite confusing as you will get the message about a new answer or comment via notifications, click on the link and simply see nothing.

Therefore, I propose to display some sort of message to the user, informing her/him that the answer or question has been deleted. Note that this is different from always showing a deleted answer/comment, as I specifically request it in case you access the specific URL.

One example for a comment would be: Can Heartbleed cause a server to crash?

One example for a deleted answer is: Can I use one model inside of a different model in CakePHP?

This question is related to CSS bug regarding deleted comments, but requests a feature to circumvent the problem altogether.

8
  • The Android app has a message "The answer wasn't found. It may have been deleted" when it isn't able to find the answer. I think it's a wonderful message to have.
    – Steven V
    Apr 29, 2014 at 15:11
  • @StevenV That sounds good. However, I wasn't even aware there is an app for SO... Seems like I am getting old
    – dirkk
    Apr 29, 2014 at 16:13
  • If the question is a spam then this feature will help the spam spread instead of removing it quickly... am I right?
    – 54D
    Mar 11, 2015 at 10:04
  • 2
    @ArceusMaster0493 No, why should it? In what way would e.g. showing a message like "The answer wasn't found" spread spam?
    – dirkk
    Mar 11, 2015 at 10:17
  • @dirkk ahh I misunderstood your suggestion :P sorry
    – 54D
    Mar 11, 2015 at 13:13
  • 1
    Related: meta.stackexchange.com/questions/257536/…
    – AStopher
    May 31, 2015 at 11:39
  • There is this old request: meta.stackexchange.com/questions/88589/…, but I am marking that as a dupe of this one despite that one being older because I kinda like the answers here better.
    – Jason C
    Mar 23, 2017 at 22:52
  • 1
    @54D Why do you think so? This is just a simple usability tweak. The spammer's message will not be displayed, but you get a better user experience because you understand what's going on.
    – tripleee
    Mar 24, 2017 at 4:44

2 Answers 2

12
+50

I'm not sure if a bounty will help in speeding up the 6 to 8 weeks it generally takes to implement stuff but until this gets implemented you might want to try this userscript to mimic the behaviour you're looking.

// ==UserScript==
// @name         Check if comment and answer exist
// @namespace    http://meta.stackexchange.com/users/158100/rene
// @version      0.1
// @description  Show a message if the answer or comment in the hash of the url doesn't exist
// @author       rene
// @match        *://*.stackexchange.com/questions/*
// @match        *://stackoverflow.com/questions/*
// @match        *://serverfault.com/questions/*
// @match        *://askubuntu.com/questions/*
// @match        *://mathoverflow.net/questions/*
// @match        *://stackapps.com/questions/*
// @match        *://superuser.com/questions/*
// @grant        none
// ==/UserScript==

(function ($, window) {

    var hash = $(window.location).attr('hash'),
        msg = $('<div></div>')
                    .css('background-color','#CCFFCC')
                    .css('align','center')
                    .css('padding', '10px')
                    .css('text-align', 'center')
                    .hide();

    function showMessage(jqsel, text) {
        if (jqsel.length === 0) {
            $('div#header').append(
                msg
                .text('The ' + text + ' is not found. It may have been deleted')
                .fadeIn(2000)
                .fadeOut(5000));
        }
    }

    if (hash.length > 0) {
        cleanHash = hash.substring(1);
        if (cleanHash.indexOf('comment') === 0) {
            ids = cleanHash.substring(7).split('_');
            showMessage($('div#comments-' + ids[1]).find('tr#comment-'+ ids[0]), 'comment');
        } else {
            if (Number.parseInt(cleanHash, 10) !== NaN) {
                showMessage($('div#answer-' + cleanHash), 'answer');
            }
        }
    }
}($ || unsafeWindow.$, window || unsafeWindow ));

This takes the hash of the url and tries to find it in the loaded DOM. If it doesn't find the comment or the answer it fadeIn a message in the header of the page and fadeOut after 5 seconds.

You can find this script also on Stack Apps where I will take bug reports and feature requests.

2
  • Confirmed still works as of May 2017. This is great!
    – Jason C
    Mar 23, 2017 at 23:04
  • Consider dropping this on stackapps.com and then throwing a link here and here
    – Shog9
    May 15, 2017 at 20:10
6

This has not been implemented yet (three years after the feature request), today I submitted a feature request for this but was pointed to this one.

The below is from my own feature-request I submitted

Something like this:

enter image description here

The current issue is that if some user posts a link to the answer and the answer's deleted, other users may think (and indeed, this has happened to me) that the question is being referred to, and not the answer.

Example from today:

enter image description here

Although SmokeDetector did explicitly mention answer, the action of Madara Uchiha did confuse a couple of users, including myself. This would've been prevented if an error message showing the answer had been removed had been shown when attempting to visit it.

I know it's a tiny feature request, but I think it'd be a nice feature to have.

1

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