4

If your user preferences are set to include them, Staging Ground posts are appearing on question list pages including the home page.

Could the question <div> tags please be classed appropriately so they can be styled? Something like s-post-summary__sg.

Right now they look like this

<div
  id="question-summary-xxxxx"
  class="s-post-summary js-post-summary"
  data-post-id="xxxxx"
  data-post-type-id="1"
>

which means there's nothing to distinguish them from other rows. Even watched and ignored tags come with handy identifiers s-post-summary__watched and s-post-summary__ignored respectively.

Motivation: I maintain a custom stylesheet that restores Stack Overflow question pages to their former glory and this is really messing with the layout.

look what they did to my boy!

5
  • 10
    "For some reason, Staging Ground posts are appearing on question list pages, including the home page." This part seems like a bug - to my understanding, the entire point of SG is to make it so that a question can be workshopped by an interested audience before it shows up on main pages. Commented Jun 4 at 23:57
  • 1
    @KarlKnechtel agreed but here we are ¯\_(ツ)_/¯
    – Phil
    Commented Jun 5 at 0:03
  • 1
    Declined for reasons covered below: there is a preference on your settings page if your goal is to hide SG questions on the main page, and there are reasonable ways to select for these questions. Copying KyleMit's comment, .s-post-summary:has(.iconSchoolSm) will likely be stable for the foreseeable future
    – Slate StaffMod
    Commented Jun 7 at 14:42
  • Can you not style them based off of the custom, unique-to-SG status icons that appear ("New", etc.)?
    – TylerH
    Commented Jun 7 at 20:56
  • @Slate really not sure why you chose to focus on the "hiding" aspect after I edited that out of the question.
    – Phil
    Commented Jun 7 at 23:05

1 Answer 1

6

FYI, you don't need to userstyle if you want SG items to not show in homepage and question listing. In https://stackoverflow.com/users/preferences, there's a setting called "Show Staging Ground questions" that is exactly for this (at least according to its label).

But if you really need it, try .js-post-summary:has([aria-describedby='staging-ground-item-tooltip']). KyleMit also suggests .s-post-summary:has(.iconSchoolSm). Disclaimer: I have no idea how stable that attribute is going to be in the future.

5
  • Nice, thanks for the preferences hint. Would not have thought to check there.
    – Phil
    Commented Jun 5 at 2:46
  • 4
    I think that option should have been communicated better (as well with the thing about SG posts being included in the front page)...
    – dan1st
    Commented Jun 5 at 7:53
  • 3
    "Disclaimer: I have no idea how stable that attribute is going to be in the future." - I mean, no parts of SE's HTML are stable. Most userscripts that have been around for a while have broken at some point or another because the HTML changed Commented Jun 5 at 12:38
  • Yeah, for an immediate solution today, I was going to recommend the :has selector. Although, generally speaking any HTML structure isn't treated as an unbreakable contract, though tracking changes is at least a best effort
    – KyleMit StaffMod
    Commented Jun 7 at 14:34
  • 1
    I probably don't envision us moving away from or renaming the SG Icon, so .s-post-summary:has(.iconSchoolSm) is probably reasonably safe as well
    – KyleMit StaffMod
    Commented Jun 7 at 14:36

You must log in to answer this question.

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