Remove gap between buff bars and external defensives when some buff bars are hidden#100
Conversation
Agent-Logs-Url: https://github.com/argium/EnhancedCooldownManager/sessions/b2e3f6e3-351f-4a4b-ba56-3c44bd054d59 Co-authored-by: argium <15852038+argium@users.noreply.github.com>
Test Results896 tests ±0 896 ✅ ±0 2s ⏱️ ±0s Results for commit 21726c4. ± Comparison against base commit a556c7b. This pull request removes 27 and adds 27 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Agent-Logs-Url: https://github.com/argium/EnhancedCooldownManager/sessions/b5e909c2-21e4-43f1-8b34-1c759810a458 Co-authored-by: argium <15852038+argium@users.noreply.github.com>
Agent-Logs-Url: https://github.com/argium/EnhancedCooldownManager/sessions/b5e909c2-21e4-43f1-8b34-1c759810a458 Co-authored-by: argium <15852038+argium@users.noreply.github.com>
Agent-Logs-Url: https://github.com/argium/EnhancedCooldownManager/sessions/0909b6db-98b9-47e8-8089-0301a8e476b7 Co-authored-by: argium <15852038+argium@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a layout bug where the BuffBarCooldownViewer reserved space for hidden buff bars in chained-layout mode, leaving a visible gap before subsequent modules (e.g. external defensives). The fix counts only currently shown child bars when sizing the viewer height, and prefers the module-level cfg.height over the global barHeight fallback.
Changes:
- Count only
IsShown()child bars and explicitly set the viewer height withFrameUtil.LazySetHeightbased onshownChildCountandverticalSpacing. - Use module-level
cfg.heightwhen present, falling back toglobalConfig.barHeight. - Extend test setup to stub
LazySetHeightand assert the computed height (21 for a single shown bar withcfg.height = 21).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Modules/BuffBars.lua | Tracks shown child count during styling and sizes the viewer height from shown bars + spacing using module height override. |
| Tests/Modules/BuffBars_spec.lua | Stubs LazySetHeight in chain/free-mode harnesses and asserts viewer height honors cfg.height. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b980d1cca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| end | ||
| ns.DebugAssert(ok, "Error styling buff bars: " .. tostring(err)) | ||
|
|
||
| local barHeight = (cfg and cfg.height) or globalConfig.barHeight or 0 |
There was a problem hiding this comment.
Guard missing global config when sizing the viewer
When GetGlobalConfig() returns nil, for example during an early or partially initialized profile/layout pass where ShouldShow() can still be true from the module config, this new height calculation indexes globalConfig.barHeight outside the existing pcall and turns the layout into an uncaught Lua error. The rest of this path and similar sizing code use (globalConfig and globalConfig.barHeight) or a default, so keep the same guard here before falling back.
Useful? React with 👍 / 👎.
Agent-Logs-Url: https://github.com/argium/EnhancedCooldownManager/sessions/6b3df578-f260-4449-8b16-25487504b53f Co-authored-by: argium <15852038+argium@users.noreply.github.com>
…ars are hidden (#100) Remove gap between buff bars and external defensives when some buff bars are hidden. Hidden bars still reserved space in the viewer leading to a visible gap. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: argium <15852038+argium@users.noreply.github.com>
Remove gap between buff bars and external defensives when some buff bars are hidden. Hidden bars still reserved space in the viewer leading to a visible gap.