Skip to content

Fix Kotlin warnings and make rating summary locale-safe#49

Closed
AppsTRDesign wants to merge 1 commit intomainfrom
codex/create-multilingual-gui-bot-for-google-maps
Closed

Fix Kotlin warnings and make rating summary locale-safe#49
AppsTRDesign wants to merge 1 commit intomainfrom
codex/create-multilingual-gui-bot-for-google-maps

Conversation

@AppsTRDesign
Copy link
Copy Markdown
Owner

Motivation

  • Eliminate Kotlin compiler warnings where the Elvis operator was used against non-nullable Int fields causing redundant expressions.
  • Prevent NumberFormatException when displaying rounded ratings in locales that use comma as decimal separator.
  • Improve robustness of UI navigation to pass total values consistently to downstream screens.

Description

  • Removed redundant Elvis fallbacks for category total in CategoryScreen.kt and HomeScreen.kt, passing the total directly via navigation parameters using category.total instead of category.total ?: 0 to silence warnings and keep semantics.
  • Reworked rating aggregation in PlaceDetailScreen.kt by computing a rounded Double (avgRounded = kotlin.math.round(avg * 10.0) / 10.0) and returning it directly instead of formatting to a string and parsing back, avoiding locale-dependent parsing errors.
  • Updated UI usage to use the revised average value (rounded Double) from buildRatingSummary so the Compose UI no longer attempts to parse locale-formatted numbers.

Testing

  • No automated unit or integration tests were executed for these changes.
  • Project compiled locally during development and Kotlin compiler warnings about the redundant Elvis operators were removed (manual verification).

Codex Task

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AppsTRDesign AppsTRDesign deleted the codex/create-multilingual-gui-bot-for-google-maps branch January 11, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant