-13

There are a lot of questions on Stack Overflow, which is "on hold" or "duplicated". As all we know, Stack Overflow uses the brackets [] convention for indicating this. like the following image

Question marked as on hold

Actually I think that showing the "[on hold]" part in another style is better, and makes the question more noticeable. Especially that this part is not part of the question title, it is an indicator for some problem in the question.

I played a little with the HTML of the page and I made it little different. Like this

Image showing on hold in different color

I am not suggesting this specific design, but the idea is to make this part of the question title different.

Responding to the comment which say

It will make the html content a bit larger due to the extra tags needed. That will have a negative impact on render time for little to no gain

(Theoretically) I agree with you completely. (Practically) this will not make an effect which the user will notice, in case that this delay is really exists.

Here is the original HTML of the page:

<a href="/questions/42747650/how-should-i-start-learning-computer-science" class="question-hyperlink">
   How should I start learning computer science [on hold]
</a> 

and here is the modified HTML I created:

<a href="/questions/42747650/how-should-i-start-learning-computer-science" class="question-hyperlink">
   How should I start learning computer science <small style="color:red">[on hold]</small>
</a>
23
  • 3
    Asking ASAP is always bad here! Commented Mar 12, 2017 at 15:52
  • What would be the improvement? The beavior already prevents answering such questions. Commented Mar 12, 2017 at 15:53
  • just to make this more obvious from the first look at the question title, even before reading it. Commented Mar 12, 2017 at 15:54
  • 1
    Just the text pattern is obvious enough IMO. Commented Mar 12, 2017 at 15:55
  • 4
    It will make the html content a bit larger due to the extra html tags needed. That will have a negative impact on render time for little to no gain.
    – rene
    Commented Mar 12, 2017 at 15:58
  • I can't see a problem with how it is currently. I can see that further highlighting will give the question-asker an even worse experience. That type of thing is deliberately avoided (obligatory link to some old post by Joel (the COBOL know-nothing) or Jeff (the COBOL know-even-less-if-that-is-possible). Ooh. I may leave those markers rather than trying to find the links... Commented Mar 12, 2017 at 16:27
  • 11
    @rene ...that was a joke, right?
    – Pekka
    Commented Mar 12, 2017 at 16:28
  • 1
    @Pekka웃 did you ever caught me joking?
    – rene
    Commented Mar 12, 2017 at 16:34
  • 7
    @rene oh come now. Rendering time from one element with a different colour, in a 100k document with about 1,000 elements? Seriously? I wouldn't be surprised if the difference were so microscopic you couldn't even measure it. That's like saying I can't go out till my garden because I could be killing some ants in the process.
    – Pekka
    Commented Mar 12, 2017 at 16:39
  • I had to come up with a different reason why I down vote this @Pekka웃 but as you want to take this serious, let's have it. Rendering time is only one part of the equation. There is also a larger network payload, it might require an extra string allocation server-side and as this is managed, needs to be GC-ed when served. The titles also go into Redis for search so there is impact there as well and the titles are also returned when you ask a new question so that code path is also impacted. So yes, sure, for a single user this is all nonsense but there is server side a bit more to worry about.
    – rene
    Commented Mar 12, 2017 at 16:51
  • 1
    Oh, ... and I need ants to keep my roots healthy .... so please don't kill the ants when you go into your garden ... ;)
    – rene
    Commented Mar 12, 2017 at 16:52
  • 6
    @rene it's completely ridiculous no matter which perspective you view this from, IMO, because it's going to be an insignificant change (relative to the rest of the load) on every level. Users add 7,000+ questions to the site every day, containing an arbitrary number of new elements... It's not a reasonable argument against a design change. Using it that way would paralyze any and all changes on the site that increase the payload of an individual page. To use a different example, it's like rejecting a moderately useful $2 expense in a $40m business because, well, it would be spending money
    – Pekka
    Commented Mar 12, 2017 at 16:54
  • I think a strong website like SO will not be smashed if this little difference has been done. and by the way, I do not think that the titles of the question is saved with that section, I think this is just rendering issue which could be handled in the Razor views. Commented Mar 12, 2017 at 16:56
  • 6
    Yes, it is not structured correctly in my head probably. Luckily you all fixed that. I simply hate sites that light up like a christmas-tree. My down vote stays.
    – rene
    Commented Mar 12, 2017 at 17:02
  • 1
    @rene and I need ants to keep my roots healthy that's interesting. I had to uproot a tree today :( and noticed a HUGE ecosystem of all sorts of ants underneath. Realized I don't know that much about them and what they do. Just know we have a lot of them, at night there's those gigantic ants crawling everywhere, absolutely fascinating. The soil was much, much better quality where the tree was than anywhere else on the plot (desert, so soil quality is an issue here) and wondering if it's the ants that did it!
    – Pekka
    Commented Mar 12, 2017 at 17:07

3 Answers 3

13

I still feel this is not needed but for those who think it is worth the effort and would like to try it out here is a small User Script that achieves what the OP is after. Add this to the userscript manager of your choice, GreaseMonkey or TamperMonkey.

// ==UserScript==
// @name         christmas tree for on hold and closed questions
// @namespace    http://stackoverflow.com/users/578411/rene
// @version      0.4
// @description  add span and css to give a better indication for closed questions
// @author       rene
// @match        https://stackoverflow.com/questions
// @match        https://stackoverflow.com/questions/tagged/*
// @match        https://stackoverflow.com/search?*
// @match        https://stackoverflow.com/users/*?tab=votes*
// @match        https://meta.stackoverflow.com/questions
// @match        https://meta.stackoverflow.com/questions/tagged/*
// @match        https://meta.stackoverflow.com/search?*
// @match        https://meta.stackoverflow.com/users/*?tab=votes*
// @match        https://*.stackexchange.com/questions
// @match        https://*.stackexchange.com/questions/tagged/*
// @match        https://*.stackexchange.com/search?*
// @match        https://*.stackexchange.com/users/*?tab=votes*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var observer;

    // add css class to control how [On Hold] and [Closed] should look like
    $('head').append('<style>a.question-hyperlink > span { color:red; } div.result-link > span > a > span { color:red; } </style>');

    function decorate(anchor) {
        // https://regex101.com/r/VLjRca/1/
        var matches = /^(.*)(\[(on hold|closed|duplicate)\])$/gi.exec(anchor.text().trim());
        if ( matches !== null && matches.length > 2) {
            anchor.text(matches[1]).append($('<span>').text(matches[2]));
        }
    }

    function decorateQuestionLinks() {
        // each link
        $('a.question-hyperlink').each(function() {
            decorate($(this));
        });
    }

    function decorateSearchResults() {
        // each search result link
        $('.result-link span a').each(function() {
             decorate($(this));
        });
    }

    // initial page
    if (document.location.pathname.indexOf('/search') === -1) {
        // we're not on search
        decorateQuestionLinks();
        // new nav pages get loaded by ajax calls and replace a dom node
        observer = new MutationObserver(function (recs) { decorateQuestionLinks(); });
        // observe new nav
        observer.observe(document.getElementById('qlist-wrapper'), { childList:true});
    } else {
        decorateSearchResults();
    }

})();

When run on the question pages this might be your result:

on hold christmas

I tested this on Chrome and TamperMonkey, with new navigation enabled. In other setups your mileage may vary. I don't take bug reports.

Enjoy!

0
5

Using square brackets to convey meta information was a common editorial practice long before Stack Overflow. With it being a simple, unobtrusive and well-established convention, I don't see the need for extra visual cues in our on hold markers.

1

Instead of highlighting on-hold questions, why not have them recede visually? I think this is a better approach than highlighting its status in red, drawing attention to the question.

enter image description here

2
  • 3
    I think neither highlighting nor deemphasising on hold questions is necessary. Open questions can be closed, and closed questions can be reopened. Only deleted questions are truly sidelined.
    – duplode
    Commented Apr 11, 2017 at 18:43
  • 1
    @duplode I lean towards agreeing with you. I think the one advantage to doing something like this is allowing people who want to focus on high-quality questions to skip those that are being disputed, but that's probably a different problem. Commented Apr 11, 2017 at 19:18

You must log in to answer this question.

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