Uh oh!
There was an error while loading. Please reload this page.
Fix #323: hide level unlock message on locked levels - #414
Merged
Conversation
generateLevelDescription() fell back to the level's unlock
("Congratulations...") message as the lore description regardless of
whether the level was unlocked, so a locked level showed the congrats
text while its status read "locked / N challenges to go".
Gate the fallback on levelStatus.isUnlocked() so a locked level keeps
its status text and only unlocked levels show the unlock message.
Added CommonPanelTest coverage asserting getUnlockMessage() is not
consulted for a locked level and is for an unlocked one.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NKxodNE4h3TsSHMqDEeC8vUh oh!
There was an error while loading. Please reload this page.
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 freeto 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.



Fixes#323
Problem
A locked mission/level showed its "Congratulations…" unlock message in the lore even though the status underneath said the level was locked.
Cause
CommonPanel.generateLevelDescription()used the level's unlock message as the description fallback unconditionally. The rewards and waiver lines were already gated onlevelStatus.isUnlocked(), but the description line was not.Fix
Only fall back to the unlock message when
levelStatus.isUnlocked(). Locked levels keep their "locked / N challenges to go" status text.Test
Added
CommonPanelTest.testLockedLevelDoesNotShowUnlockMessage/testUnlockedLevelShowsUnlockMessage, assertinggetUnlockMessage()is not consulted for a locked level and is for an unlocked one. Verified the locked test fails against the pre-fix code.🤖 Generated with Claude Code