Skip to content

Fix event display: add per-category cap#3104

Open
internet-addict-xyz wants to merge 4 commits intoopenfrontio:mainfrom
internet-addict-xyz:fix/events-per-category-cap
Open

Fix event display: add per-category cap#3104
internet-addict-xyz wants to merge 4 commits intoopenfrontio:mainfrom
internet-addict-xyz:fix/events-per-category-cap

Conversation

@internet-addict-xyz
Copy link

@internet-addict-xyz internet-addict-xyz commented Feb 3, 2026

Description:

Fixes an issue where event spam in one category could delete
events from other categories due to a global cap.

In a normal scenario, if there is spam in some category,
the user would disable it in the filter. However, even though the
messages are filtered out, other messages would still disappear
quickly.

Here is an extreme example of the issue:
https://youtu.be/skEVf3fBxjk?t=1487

This change replaces the global event limit with a per-category cap,
so each MessageCategory is isolated.

Please complete the following:

  • I have added screenshots for all UI updates

    This doesn't change anything that I can show in screenshots.

  • I process any text displayed to the user through translateText() and I've added it to the en.json file

    I didn't change any display text.

  • I have added relevant tests to the test directory

    No tests required.

  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

    Yes I did.

Please put your Discord username so you can be contacted if a bug or regression is found:

internet_addict_

@CLAassistant
Copy link

CLAassistant commented Feb 3, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Walkthrough

Event capping moved from a single global limit to per-category limits (30 per category). The tick() loop no longer truncates globally; addEvent() appends the event, counts same-category events, and removes the oldest same-category event when that category exceeds 30.

Changes

Cohort / File(s) Summary
Event Display Capping
src/client/graphics/layers/EventsDisplay.ts
Replaced global event truncation with per-category capping (30 per category). tick() no longer slices remaining events and now uses a const for remainingEvents. addEvent() appends the new event, counts events of the same category, and splices out the oldest same-category event when count > 30. Adjusted new-events increment to rely on the visibility boolean check.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A stream of events, tidy and bright,
Thirty per kind keep the board light.
The oldest steps back, the newest takes stage,
Order preserved on the display page. 🎨✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix event display: add per-category cap' directly and clearly summarizes the main change—replacing a global event limit with per-category caps to prevent event spam in one category from evicting events in other categories.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly explains the issue being fixed (event spam in one category deleting events from others) and the solution (per-category cap instead of global cap), with an example video link.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 3, 2026
@internet-addict-xyz internet-addict-xyz force-pushed the fix/events-per-category-cap branch from 3efad40 to 8f6d9c3 Compare February 3, 2026 17:17
@evanpelle
Copy link
Collaborator

Are there any maps with Occitania nation?

@VariableVince
Copy link
Contributor

Are there any maps with Occitania nation?

@evanpelle PR #3179 is probably the one where you wanted to ask this question, not this PR about events cap?

@evanpelle
Copy link
Collaborator

Are there any maps with Occitania nation?

oh whoops, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

4 participants