flamewave000 / dragonflagon-fvtt

DragonFlagon FoundryVTT Modules
BSD 3-Clause "New" or "Revised" License
64 stars 59 forks source link

DF Chat Enhancements: Merge incompatibility with Damage Log #426

Open cs96and opened 1 year ago

cs96and commented 1 year ago

Module DF Chat Enhancements v4.1.0

Describe the issue When the Damage Log module is enabled, as soon as a damage log message has been added to its own tab, the DF chat merge stops working. This bug was initially raised as an issue on the Damage Log module, but I believe the fix is needed in DF Chat Enhancements (see suggested fix below).

To Reproduce Steps to reproduce the behavior:

  1. Enable DF Chat Enhancements and the Chat Merge feature
  2. Enable Damage Log
  3. Clear the chat log
  4. Send a few attacks / damage rolls to the chat and see that they merge
  5. Apply some damage to an actor
  6. Send some more attacks / damage rolls to the chat and see that they no longer merge

Expected behavior The messages should continue to merge after Damage Log has added a message to its own tab.

Fix The issue is on line 192 of chat-merge.ts https://github.com/flamewave000/dragonflagon-fvtt/blob/e9e9a38b7092ebd02912a8ec76c7ce0f004fa16d/df-chat-enhance/src/merge/chat-merge.ts#L192 The jQuery selector is finding all li.chat-messages across the whole of the document, which includes the Damage Log entries, which are part of a different list. By changing the selector to #chat-log li.chat-message the issue goes away.