Skip to content

feat: detect ElvUI loot conflict and offer to disable (#147)#148

Merged
Xerrion merged 2 commits intomasterfrom
feat/147-elvui-loot-conflict
Apr 18, 2026
Merged

feat: detect ElvUI loot conflict and offer to disable (#147)#148
Xerrion merged 2 commits intomasterfrom
feat/147-elvui-loot-conflict

Conversation

@Xerrion
Copy link
Copy Markdown
Owner

@Xerrion Xerrion commented Apr 18, 2026

Closes #147

Type of change

  • New feature

Summary

Adds a new Core/ElvUICompat.lua module that detects when ElvUI's loot window (E.private.general.loot) or group-loot roll frames (E.private.general.lootRoll) are active alongside DragonLoot. On detection, shows a StaticPopup offering to disable the ElvUI modules and ReloadUI(). Dismissal is persisted per-profile in profile.elvuiCompat, scoped by conflict signature so later re-enables of an ElvUI module re-prompt.

Design notes

  • ElvUI's loot module gates (M:LoadLoot / M:LoadLootRoll) are only checked at Initialize - runtime flag flips don't undo hooks. ReloadUI() is required.
  • AceDB persists E.private to ElvPrivateDB automatically on logout - no direct SavedVariable mutation.
  • Prompt is deferred 1 second via ScheduleTimer so ElvUI finishes its own Initialize first.
  • Bumps CURRENT_SCHEMA from 2 to 3 so existing profiles backfill the new elvuiCompat sub-table via FillMissingDefaults.
  • Only prompts when BOTH sides of a conflict are enabled (ElvUI's flag ON AND DragonLoot's matching feature ON).

Testing

  • luacheck . clean (only pre-existing Libs/ warnings)
  • Manual verification matrix:
    • ElvUI not installed: no prompt, no errors
    • ElvUI installed but disabled in AddOn manager: no prompt
    • ElvUI active with both toggles on: prompt shows; YES disables both + reloads; post-reload no prompt
    • User declines (NO / ESC / X): no prompt on next login
    • User declined, then re-enables ElvUI's loot: prompt reappears (signature changed)
    • Only one side conflicting: prompt text reflects that single conflict

Checklist

  • Code follows repo style (4-space indent, 120-char line limit, plain hyphens)
  • luacheck passes with 0 new warnings
  • Locale strings added to enUS.lua (other locales fall back silently)
  • No new dependencies
  • No breaking changes to existing SavedVariables (AceDB schema migration is additive)

Summary by CodeRabbit

  • New Features

    • Added ElvUI compatibility checks that detect conflicting loot window and roll frame features. Users receive a notification and can choose to automatically disable the conflicting modules with a UI reload.
  • Chores

    • Updated configuration schema with automatic migration for existing player profiles.
    • Updated static analysis configuration for code validation.

Adds Core/ElvUICompat.lua which detects whether ElvUI's loot window or group-loot roll frames are enabled alongside DragonLoot's matching features. On detection, prompts the user via StaticPopup to disable the ElvUI modules and reload. Dismissal is persisted per-profile scoped by conflict signature so re-enabling an ElvUI feature later re-prompts. Bumps AceDB schema to 3 to backfill the new profile sub-table.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Warning

Rate limit exceeded

@Xerrion has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 44 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 44 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 8ad3be98-3623-47f5-b22a-02d2b3643ab6

📥 Commits

Reviewing files that changed from the base of the PR and between 2d5595b and 4dfcbbd.

📒 Files selected for processing (2)
  • DragonLoot/Core/ElvUICompat.lua
  • spec/Config_spec.lua
📝 Walkthrough

Walkthrough

This change introduces ElvUI loot conflict detection and resolution. A new ElvUICompat.lua module detects when ElvUI's loot and roll-frame features conflict with DragonLoot's equivalents, and offers users a dialog to disable the ElvUI features. Configuration schema increments, and initialization is deferred via scheduler.

Changes

Cohort / File(s) Summary
ElvUI Compatibility (New)
DragonLoot/Core/ElvUICompat.lua, DragonLoot/Core/Init.lua
New module exports IsPresent, IsLootWindowActive, IsGroupLootActive, GetConflicts, Disable, and Initialize functions. Registers a DRAGONLOOT_ELVUI_CONFLICT StaticPopup, detects active conflicts by inspecting ElvUI's private flags (E.private.general.loot, E.private.general.lootRoll), and disables matching flags on user acceptance. Dismissal state persisted per-profile with conflict signature tracking. Initialization is triggered from Addon:OnEnable() with ~1 second scheduling deferred.
Configuration Schema Upgrade
DragonLoot/Core/Config.lua
Schema version incremented from 2 to 3; new elvuiCompat subsection added to profile defaults with dismissed (boolean, default false) and lastConflictSignature (string, default empty). Existing profile data triggers re-fill on next load.
Manifest & Localization
DragonLoot/DragonLoot.toc, DragonLoot/Locales/enUS.lua
TOC file registers the new Core\ElvUICompat.lua module for load. Three new English locale keys added covering loot-only, roll-only, and both-enabled conflict warnings, each prompting user action and UI reload.
Development Tooling
.luacheckrc
Luacheck global list expanded to include ReloadUI to avoid false undefined-global warnings.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

core, localization

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR title follows Conventional Commit format with type 'feat' and clear description of ElvUI conflict detection feature.
Linked Issues check ✅ Passed All objectives from #147 are met: ElvUI presence detection, conflict checking for loot/rollRoll toggles, StaticPopup with disable/dismiss options, per-profile dismissal persistence with signature scoping, and ReloadUI() integration.
Out of Scope Changes check ✅ Passed All changes directly support ElvUI conflict detection: config schema bump for profile persistence, ElvUICompat module, Init.lua integration, locale strings, and luacheckrc update for ReloadUI global.

✏️ 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@DragonLoot/Core/ElvUICompat.lua`:
- Around line 214-251: The StaticPopup frame stores a stale self.accepted flag
between pooled shows which can prevent OnHide from persisting dismissals; update
the StaticPopupDialogs["DRAGONLOOT_ELVUI_CONFLICT"] definition to reset that
flag when the popup is shown (add an OnShow that sets self.accepted = nil or
false) or otherwise clear self.accepted right before calling StaticPopup_Show;
ensure the reset occurs regardless of data so OnAccept (which sets self.accepted
= true) and OnHide (which checks it) behave correctly for each new display of
the popup and still call ns.ElvUICompat.Disable and ReloadUI as before.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 57268df5-476a-4bee-977f-9ba268d0e48f

📥 Commits

Reviewing files that changed from the base of the PR and between 0b8596f and 2d5595b.

📒 Files selected for processing (6)
  • .luacheckrc
  • DragonLoot/Core/Config.lua
  • DragonLoot/Core/ElvUICompat.lua
  • DragonLoot/Core/Init.lua
  • DragonLoot/DragonLoot.toc
  • DragonLoot/Locales/enUS.lua

Comment thread DragonLoot/Core/ElvUICompat.lua
Addresses CodeRabbit: reset self.accepted on StaticPopup OnShow so pooled frame reuse cannot carry stale accept state into a later dismissal path. Also updates Config_spec tests to assert schemaVersion == 3 and re-seeds the iconSize migration test at v3 so the FillMissingDefaults skip path is exercised as originally intended.
@Xerrion Xerrion merged commit da18e5b into master Apr 18, 2026
3 checks passed
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.

[Feature]: Detect ElvUI loot conflict and offer to disable

1 participant