Skip to content

Latest commit

 

History

History
127 lines (93 loc) · 5.51 KB

issues.md

File metadata and controls

127 lines (93 loc) · 5.51 KB

Issues & Edge Cases Audit

🔴 HIGH — Crashes or Major Bugs

  • BUG-1: Format String Crash — MissingFormatArgumentException if userName contains %s, %d, etc.

    • Files: MainActivity.kt:92, HomeScreen.kt:70, GameScreen.kt:81
    • Fix: Sanitize userName (replace % with %%) before passing to stringResource(..., userName) in all three files.
  • BUG-2: CelebrationScreen fires onNext() twice

    • File: CelebrationScreen.kt:87-97
    • Fix: Added hasNavigated mutable state and guardedOnNext lambda so onNext() can only execute once.

🟠 MEDIUM — Incorrect Behavior or Visual Issues

  • BUG-3: Language Dropdown Toggle Race

    • File: SettingsScreen.kt:351-369
    • Fix: Removed IconButton onClick so only the overlay handler toggles expanded.
  • BUG-4: "Colors" Category Hidden Behind lettersEnabled

    • File: HomeScreen.kt:145-153
    • Fix: Removed the if (lettersEnabled) guard so Colors is always visible.
  • BUG-5: dragRadius Is Raw Pixels

    • File: GameScreen.kt:105
    • Fix: Changed to with(LocalDensity.current) { 56.dp.toPx() }.
  • BUG-6: Unsafe Activity Cast in Theme

    • File: ui/theme/Theme.kt:28
    • Fix: Used safe cast as? Activity with null-safe fallback.
  • BUG-7: nextRound() Uses Stale State

    • File: game/GameViewModel.kt:84-121
    • Fix: Restructured to compute and assign inside _state.update { } atomically.

🟡 LOW — Edge Cases, Unused Code, Fragile Patterns

  • EDGE-1: GameScreen Default viewModel() Parameter Is Dangerous

    • File: ui/game/GameScreen.kt:70
    • Fix: Removed default value and unused import.
  • EDGE-2: LevelManager Can Crash on Missing Color Translation

    • File: game/LevelManager.kt:80
    • Fix: Wrapped in try/catch with fallback to existing display.
  • EDGE-3: shuffledDrawerItems Reshuffles on Unrelated State Updates

    • File: ui/game/GameScreen.kt:90-92
    • Fix: Changed remember key to state.category and state.itemCount.
  • EDGE-4: Tutorial Pointer Input while(true)

    • File: ui/game/GameScreen.kt:296-303
    • Fix: Changed loop condition to while(showTutorial).
  • EDGE-5: Dead Navigation Route (Screen.Celebration)

    • File: navigation/AppNavHost.kt:57-66
    • Fix: Removed unreachable route, composable, import, and sealed object.
  • EDGE-6: Unused Function nextItemCount()

    • File: game/LevelManager.kt:88-90
    • Fix: Deleted unused function.
  • EDGE-7: Unused Function getLocaleDisplayName()

    • File: ui/settings/SettingsScreen.kt:421-431
    • Fix: Deleted unused function.
  • EDGE-8: Unused String Resource game_back

    • File: res/values/strings.xml:12, res/values-en/strings.xml:12
    • Fix: Removed unused string resource.
  • EDGE-9: No Input Validation on userName

    • File: ui/settings/SettingsScreen.kt:127-139 / GameViewModel.kt
    • Fix: Added trim + 20-character cap in setUserName.
  • EDGE-10: Accessibility: Hardcoded English Content Description

    • File: MainActivity.kt:128
    • Fix: Replaced with stringResource(R.string.splash_content_desc) and added to XMLs.
  • EDGE-11: Accessibility: Emojis Without Content Descriptions

    • Files: HomeScreen.kt, GameScreen.kt, SettingsScreen.kt
    • Fix: Added Modifier.semantics { contentDescription = ... } to settings gear, home buttons, and category cards.
  • EDGE-12: YourTurnIndicator Logic Is Narrow

    • File: ui/game/GameScreen.kt:118, 232
    • Fix: Removed itemCount == 3 guard so it shows after any tutorial.
  • EDGE-13: unplaceItem Is Defined but Unreachable

    • File: game/GameViewModel.kt:73-82
    • Fix: Removed dead code.
  • EDGE-14: Inconsistent Celebration Navigation

    • File: navigation/AppNavHost.kt:57-66
    • Fix: Resolved by removing the dead route (EDGE-5); only the inline overlay remains.
  • EDGE-15: ProGuard Rule Is Overly Broad

    • File: app/proguard-rules.pro
    • Fix: Removed -keep class androidx.compose.** { *; }; kept runtime only.

🟢 INFO — Architecture / UX Notes

  • INFO-1: Sound removed from first release

    • Decision: No sounds for first release. Sound files (pop.ogg, chime.ogg) deleted from res/raw/. Removed from AGENTS.md, README.md, TRANSLATIONS.md.
  • INFO-2: Full Test Suite

    • Unit tests: GameStateTest, ItemSetsTest, LevelManagerTest, GameViewModelTest (with Robolectric + Turbine)
    • Instrumented tests: HomeScreenTest, GameScreenTest, SettingsScreenTest, MainActivityTest
    • Updated AGENTS.md with testing conventions
    • Updated build.gradle.kts with test dependencies
  • INFO-3: Splash Delay Is Skippable

    • Added clickable to splash screen + onSkip callback. Hint text "Toca para continuar" appears after 1s. String added to all locales.
  • INFO-4: Haptic Feedback on Correct Drop

    • Added gentle haptic vibration on correct placement
    • Settings toggle: "Vibrar al acertar" (default OFF)
    • Includes plain-language explanation text
    • Uses CONFIRM haptic on API 34+, VIRTUAL_KEY fallback on older devices
    • Does not trigger on tutorial auto-placement
  • INFO-5: showColorAid Logic Is Duplicated

    • Centralized in LevelManager.shouldShowColorAid(category, complexity).
    • GameState exposes it as computed property showColorAid.
    • GameScreen reads directly from state, no local duplication.