close
Skip to content

[2.x] fix(realtime): restore full-width banner; move new-activity state to IndexPage#4481

Merged
imorland merged 1 commit into2.xfrom
im/realtime-discussion-list-banner-fix
Mar 21, 2026
Merged

[2.x] fix(realtime): restore full-width banner; move new-activity state to IndexPage#4481
imorland merged 1 commit into2.xfrom
im/realtime-discussion-list-banner-fix

Conversation

@imorland
Copy link
Copy Markdown
Member

Summary

  • Banner width regression: Button--block stopped working as a CSS class after d2129e6 converted it to a parametric LESS mixin (.Button--block()). Fix by calling .Button--block() directly in .DiscussionList-update in forum.less.

  • 1.x-era vdom mutation replaced: The banner was injected via vdom.children.unshift(), which mutates the raw Mithril vdom array. Replace with extend(IndexPage.prototype, 'contentItems', ...) at priority 95 — sitting between the toolbar (100) and the discussion list (90).

  • State moved to correct owner: All websocket event bindings and the WebsocketUpdates instance have been moved from DiscussionList lifecycle hooks to IndexPage, which is the right owner since the banner is a page-level concern, not a list-level concern.

  • Dead code removed: this.addDiscussion was assigned in oninit but never wired to an extend() call — removed.

Test plan

  • Trigger a new discussion or reply via websocket while on the index page — banner appears full-width above the discussion list
  • Auto-release countdown works and banner dismisses automatically
  • Clicking the banner immediately releases updates
  • No banner shown on pages other than IndexPage

The DiscussionList-update banner was broken in two ways:

1. The `Button--block` CSS class no longer exists after d2129e6
   converted it to a parametric LESS mixin. Add `.Button--block()` to
   `.DiscussionList-update` in forum.less so the button gets
   `display: flex; width: 100%` again.

2. The banner was injected via `vdom.children.unshift()` — a 1.x-era
   pattern that mutates the raw vdom array. Replace it with a proper
   `extend(IndexPage.prototype, 'contentItems', ...)` at priority 95
   (between the toolbar at 100 and the discussion list at 90).

   Move all state and websocket bindings from DiscussionList lifecycle
   hooks to IndexPage, which is the correct owner since the banner is
   a page-level concern. Remove the dead `this.addDiscussion` method
   that was assigned in oninit but never wired to an extend() call.
@imorland imorland requested a review from a team as a code owner March 21, 2026 22:15
@imorland imorland changed the title fix(realtime): restore full-width banner; move new-activity state to IndexPage [2.x] fix(realtime): restore full-width banner; move new-activity state to IndexPage Mar 21, 2026
@imorland imorland added this to the 2.0.0-beta.8 milestone Mar 21, 2026
@imorland imorland merged commit 32d9e12 into 2.x Mar 21, 2026
25 checks passed
@imorland imorland deleted the im/realtime-discussion-list-banner-fix branch March 21, 2026 22:27
imorland added a commit that referenced this pull request Mar 21, 2026
imorland added a commit that referenced this pull request Mar 21, 2026
* prep for beta.8

* chore: update changelog for beta.8 (#4480, #4481)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant