feat: click-bonus and global-multiplier upgrade tooltip variants (#121)#123
Merged
AshDevFr merged 1 commit intoAshDevFr:mainfrom Mar 14, 2026
Merged
Conversation
Extends the tooltip system from PR AshDevFr#120 to cover the two upgrade types that were deferred: click-bonus upgrades and global-multiplier (booster) upgrades. Changes: - tooltipHelpers.ts: add computeClickBonusTooltipData and computeGlobalMultiplierTooltipData pure selector functions - ClickUpgradeTooltipContent: reads live game state to show "+X TD/click" bonus delta on unpurchased click upgrades - BoosterTooltipContent: new component showing "current X TD/s → new Y TD/s" before/after pair for unpurchased boosters - BoosterCard: wrapped in Popover with ℹ info trigger, matching the ClickUpgradeCard pattern - tooltipHelpers.test.ts: 10 new unit tests covering both selectors; also fixed two stale test expectations that did not account for the neural-notepad self-synergy activating at owned=50 Closes AshDevFr#121
12 tasks
AshDevFr
approved these changes
Mar 14, 2026
Owner
AshDevFr
left a comment
There was a problem hiding this comment.
Review Summary — PR #123
Verdict: ✅ Approved
What was reviewed
All 5 changed files across the tooltip variant feature: the two new pure selector functions in tooltipHelpers.ts, the new BoosterTooltipContent.tsx component, the updated ClickUpgradeTooltipContent.tsx, the BoosterCard.tsx Popover integration, and the expanded test suite in tooltipHelpers.test.ts.
What looks good
- Clean architecture: Selector logic is pure and lives in
tooltipHelpers.ts, completely decoupled from React. Components only read state and render — excellent separation of concerns. - Decimal handling: Both new selectors use
break_infinity.jsDecimal correctly throughout, consistent with the post-PR #118 codebase. - Click-bonus floor logic: The
max(1, ...)floor incomputeClickBonusTooltipDatacorrectly mirrors the real engine, so early-game tooltips won't show misleading sub-1 values. Combo exclusion is well-justified (transient) and documented in the JSDoc. - Booster tooltip:
computeGlobalMultiplierTooltipDatais clean and minimal — justcurrent × multiplier. Hard to get wrong, and well-tested. - Pre-existing test fixes: The two corrected assertions for
neural-notepadself-synergy at owned=50 and owned=100 are mathematically correct. The updated comments clearly walk through the arithmetic — nice documentation. - Test coverage: 10 new tests with good edge case coverage (zero TD/s, floor behavior, stacked upgrades, prestige bonuses, species multipliers, large Decimal input).
- Mobile accessibility: The
ActionIcontap trigger onBoosterCardwith theisHoverDeviceref guard matches the existingClickUpgradeCardpattern. - Challenge mode: No-prestige challenge correctly zeroes prestige bonuses in both tooltip components.
Minor notes (non-blocking)
- nit: The no-prestige challenge logic (
activeChallengeId === "no-prestige" ? {} : prestigeUpgrades+ theas Record<string, number>cast +getIdleBoostMultiplier/getClickMasteryBonuscalls) is now duplicated acrossBoosterTooltipContentandClickUpgradeTooltipContent. If a third tooltip variant appears, consider extracting a shareduseEffectivePrestige()hook. Not worth a round-trip for two occurrences. - nit: Width bump from 210→220 on
ClickUpgradeTooltipContentis fine for consistency with the newBoosterTooltipContent, but worth noting for anyone doing pixel-level design review.
CI
No configured status checks on this repo (consistent with prior merges). Developer reports 689 tests passing, lint clean, build clean.
Merging via rebase.
-- Remy (HiveLabs reviewer agent)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the rich upgrade tooltip system (shipped in PR #120) to the two upgrade types that were explicitly deferred: click-bonus upgrades and global-multiplier (booster) upgrades.
Changes
New pure selector functions (
tooltipHelpers.ts)computeClickBonusTooltipData— computes current/future/delta click power for a click upgrade. Excludes combo (transient) but applies themax(1, ...)floor to match the real engine. Respects all active multipliers: idle boost, species click power, click mastery prestige.computeGlobalMultiplierTooltipData— computes before/after total TD/s for a booster.newTdPerSecond = currentTdPerSecond × booster.multiplier.Updated
ClickUpgradeTooltipContent.tsxuseGameStoreto compute the click-bonus delta at hover time.New
BoosterTooltipContent.tsxuseGameStoreto compute before/after TD/s at hover time.Updated
BoosterCard.tsxPopover(matchingClickUpgradeCardpattern).ActionIconfor mobile tap trigger — opens/closes tooltip without hover.Test fixes in
tooltipHelpers.test.tsdescribeblocks for both selectors.neural-notepadself-synergy (+100%, ×2) that activates simultaneously with the x3 milestone atowned=50. Updated comments explain the correct maths.Testing
npm run test— 689 tests passing ✅npm run lint— clean (only pre-existing warnings inupgradeEngine.test.ts, not from this PR) ✅npm run build— clean ✅Story link
Closes #121
-- Devon (HiveLabs developer agent)