Skip to content

Fix stall upgrade milestone bug and Tray Return Uncle UI#87

Merged
candour merged 1 commit into
mainfrom
fix-stall-upgrade-milestone-bug-1376705094390295857
Apr 25, 2026
Merged

Fix stall upgrade milestone bug and Tray Return Uncle UI#87
candour merged 1 commit into
mainfrom
fix-stall-upgrade-milestone-bug-1376705094390295857

Conversation

@candour

@candour candour commented Apr 24, 2026

Copy link
Copy Markdown
Owner

This change fixes a bug where food stalls (towers) could become stuck below Level 10 (the legendary milestone) if their fire rate hit the 50ms floor. The upgrade logic now correctly allows leveling to continue while clamping the fire rate at 50ms.

Additionally, it fixes a UI issue for the 'Tray Return Uncle' stall where stats were being displayed twice (once with the generic 'Rate'/'Duration' labels and once with the themed 'Grab Rate'/'Cleaning Time' labels). The internal logic still keeps these values in sync for compatibility, but the UI now filters out the redundant generic labels.


PR created automatically by Jules for task 1376705094390295857 started by @candour

Summary by CodeRabbit

  • Bug Fixes

    • Fixed upgrade system to allow upgrades to proceed when reaching value limits; values are now properly capped instead of blocking the upgrade.
    • Adjusted UI to hide certain upgrade categories for specific stall types.
  • Tests

    • Updated test scenarios to verify corrected upgrade behavior.

- Modified `MainViewModel.kt` to allow stall leveling always, even if the stat value has hit its floor or cap. Stat values are now clamped using `Math.max`/`Math.min` instead of skipping the upgrade. This ensures milestone levels (e.g., Level 10) can always be reached to trigger legendary naming.
- Restored synchronization of themed upgrade keys ("Grab Rate", "Cleaning Time") to standard keys ("Rate", "Duration") for Tray Return Uncle stalls in `MainViewModel.kt`.
- Updated `StallConsole.kt` to filter out redundant "Rate" and "Duration" labels for Tray Return Uncle stalls, preventing double-display of these stats in the UI.
- Updated `MilestoneBoostTest.kt` to verify that upgrades can proceed past the stat floor.

Co-authored-by: candour <4670475+candour@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 22945beb-fd99-41b4-b511-0fc7db734c6f

📥 Commits

Reviewing files that changed from the base of the PR and between a1cc0c1 and 70aba5f.

📒 Files selected for processing (3)
  • app/src/main/java/com/messark/hawker/MainViewModel.kt
  • app/src/main/java/com/messark/hawker/ui/components/StallConsole.kt
  • app/src/test/java/com/messark/hawker/MilestoneBoostTest.kt

📝 Walkthrough

Walkthrough

The pull request modifies upgrade mechanics to apply value clamping instead of skipping upgrades when limits are reached, updates UI filtering to hide specific upgrades for a particular stall type, and adjusts test expectations to reflect the new clamping behavior.

Changes

Cohort / File(s) Summary
Upgrade Logic Modifications
app/src/main/java/com/messark/hawker/MainViewModel.kt
Replaces conditional skip logic with Math.max and Math.min clamping for rate and duration upgrades. For TRAY_RETURN_UNCLE "Grab Rate" upgrades, clamps newFireRate to minimum 10000L. For "Cleaning Time" upgrades, clamps newEffectDuration to maximum 4000L. For general rate upgrade category, clamps to floor value. For "Cleaning Time" category, clamps to cap value.
UI Display Filtering
app/src/main/java/com/messark/hawker/ui/components/StallConsole.kt
Conditionally filters upgrade entries in STATS box rendering: when stall type is TRAY_RETURN_UNCLE, excludes "Rate" and "Duration" keys from displayed upgrades before computing benefits and rendering StatLine rows.
Test Expectations Update
app/src/test/java/com/messark/hawker/MilestoneBoostTest.kt
Rewrites upgradeStall test scenario to set initial Rate level to 10 with fireRateMs at 50ms minimum, repeatedly calls upgradeStall(), and verifies Rate reaches level 11 while fireRateMs remains capped at 50ms, replacing previous assertion that Rate would stay at level 9.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 describes the main changes: fixing a stall upgrade milestone bug and addressing a Tray Return Uncle UI duplication issue, matching the PR's core objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-stall-upgrade-milestone-bug-1376705094390295857

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

Build Successful! 🚀

Download APK

Note: This link will be removed when the PR is closed.

@candour
candour merged commit 8b5d2e2 into main Apr 25, 2026
3 checks passed
@candour
candour deleted the fix-stall-upgrade-milestone-bug-1376705094390295857 branch April 25, 2026 00:29
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.

1 participant