Skip to content

feat: add configurable tooltip position and offsets#54

Merged
Xerrion merged 1 commit into
masterfrom
fix/53-tooltip-overlap
Jun 9, 2026
Merged

feat: add configurable tooltip position and offsets#54
Xerrion merged 1 commit into
masterfrom
fix/53-tooltip-overlap

Conversation

@Xerrion

@Xerrion Xerrion commented Jun 9, 2026

Copy link
Copy Markdown
Owner

What

Adds configurable positioning for the PhDamage companion tooltip frame.

Why

The tooltip was hardcoded to anchor below GameTooltip (SetPoint("TOPLEFT", GameTooltip, "BOTTOMLEFT", 0, -4)), causing overlap when the default game tooltip is positioned at the bottom-right of the screen.

Changes

  • Core/Init.lua — Added tooltip defaults (position, offsetX, offsetY) to DB defaults; calls ns.Tooltip.ApplySettings() in OnInitialize
  • Core/Options.lua — Added Tooltip section to options panel: position dropdown (BOTTOM/TOP/LEFT/RIGHT) and offset sliders (±200px) with per-arg DB key handlers
  • Presentation/Tooltip.lua — Replaced hardcoded SetPoint with POSITION_MAP-driven anchoring via ApplySettings(); reads from AceDB profile

Review

Both reviewer passes completed clean. Defaults preserve old behavior.

Closes #53

Summary by CodeRabbit

Release Notes

  • New Features
    • Tooltip positioning is now configurable. Users can customize tooltip placement location and adjust horizontal and vertical offsets through dedicated settings controls to suit their preferences.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40080858-3304-483f-b928-b902ac9c7016

📥 Commits

Reviewing files that changed from the base of the PR and between 69aafff and 8407763.

📒 Files selected for processing (3)
  • Core/Init.lua
  • Core/Options.lua
  • Presentation/Tooltip.lua

📝 Walkthrough

Walkthrough

The PR adds configurable tooltip positioning to resolve tooltip overlap issues. A new tooltip settings table in SavedVariables schema captures position type and X/Y offsets. A new ApplySettings() function reads these settings, maps position names to anchor point pairs, and repositions the companion frame. UI controls let users adjust positioning and reset to defaults. Initialization calls ApplySettings() at startup and after hooks are installed.

Changes

Tooltip Positioning Configuration

Layer / File(s) Summary
Tooltip positioning schema and defaults
Core/Init.lua
SavedVariables schema extended with tooltip table containing default position, offsetX, and offsetY values.
Tooltip positioning implementation
Presentation/Tooltip.lua
Local variables store resolved anchor points and offsets. ApplySettings() function reads config, maps position names via POSITION_MAP to anchor pairs, computes offsets, and repositions companion frame. Frame layout re-anchoring uses resolved state instead of hardcoded SetPoint("TOPLEFT", GameTooltip, "BOTTOMLEFT", 0, -4).
Tooltip positioning options UI
Core/Options.lua
AceConfig options group added with TOOLTIP_POSITIONS mapping, GetTooltip() and ApplyTooltip() helpers, position dropdown select, horizontal and vertical offset range sliders, and reset action that copies defaults and reapplies positioning.
Initialization and lifecycle wiring
Core/Init.lua, Presentation/Tooltip.lua
PhDamage:OnInitialize() calls ns.Tooltip.ApplySettings() to apply saved positioning at startup. Tooltip deferred initialization calls ApplySettings() after hooks are installed.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% 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 title accurately summarizes the main change—adding configurable tooltip positioning and offset controls—and is clear and specific.
Linked Issues check ✅ Passed The changes fully address issue #53 by making the tooltip configurable with position and offset options instead of hardcoded placement.
Out of Scope Changes check ✅ Passed All changes are directly scoped to solving tooltip overlap through configurable positioning; no unrelated modifications detected.

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

@Xerrion Xerrion mentioned this pull request Jun 9, 2026
@Xerrion
Xerrion merged commit 0cc92e7 into master Jun 9, 2026
3 checks passed
@Xerrion
Xerrion deleted the fix/53-tooltip-overlap branch June 9, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Tooltip overlap

1 participant