Skip to content

Allowed for negative scoring and added app icons - #2

Merged
madebybye merged 1 commit into
mainfrom
celebration
Jan 5, 2026
Merged

madebybye merged 1 commit into
mainfrom
celebration

Conversation

@madebybye

Copy link
Copy Markdown
Owner

No description provided.

@madebybye
madebybye merged commit b0df147 into main Jan 5, 2026
1 check passed
@claude

claude Bot commented Jan 5, 2026

Copy link
Copy Markdown

Pull Request Review: Negative Scoring & App Icons

Overview

This PR adds support for negative scoring and includes comprehensive app icon assets. The changes are straightforward and functional.


✅ Positive Aspects

Code Quality

  • Clean implementation: The negative scoring feature is implemented simply by removing the max(0, ...) guards
  • Consistent pattern: Both addToFloatingScore and commitFloatingScore methods updated uniformly
  • No breaking changes: The change maintains backward compatibility with existing game state

Assets

  • Complete icon set: All required iOS/iPad icon sizes included (20-1024px)
  • Proper asset catalog structure: Icons follow Apple's naming conventions and Contents.json format

🔍 Code Review Findings

Critical Issues

⚠️ Security Concern: Bundle Identifier Change

-PRODUCT_BUNDLE_IDENTIFIER = "com.madebybye.Cribbage-Scorer";
+PRODUCT_BUNDLE_IDENTIFIER = com.affolk.cribbage;
  • Location: Cribbage Scorer.xcodeproj/project.pbxproj:273, 319
  • Impact: This changes the app's unique identifier from com.madebybye.Cribbage-Scorer to com.affolk.cribbage
  • Concerns:
    • Breaking change for existing installations (users will lose their saved game state)
    • Different organization domain suggests potential ownership/deployment issues
    • May conflict with App Store submissions if this doesn't match your developer account
  • Recommendation: Revert this change unless intentional migration. If intentional, add data migration logic to preserve user scores.

⚠️ Development Team Change

-DEVELOPMENT_TEAM = Y2229PLGGP;
+DEVELOPMENT_TEAM = 3KHQR8LD7D;
  • Location: Cribbage Scorer.xcodeproj/project.pbxproj:251, 297
  • Impact: Changes the signing team
  • Recommendation: This appears to be a personal configuration change that shouldn't be committed to the repository. Consider using Xcode's automatic code signing or gitignoring team-specific settings.

⚠️ Deployment Target Inconsistency

-XROS_DEPLOYMENT_TARGET = 26.2;
+XROS_DEPLOYMENT_TARGET = 2.6;
  • Location: Cribbage Scorer.xcodeproj/project.pbxproj:284, 332
  • Impact: This looks like it could be a typo (26.2 → 2.6) or an intentional major version downgrade
  • Recommendation: Verify this is correct. visionOS version 2.6 seems appropriate, but confirm this matches your deployment strategy.

Functional Concerns

🤔 Negative Score Logic

// Before:
player1FloatingScore = max(0, player1FloatingScore + value)

// After:
player1FloatingScore += value
  • Location: ContentView.swift:53, 55, 61, 65
  • Current behavior: Allows scores to go negative
  • Game rules concern: In traditional cribbage, scores typically don't go below zero. Is this intentional?
  • Edge cases to consider:
    • What happens if a player's main score goes negative? The UI shows negative numbers, but does this break game logic?
    • Winner detection (checkForWinner at line 71) only checks >= winningScore, so negative scores won't incorrectly trigger wins
    • UserDefaults will persist negative integers correctly
  • Recommendation: If this is for score corrections/undo functionality, consider:
    1. Adding a lower bound (e.g., max(-10, score + value)) to prevent extreme negatives
    2. Adding UI feedback when scores go negative
    3. Documenting this behavior in code comments

Minor Issues

Version Bump

-CURRENT_PROJECT_VERSION = 1;
+CURRENT_PROJECT_VERSION = 2;
  • Location: Cribbage Scorer.xcodeproj/project.pbxproj:250, 296
  • Good practice to bump version, but ensure MARKETING_VERSION is also updated if needed for App Store releases

Empty Status Bar Style

+INFOPLIST_KEY_UIStatusBarStyle = "";
  • Location: Cribbage Scorer.xcodeproj/project.pbxproj:264, 310
  • Setting an empty value when platform-specific values already exist seems redundant

🧪 Testing Recommendations

Since no tests are included, manually verify:

  1. Negative score flow: Tap "-1" multiple times and verify both floating and main scores go negative
  2. Persistence: Force close app with negative scores and verify they persist on relaunch
  3. Winner detection: Ensure negative scores don't interfere with win condition
  4. UI display: Confirm negative numbers display correctly (especially with "-" sign in rotated top player view)
  5. Score correction: Test scenario: Player at 50 points, add 5, then subtract 7 (should result in 48)

🔒 Security Assessment

No security vulnerabilities identified in the code changes themselves. The app:

  • Uses UserDefaults appropriately (local storage, no sensitive data)
  • No network calls or external data handling
  • No SQL injection, XSS, or input validation issues (integer-only operations)

The bundle identifier change could be considered a security concern if it's unintentional, as it affects app identity and data isolation.


📊 Performance Considerations

No performance issues. Changes are minimal:

  • Simple arithmetic operations (no performance impact)
  • UserDefaults writes are already throttled by didSet observers
  • Asset additions increase app size by ~100-200KB (negligible)

🎯 Recommendations Summary

Must Fix (Before Merge)

  1. Revert bundle identifier change unless this is an intentional migration
  2. Remove development team changes or add to .gitignore
  3. Verify visionOS deployment target (26.2 → 2.6)

Should Consider

  1. Add bounds checking for negative scores (e.g., max(-20, score + value))
  2. Add code comments explaining why negative scores are allowed
  3. Consider adding a "Clear Floating Score" button to complement the "-1" button

Nice to Have

  1. Add unit tests for score calculations, especially negative scenarios
  2. Update MARKETING_VERSION if releasing to App Store
  3. Consider adding haptic feedback when scores go negative

📝 Final Verdict

⚠️ Changes Requested - The negative scoring feature works correctly, but project configuration changes need attention before merging.

Code Quality: ⭐⭐⭐⭐ (4/5) - Clean implementation, slight concerns about unbounded negatives
Security: ⭐⭐⭐⭐⭐ (5/5) - No security issues in code logic
Config Changes: ⚠️⚠️ (2/5) - Bundle ID and team changes are concerning


Great work on adding the negative scoring feature! The code changes are clean and straightforward. Please address the configuration concerns and consider the negative score bounds for a production-ready implementation.

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