OP of warnings not highlighted with Staff Color

Hi folks,

I was investigating why warning PM first posts lost their staff color styling after the Glimmer post stream migration, and wanted to share what I found — it looks like a small oversight rather than an intentional change (at least on the code side).

The issue

In post.gjs (line 436), the moderator CSS class is applied based on:

(if
  (or @post.isModeratorAction (and @post.isWarning @post.firstPost))
  "post--moderator moderator"
  "post--regular regular"
)

@post.isModeratorAction works correctly — it’s a proper getter on the Post model. But @post.isWarning doesn’t exist on the Post model at all.

No isWarning property, getter, or tracked field is defined there. So the condition (and @post.isWarning @post.firstPost) always evaluates to false, and the moderator class is never applied to warning PM first posts.

How it worked before

In the old widget system, transformPost (transform-post.js) explicitly mapped the topic-level flag to the post attrs:

postAtts.isWarning = topic.is_warning;

Then widgets/post.js checked attrs.isWarning && attrs.firstPost to apply the moderator class. This bridge was lost during the Glimmer migration.

My read on it

Since post.gjs actively references @post.isWarning, it seems like the intent was to preserve this behavior. If removing the staff color from warnings was intentional, then the (and @post.isWarning @post.firstPost) branch in post.gjs is dead code and could be cleaned up. If it’s a bug (which seems more likely given the old widget code), the fix would be a small getter on the Post model:

get isWarning() {
  return this.topic?.is_warning;
}

I wanted to check what the team’s take is — does this look like an oversight from the Glimmer migration, or was it intentionally left out? Either way, the dead reference to @post.isWarning in post.gjs might be worth addressing.

Thanks!

3 Likes