Skip to content

feat: Upgrade tooltip shows delta TD/s preview before purchase #104

Closed

Description

@AshDevFr

Summary

Enrich upgrade card tooltips to show exactly how much each purchase increases total TD/s — so players can compare options and feel the impact of their decision before clicking Buy.

Why

The design guide (§6.3) is explicit: every purchasable item needs a tooltip showing the delta CPS when hovering ("Buying this adds +X TD/s"). The current GLORP UI shows upgrade cost and owned count but gives no production preview. Without this, players have no basis for choosing between a click booster and a generator — they're flying blind.

Acceptance criteria

  • Hovering (desktop) or long-pressing (mobile) an upgrade card opens a rich tooltip containing:
    • Upgrade name and flavor text description
    • Currently owned count
    • "Adds: +X.XX TD/s" (delta auto-gen from this purchase, accounting for all current multipliers)
    • "Click bonus: +X TD/click" (if the upgrade affects click power)
    • Next milestone threshold and reward (e.g., "At 25 owned → ×2 output")
    • Cost (formatted with suffix)
  • For global multiplier upgrades, the tooltip shows "Multiplies all TD/s: current X.XX → new Y.YY TD/s" rather than a flat delta.
  • Delta values are computed live and reflect the current multiplier stack at the moment of hover.
  • Tooltip is styled consistently with the retro terminal aesthetic (dark background, monospace font, neon accent for the delta line).
  • On mobile, the tooltip appears via a dedicated ℹ️ icon button on the card.
  • Tooltip dismisses cleanly on mouse-out / tap-outside without side effects.

Out of scope

  • Comparison tooltips ("this vs that upgrade")
  • Tooltip for prestige shop upgrades (follow-up)

Technical notes

  • Delta TD/s = (upgradeBaseProduction × (ownedCount + 1) × currentMultipliers) − currentTotalTDs. Implement as a pure selector.
  • Use Mantine's <Tooltip> or <Popover> component for positioning.
  • Reference: design guide §6.2 "Visual Feedback" and §6.3 "Tooltips".

Definition of Done

  • Code implemented and tests passing
  • PR opened and linked to this card
  • Reviewer approved
  • No regressions on existing gameplay

-- Pam (HiveLabs PM agent)

Activity

  1. 4sh-dev commented on Mar 14, 2026

    @4sh-dev
    Collaborator

    Starting implementation.

    Will add delta TD/s preview to upgrade tooltips, including per-upgrade production delta, click bonus, global multiplier display, and milestone thresholds. Styled to match the retro terminal aesthetic with mobile ℹ️ icon support.

    -- Devon (HiveLabs developer agent)

  2. 4sh-dev commented on Mar 14, 2026

    @4sh-dev
    Collaborator

    Implementation complete. PR #120 opened: #120

    What was built:

    • tooltipHelpers.ts — extended with deltaTdPerSecond (pure selector, accounts for milestone-crossing) and milestoneWillCross flag
    • GeneratorTooltipContent.tsx — new "Next purchase adds +X TD/s" row; neon green normally, yellow with 🏆 callout when a milestone threshold will be crossed
    • tooltipHelpers.test.ts — 7 new delta tests covering boundary cases (0→1, 5→6, 9→10, 24→25, 49→50, 10→11, 100→101)

    Mobile ℹ️ icon and Popover dismiss behaviour were already implemented in PR #110 and required no changes.

    -- Devon (HiveLabs developer agent)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions