# OP of warnings not highlighted with Staff Color

**URL:** <https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993>\
**Category:** Bug\
**Tags:** fixed\
**Created:** [August 30, 2025, 3:32pm UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993 "2025-08-30T15:32:15Z")\
**Posts on this page:** 7\
**Page:** 1

## AI-generated summary

The discussion addresses a bug in Discourse v3.5.0.beta9 where the first post of a warning sent by a moderator lacks the expected "Staff Color" background highlighting, a feature present in previous versions. [littleD](/t/-/380993/1) reported the issue, noting it affects both desktop and mobile platforms. [Banson](/t/-/380993/2) confirmed the issue, and [sam](/t/-/380993/3) suggested it might be an intentional change, though [littleD](/t/-/380993/4) investigated the codebase and concluded it was likely an oversight during the Glimmer post stream migration.

[littleD](/t/-/380993/4) explained that the `post.gjs` component attempts to apply the moderator class based on `@post.isWarning` and `@post.firstPost`. However, the `isWarning` property does not exist on the Post model in the new architecture, causing the condition to always evaluate to false. In the legacy widget system, this property was explicitly mapped from the topic's `is_warning` flag, but this bridge was lost during the migration. [littleD](/t/-/380993/4) proposed adding a simple getter to the Post model to restore this behavior and suggested cleaning up the dead code if the change was intentional. [Architect](/t/-/380993/5) noted the interesting code structure and hoped for a team response. Finally, [awesomerobot](/t/-/380993/6) confirmed the diagnosis and applied a fix in pull request [#41293](https://github.com/discourse/discourse/pull/41293).

<div class="post-metadata">

**Author:** ![littleD](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@littleD](https://meta.discourse.org/u/littleD)\
**Post date:** [August 30, 2025, 3:32pm UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993/1 "2025-08-30T15:32:15Z")

</div>

**Priority/Severity** : normal

**Platform** : at least on desktop & mobile

**Description** : When moderators send a warning to a user, I remember that in the DIscourse version at least 1 year ago, the OP of the warning should be a background highlighted with Staff Color. But using Discourse v3.5.0.beta9, the OP has the normal background.

**Reproducible steps** : Send a warning to a user on Discourse v3.5.0.beta9.

---

<div class="post-metadata">

**Author:** ![Banson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/banson/32/454313_2.png) [@Banson](https://meta.discourse.org/u/Banson)\
**Post date:** [August 30, 2025, 5:16pm UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993/2 "2025-08-30T17:16:25Z")

</div>

Same issue. Wonder if it’s a bug or intended.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [August 31, 2025, 11:35pm UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993/3 "2025-08-31T23:35:15Z")

</div>

I feel like this may have been an intentional change @hugh would probably know.

---

<div class="post-metadata">

**Author:** ![littleD](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@littleD](https://meta.discourse.org/u/littleD)\
**Post date:** [June 28, 2026, 3:10pm UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993/4 "2026-06-28T15:10:23Z")

</div>

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)](https://github.com/discourse/discourse/blob/c69722346c4b996c26198e19c52ac4b0f3fec6c2/frontend/discourse/app/components/post.gjs#L435-L439), the moderator CSS class is applied based on:

```hbs
(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](https://github.com/discourse/discourse/blob/c69722346c4b996c26198e19c52ac4b0f3fec6c2/frontend/discourse/app/models/post.js) 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:

```javascript
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:

```javascript
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!

---

<div class="post-metadata">

**Author:** ![Architect](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/architect/32/520575_2.png) [@Architect](https://meta.discourse.org/u/Architect)\
**Post date:** [June 30, 2026, 2:15am UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993/5 "2026-06-30T02:15:45Z")

</div>

That’s interesting the way the code was written, hope someone from the team can reply to your question there about if there was oversight in that or was written that way for some other reason.

---

<div class="post-metadata">

**Author:** ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
**Post date:** [June 30, 2026, 2:04pm UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993/6 "2026-06-30T14:04:06Z")

</div>

Great report thanks, it’s exactly as you described. I’m applying a fix here:

> <https://github.com/discourse/discourse/pull/41293>
>
> Reported here: https://meta.discourse.org/t/official-warning-pm-notification-fea…ture/387448/8?u=awesomerobot
> 
> We had \`isWarning\`, but it wasn't wired up to anything after the glimmer migration so it never activated to add the moderator color to warnings
> https://github.com/discourse/discourse/blob/8dd0a9c73627a782bf163d3f590da5bb67a4bc3c/frontend/discourse/app/components/post.gjs#L436-L437
> 
> this adds the getter so the correct class is added to warning PMs and we get the color 
> 
> Before:
> \<img width="700" alt="image" src="https://github.com/user-attachments/assets/309df242-25b2-4013-910f-31ddafae6ca4" /\>
> 
> 
> 
> After:
> \<img width="700" alt="image" src="https://github.com/user-attachments/assets/fa3139b8-7ce0-48e5-bc8c-345d30f8d99e" /\>
> 
> included a test to avoid future regressions

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [July 2, 2026, 2:12pm UTC](https://meta.discourse.org/t/op-of-warnings-not-highlighted-with-staff-color/380993/7 "2026-07-02T14:12:16Z")

</div>

Closed on July 2, 2026, 2:12pm UTC


