Skip to content

Add configurable decimal display for aura countdowns - #1

Merged
DanderBot merged 1 commit into
mainfrom
codex/add-countdown-formatting-options-for-buffs
Dec 1, 2025
Merged

Add configurable decimal display for aura countdowns#1
DanderBot merged 1 commit into
mainfrom
codex/add-countdown-formatting-options-for-buffs

Conversation

@DanderBot

Copy link
Copy Markdown
Owner

Summary

  • add profile defaults for selecting aura countdown decimal formatting per buff and debuff
  • update countdown rendering to honor whole-second or tenths display modes
  • expose new dropdowns in the options UI for choosing countdown decimal behavior

Testing

  • not run (not provided)

Codex Task

@DanderBot
DanderBot merged commit 187283f into main Dec 1, 2025
@DanderBot
DanderBot deleted the codex/add-countdown-formatting-options-for-buffs branch February 14, 2026 13:29
DanderBot added a commit that referenced this pull request Apr 9, 2026
Addresses audit finding #3 from _Reference/performance-audit-2026-04.md.
Frames/Update.lua was calling 11 Unit* API functions via the global
environment on every invocation of its hot-path functions. Each global
lookup compiles to a hash table access; caching the function reference
at file scope turns every call site into a pure upvalue access, which
the Lua interpreter compiles to a direct register read.

Matching pattern: Frames/Bars.lua:8-19 already does this for its own
hot-path unit APIs.

Cached functions (each used 1-6 times per UpdateHealthFast /
UpdatePower / UpdateUnitFrame call):

  UnitExists
  UnitClass
  UnitIsConnected
  UnitIsDead
  UnitIsGhost
  UnitHealth
  UnitHealthMax
  UnitHealthMissing
  UnitPower
  UnitPowerMax
  UnitPowerType
  InCombatLockdown  (used in ApplyFrameLayout)

38 existing call sites are affected. No call-site edits needed — Lua
lexical scope resolves every subsequent reference in the file to the
new upvalues automatically. Verified via grep: no shadowing or
reassignment of these names anywhere else in the file.

Expected profile impact (audit projected 5-10% raid CPU savings on
UpdateHealthFast + UpdatePower):

  UpdateHealthFast:  191 us/call  ->  ~160-180 us/call (estimated)
  UpdatePower:       unchanged per-call cost, maybe -5%
  Total raid CPU:    -2-5% (rough projection, raid scale)

The per-call savings are small individually but UpdateHealthFast is
now the #1 CPU consumer after the Dispel refactor landed (27.9% in
the latest 5-man profile, ~10% in the earlier raid profile), so even
a few microseconds per call compound at 100+ calls/sec in raid content.

Verification:
* /reload loads without errors
* Unit health bars still update correctly on damage/heals
* Power bars still track correctly on resource changes
* Dead/ghost/disconnected/out-of-range states still render correctly
* Class color still applies correctly to health bars

Low regression risk — this is a pure identifier caching change with
zero behavior implications. If anything breaks, it's almost certainly
unrelated (but rollback via git reset --hard dispel-fix-complete).
DanderBot added a commit that referenced this pull request Apr 10, 2026
Replaces the scaffolded stubs with the full cast-lifecycle
implementation. Debug output via DF:Debug("TARGETEDLIST", ...) is
used as a stand-in for visual bars until commit #5 lands the render
pipeline — this lets in-game verification happen against the debug
console without requiring the full rendering work first.

All 13 correctness gotchas from the TS3 cross-reference in
_Reference/targeted-spells-findings.md are handled and tagged inline:

  #1  0.2s delay before reading cast data (start events fire before
      UnitSpellTargetName / duration are populated)
  #2  Cast-ID matching at both pickup (via UnitCastingInfo) and stop
      (via event castGuid) — prevents rapid-restart flicker
  #3  UNIT_SPELLCAST_SUCCEEDED during an active channel is treated
      as a no-op (channel tick, not a stop)
  #4  INTERRUPTED with nil interrupter or a dead caster is treated
      as a normal stop (no interrupter flash)
  #6  Empower spellId/castGuid offset handled (same shape as regular
      start on current retail — documented inline)
  #7  Interrupter lookup via UnitNameFromGUID / UnitClassFromGUID
  #8  Uninterruptible flag from UnitCastingInfo/UnitChannelInfo is
      treated as secret-tainted and only ever fed to
      SetVertexColorFromBoolean (applied in commit #5)
  #9  UNIT_SPELLCAST_INTERRUPTIBLE / NOT_INTERRUPTIBLE overwrite the
      stored uninterruptible field with a clean boolean
  #11 LOADING_SCREEN_DISABLED triggers a full release sweep

Also adds the cast-targeting filter pipeline:

  * TargetedList_IsRelevantCaster filters out non-nameplate units,
    friendly units, and party-member nameplates
  * TargetedList_ReadCastData unifies UnitCastingInfo / UnitChannelInfo
    read paths, handling the positional offset difference for
    castID vs notInterruptible between the two APIs
  * Important-spells filter via C_Spell.IsSpellImportant
  * Hide-own-casts filter
  * Roster name cache used for O(1) target lookup

Event dispatcher extended to route NAME_PLATE_UNIT_ADDED and
UNIT_TARGET through the start handler so new nameplates and mid-cast
target swaps are picked up. UNIT_TARGET also fires an immediate stop
to drop the old tracking — the 0.2s delayed re-pickup recreates it
if the new target is still a party member.

Content-type filter (gotcha #13) is intentionally deferred to
commit #5 since the existing TargetedSpells content-type detection
can be reused rather than duplicated.
Krathe82 referenced this pull request in Krathe82/DandersFrames Jun 6, 2026
)

Addresses audit finding DanderBot#3 from _Reference/performance-audit-2026-04.md.
Frames/Update.lua was calling 11 Unit* API functions via the global
environment on every invocation of its hot-path functions. Each global
lookup compiles to a hash table access; caching the function reference
at file scope turns every call site into a pure upvalue access, which
the Lua interpreter compiles to a direct register read.

Matching pattern: Frames/Bars.lua:8-19 already does this for its own
hot-path unit APIs.

Cached functions (each used 1-6 times per UpdateHealthFast /
UpdatePower / UpdateUnitFrame call):

  UnitExists
  UnitClass
  UnitIsConnected
  UnitIsDead
  UnitIsGhost
  UnitHealth
  UnitHealthMax
  UnitHealthMissing
  UnitPower
  UnitPowerMax
  UnitPowerType
  InCombatLockdown  (used in ApplyFrameLayout)

38 existing call sites are affected. No call-site edits needed — Lua
lexical scope resolves every subsequent reference in the file to the
new upvalues automatically. Verified via grep: no shadowing or
reassignment of these names anywhere else in the file.

Expected profile impact (audit projected 5-10% raid CPU savings on
UpdateHealthFast + UpdatePower):

  UpdateHealthFast:  191 us/call  ->  ~160-180 us/call (estimated)
  UpdatePower:       unchanged per-call cost, maybe -5%
  Total raid CPU:    -2-5% (rough projection, raid scale)

The per-call savings are small individually but UpdateHealthFast is
now the #1 CPU consumer after the Dispel refactor landed (27.9% in
the latest 5-man profile, ~10% in the earlier raid profile), so even
a few microseconds per call compound at 100+ calls/sec in raid content.

Verification:
* /reload loads without errors
* Unit health bars still update correctly on damage/heals
* Power bars still track correctly on resource changes
* Dead/ghost/disconnected/out-of-range states still render correctly
* Class color still applies correctly to health bars

Low regression risk — this is a pure identifier caching change with
zero behavior implications. If anything breaks, it's almost certainly
unrelated (but rollback via git reset --hard dispel-fix-complete).
Krathe82 referenced this pull request in Krathe82/DandersFrames Jun 6, 2026
Replaces the scaffolded stubs with the full cast-lifecycle
implementation. Debug output via DF:Debug("TARGETEDLIST", ...) is
used as a stand-in for visual bars until commit DanderBot#5 lands the render
pipeline — this lets in-game verification happen against the debug
console without requiring the full rendering work first.

All 13 correctness gotchas from the TS3 cross-reference in
_Reference/targeted-spells-findings.md are handled and tagged inline:

  #1  0.2s delay before reading cast data (start events fire before
      UnitSpellTargetName / duration are populated)
  DanderBot#2  Cast-ID matching at both pickup (via UnitCastingInfo) and stop
      (via event castGuid) — prevents rapid-restart flicker
  DanderBot#3  UNIT_SPELLCAST_SUCCEEDED during an active channel is treated
      as a no-op (channel tick, not a stop)
  DanderBot#4  INTERRUPTED with nil interrupter or a dead caster is treated
      as a normal stop (no interrupter flash)
  DanderBot#6  Empower spellId/castGuid offset handled (same shape as regular
      start on current retail — documented inline)
  DanderBot#7  Interrupter lookup via UnitNameFromGUID / UnitClassFromGUID
  DanderBot#8  Uninterruptible flag from UnitCastingInfo/UnitChannelInfo is
      treated as secret-tainted and only ever fed to
      SetVertexColorFromBoolean (applied in commit DanderBot#5)
  DanderBot#9  UNIT_SPELLCAST_INTERRUPTIBLE / NOT_INTERRUPTIBLE overwrite the
      stored uninterruptible field with a clean boolean
  DanderBot#11 LOADING_SCREEN_DISABLED triggers a full release sweep

Also adds the cast-targeting filter pipeline:

  * TargetedList_IsRelevantCaster filters out non-nameplate units,
    friendly units, and party-member nameplates
  * TargetedList_ReadCastData unifies UnitCastingInfo / UnitChannelInfo
    read paths, handling the positional offset difference for
    castID vs notInterruptible between the two APIs
  * Important-spells filter via C_Spell.IsSpellImportant
  * Hide-own-casts filter
  * Roster name cache used for O(1) target lookup

Event dispatcher extended to route NAME_PLATE_UNIT_ADDED and
UNIT_TARGET through the start handler so new nameplates and mid-cast
target swaps are picked up. UNIT_TARGET also fires an immediate stop
to drop the old tracking — the 0.2s delayed re-pickup recreates it
if the new target is still a party member.

Content-type filter (gotcha DanderBot#13) is intentionally deferred to
commit DanderBot#5 since the existing TargetedSpells content-type detection
can be reused rather than duplicated.
Krathe82 referenced this pull request in Krathe82/DandersFrames Jul 12, 2026
… Edit Mode error

12.1 replaced the attribute that enables the wrapper's health-bar
gradient: show-dispel-indicator-overlay and suppress-dispel-border-icons
are unread; dispel-indicator-overlay-type (RaidDispelOverlayType enum)
now controls it, and unset means the gradient/border/background are
zeroed — only the small dispel icon rendered. Feature-detected on the
enum; pre-12.1 keeps the legacy attributes. aura-organization-type is
unchanged (still the 0-based RaidAuraOrganizationType, matching the
stored Gradient Direction values 1:1). The new pulse-animation knob is
wired internally, off by default.

Also fixes 4x "bad argument #1 to 'ipairs'" when opening Edit Mode with
the overlay active: a game bug — GetAllPrivateAuras returns nil under
Edit Mode's sample provider and the private-aura watcher iterates it
unguarded. Our wrapper anchors kept a per-unit watcher alive, so they
now suspend on a foreign provider switch and rebuild when the real
provider returns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DanderBot pushed a commit that referenced this pull request Aug 3, 2026
RESOLVERS.group is the single biggest allocator in the addon -- 38% of a
follower-dungeon trace and 43.6% of a boss trace, #1 in both -- and almost all of
it was scratch. Every call built a fresh `parts` table plus a fresh 14-field
element table PER ITEM, from config that only changes when the user edits it.

Both now reuse module-level tables. Safe because groups cannot nest: the Text
Designer's Add Item picker passes excludeKey = "group", so RESOLVERS[typeKey]
can never route back into this resolver and it is never re-entered. No resolver
retains its elem argument either -- they only read fields, and applyNameTrunc
reads just nameLength/truncateMode. `parts` never escapes: it is appended,
iterated, and the function returns a plain string.

Every field of the shared element table is assigned on every iteration, nil
included, so nothing leaks from one item to the next.

Also guarded the four DF:Debug calls with DF:DebugActive("TD"). Arguments are
evaluated by the caller, so the unguarded per-call one allocated two strings via
tostring() on every tick even with the trace switched off. Matches the existing
guard pattern in ClickCasting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant