Skip to content

Conversation

@XinyuYangYXY
Copy link
Contributor

@XinyuYangYXY XinyuYangYXY commented Oct 17, 2025

Description (required)

Fixes #6395

What changes did you make and why?

Problem
The Item (Wikidata) details screen showed category-oriented labels (“Subcategories / Parent categories”) where class hierarchy labels are expected (“Child classes / Parent classes”). A prior attempt mistakenly changed global strings, which caused category flows (e.g., searching "rabbit" → open a category) to display the wrong labels.

Approach

  • Scope labels to the correct context
    • In WikidataItemDetailsActivity, set tabs to use class-specific resources:
      title_for_child_classes → child tab,
      title_for_parent_classes → parent tab.
  • Keep categories unchanged
    • Do not rename or repoint category strings; category screens continue to use title_for_subcategories / title_for_parent_categories.
  • Clean up strings
    • Remove duplicate keys introduced earlier and ensure unique resource names for classes vs categories.
  • Repository hygiene
    • Rebased on latest upstream main.
    • Deleted incorrect string edits from the previous attempt to avoid regressions.

Tests performed (required)

  • Build variant: 6.0.2-debug-main~4ed9ad508
  • Device: Android 15 (API 35) Emulator (Medium Phone)

Manual checks

  1. Category context: expolre → search sth. (e.g.,"rabbit") → tab CATEGORIES→ choose one→ read ““Subcategories / Parent categories””.
  2. Item context: expolre → search sth. (e.g.,"rabbit") → tab ITEMS→choose one → read “Child classes / Parent classes”.

Before:

  1. category
image
  1. item
image

After:

  1. category:
85d3bb5fad6698042bb2954f36cd0202
  1. item:
cd9204bebe1dba9efdb03f2bfadbb7f7

…contents of strings.xml. After reviewing it, I found that the issue was actually in WikidataItemDetailsActivity.kt, where the wrong label was selected. After correcting this, there should no longer be any problems.
@github-actions
Copy link

✅ Generated APK variants!

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@nicolas-raoul nicolas-raoul merged commit b5b5d8a into commons-app:main Oct 18, 2025
1 check passed
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.

Item activity says "subcategories" instead of "child classes"

3 participants