Skip to content

Conversation

@Inuth0603
Copy link
Contributor

Description

Fixes the intermittent issue where tapping a Nearby item's picture thumbnail in the Explore map sometimes does not open the media details.

Root Cause

The passInfoToSheet method in ExploreMapFragment.kt compared media.filename with place.name using strict equality (==). This caused failures because:

  1. place.name often includes the "File:" prefix (e.g., "File:Example.jpg")
  2. media.filename may or may not have this prefix depending on the data source
  3. Filename matching was case-sensitive, but Wikimedia Commons filenames can have varying capitalization

Changes

  • Normalize both place.name and media.filename by removing the "File:" prefix before comparison
  • Use case-insensitive comparison with equals(..., ignoreCase = true)
  • Properly handle cases where no match is found by disabling the media details button

Testing

  1. Go to Explore map
  2. Navigate to any location with nearby items (e.g., the item mentioned in the issue: https://m.wikidata.org/wiki/Q113355934)
  3. Tap on a marker to show the bottom sheet
  4. Tap the picture thumbnail
  5. Verify that media details now open consistently

Closes #6317

- Normalize place.name and media.filename by removing 'File:' prefix before comparison
- Use case-insensitive comparison for filename matching
- Properly disable button when no match is found
@Kota-Jagadeesh
Copy link
Collaborator

@Inuth0603 Would you mind sharing a short video clip demonstrating the issue after the fix?

@Inuth0603
Copy link
Contributor Author

@Inuth0603 Would you mind sharing a short video clip demonstrating the issue after the fix?

@Kota-Jagadeesh I've investigated further by testing the official Play Store version on my device, and I'm seeing the same inconsistent behavior there (images mostly fail to load with "No pictures in this area").

This suggests the issue is likely network latency or throttling in my region affecting the Wikimedia API connection, rather than a build issue. Because of this instability, I can't reliably record the "Before vs. After" comparison right now.

Regarding the fix: Since I verified the logic locally (stripping the "File:" prefix and ensuring case-insensitivity), this change is a safe defensive improvement that handles the root cause described in the issue. I'll keep trying to record a demo if my connection stabilizes.

@github-actions
Copy link

✅ Generated APK variants!

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.

Opening media details of a Nearby item's existing picture, sometimes does not work for a particular item

3 participants