Skip to content

feat: pending highest roller and hover tooltips for loot history (#90)#154

Open
Xerrion wants to merge 1 commit intomasterfrom
feat/90-pending-roller-and-hover-tooltips
Open

feat: pending highest roller and hover tooltips for loot history (#90)#154
Xerrion wants to merge 1 commit intomasterfrom
feat/90-pending-roller-and-hover-tooltips

Conversation

@Xerrion
Copy link
Copy Markdown
Owner

@Xerrion Xerrion commented Apr 26, 2026

Description

Closes #90

Adds three improvements to the loot history frame:

  1. Pending highest roller: While a roll is in progress, the entry shows the current highest roller in their class color, formatted Highest: PlayerName (87). When the roll resolves, this is replaced by the class-colored winner name as before. If all current rolls are passes, the entry shows (waiting on rolls) in grey.

  2. Hover tooltip with roll details: Hovering a history entry now shows the standard item tooltip (unchanged) plus an appended Rolls: section listing every roll, sorted highest non-pass first, then passes at the bottom. Each row shows the player name in their class color and the roll value with type (87 (Need)) on the right.

  3. Item tooltip on icon hover: The existing entry-wide hover already covers the icon area. No separate code path was needed; the same combined tooltip is shown whether the cursor is over the icon or anywhere else on the row.

Click-to-expand inline detail rows (governed by db.profile.history.showRollDetails) is preserved unchanged - both interactions now coexist.

Type of change

  • New feature

How has this been tested?

  • luacheck . passes with 0 new warnings (31 pre-existing in Libs/DragonWidgets/).
  • Manual verification recommended: trigger a group roll and confirm "Highest" updates as players roll in, then resolves to the winner name; hover the entry and confirm the tooltip shows item info plus a sorted roll breakdown.

Checklist

  • My code follows the project's style guidelines (4-space indent, no tabs, 120-char limit, plain hyphens only)
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (locale strings added)
  • My changes generate no new warnings
  • Click-to-expand behavior preserved (no regression)

Affected versions

  • Retail
  • TBC Anniversary Classic
  • MoP Classic

Summary by CodeRabbit

  • New Features
    • History entries now display pending roll status while awaiting results
    • Enhanced tooltips show sorted roll results with highest rolls first, followed by passes
    • Class-colored per-player roll details appear in tooltip display
    • UI dynamically shows pending leader during rolling, switching to final winner when complete

- Add pendingText fontstring to history entries showing current
  highest roller in their class color while a roll is in progress
- Switch to class-colored winner name when roll resolves
- Show "(waiting on rolls)" greyed out when all rolls are passes
- Hover tooltip on history entries now appends a sorted roll
  breakdown (highest first, passes last) to the existing item
  tooltip, with class-colored player names
- Click-to-expand inline behavior preserved
- Add 3 enUS locale keys: "Highest: %s (%d)", "(waiting on rolls)",
  "Rolls:"
@Xerrion Xerrion added C-Feature New feature or enhancement A-History Loot history frame and history listeners D-Complex Multiple files or systems involved P-All-Versions Affects all supported WoW versions labels Apr 26, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 26, 2026

📝 Walkthrough

Walkthrough

The changes extend the loot history UI to display the current highest roller during active rolls and show detailed roll results in a tooltip on entry hover. A new pendingText field is conditionally displayed in place of the winner name, and tooltip formatting now includes sorted roll results with class-colored per-player roll lines.

Changes

Cohort / File(s) Summary
Display Logic Updates
DragonLoot/Display/HistoryFrame.lua
Adds pendingText field to entry UI for showing pending leader. Updates tooltip to build "Rolls:" section by sorting _rollResults with highest non-pass rolls first, pass entries last, and class-colored per-player lines. Display logic switches between data.winner (hidden pendingText) and in-progress pending leader from data.rollResults (hidden winnerName). Font/shadow settings now apply to pendingText; pool release clears pendingText.
Localization Strings
DragonLoot/Locales/enUS.lua
Adds three new locale keys: "(waiting on rolls)" status text, "Highest: %s (%d)" roll display format, and "Rolls:" section label for tooltip roll details.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

display, 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 The pull request title follows the Conventional Commit format with type 'feat', scope omitted but allowed, and a descriptive summary of the changes.
Linked Issues check ✅ Passed The PR implementation fully satisfies issue #90 requirements: displays pending highest roller during active rolls, shows roll details on hover with proper sorting and class colors, and preserves existing click-to-expand functionality.
Out of Scope Changes check ✅ Passed All changes are scoped to loot history UI improvements; locale additions and HistoryFrame modifications directly support the pending roller and hover tooltip features specified in issue #90.

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

🧹 Nitpick comments (2)
DragonLoot/Display/HistoryFrame.lua (2)

678-686: Comment is slightly misleading — branch also covers Classic's pre-assignment state.

The elseif data.rollResults and #data.rollResults > 0 branch fires not only when "all passes" but also when non-pass rolls exist without numeric values yet (per the Classic LOOT_HISTORY_ROLL_CHANGED quirk noted in repo learnings). The "(waiting on rolls)" label is actually the correct UX for both, so behavior is fine — just the inline comment understates the cases.

📝 Suggested comment tweak
         elseif data.rollResults and `#data.rollResults` > 0 then
-            -- All passes - rare but possible
+            -- Either all passes, or non-pass rolls without numeric values yet
+            -- (Classic LOOT_HISTORY_ROLL_CHANGED can fire before roll is assigned)
             entry.pendingText:SetText(L["(waiting on rolls)"])

Based on learnings: "Classic LOOT_HISTORY_ROLL_CHANGED may fire before roll value is assigned - skip non-Pass rolls with nil values and rely on a later re-fire with the value".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DragonLoot/Display/HistoryFrame.lua` around lines 678 - 686, The inline
comment above the elseif that checks data.rollResults and `#data.rollResults` > 0
is misleading because that branch also covers Classic's pre-assignment state
where non-pass rolls exist but their numeric values are still nil (see
LOOT_HISTORY_ROLL_CHANGED quirk); update the comment near that conditional
(referencing data.rollResults and entry.pendingText:SetText(L["(waiting on
rolls)"])) to note it handles both "all passes" and Classic pre-assignment
non-numeric rolls (and that we intentionally show "(waiting on rolls)"), and
optionally mention the behavior to skip/await rolls with nil values until a
later update.

659-671: Leader-computation could share the pass/sort logic from OnEntryEnter.

Both OnEntryEnter (lines 491–498) and this block decide what counts as a "pass" (rollType == 0 or missing roll) and pick a max. Today they're consistent, but they're easy to drift if someone tweaks one and forgets the other. A tiny local function GetHighestNonPass(rollResults) ... end would let both paths share truth. Optional, purely a maintainability nit.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DragonLoot/Display/HistoryFrame.lua` around lines 659 - 671, Extract a small
shared function (e.g., local function GetHighestNonPass(rollResults)) that
encapsulates the current logic for skipping passes (rollType == 0 or missing
roll) and returning the highest roll tuple (playerName, playerClass, roll); then
replace the duplicate leader-computation in the HistoryFrame.lua block (the loop
that sets leaderName/leaderClass/leaderRoll) and the logic inside OnEntryEnter
to call GetHighestNonPass(rollResults) instead. Ensure the new function accepts
the rollResults table, applies the same filtering (ignore nil roll or rollType
== 0), compares numeric roll values to pick the max, and returns nils if none
found so both call sites keep their existing variable assignments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@DragonLoot/Display/HistoryFrame.lua`:
- Around line 678-686: The inline comment above the elseif that checks
data.rollResults and `#data.rollResults` > 0 is misleading because that branch
also covers Classic's pre-assignment state where non-pass rolls exist but their
numeric values are still nil (see LOOT_HISTORY_ROLL_CHANGED quirk); update the
comment near that conditional (referencing data.rollResults and
entry.pendingText:SetText(L["(waiting on rolls)"])) to note it handles both "all
passes" and Classic pre-assignment non-numeric rolls (and that we intentionally
show "(waiting on rolls)"), and optionally mention the behavior to skip/await
rolls with nil values until a later update.
- Around line 659-671: Extract a small shared function (e.g., local function
GetHighestNonPass(rollResults)) that encapsulates the current logic for skipping
passes (rollType == 0 or missing roll) and returning the highest roll tuple
(playerName, playerClass, roll); then replace the duplicate leader-computation
in the HistoryFrame.lua block (the loop that sets
leaderName/leaderClass/leaderRoll) and the logic inside OnEntryEnter to call
GetHighestNonPass(rollResults) instead. Ensure the new function accepts the
rollResults table, applies the same filtering (ignore nil roll or rollType ==
0), compares numeric roll values to pick the max, and returns nils if none found
so both call sites keep their existing variable assignments.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: 54dcd949-9342-47d7-825b-dc1658a71be1

📥 Commits

Reviewing files that changed from the base of the PR and between c337e94 and b1f87dd.

📒 Files selected for processing (2)
  • DragonLoot/Display/HistoryFrame.lua
  • DragonLoot/Locales/enUS.lua

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

Labels

A-History Loot history frame and history listeners C-Feature New feature or enhancement D-Complex Multiple files or systems involved display localization P-All-Versions Affects all supported WoW versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Loot history show pending highest roller and roll details on hover

1 participant