Page MenuHomePhabricator

Entry items feature `cdx-card--is-link` twice
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

The condition isn't resulting in the correct output:

<cdx-card
		:url="entry.url"
		:thumbnail="{ url: entry.thumbnail }"
		:custom-placeholder-icon="!entry.url || entry.missing ? cdxIconAlert : undefined"
		:class="{ 'cdx-card--is-link': entry.url || editing }"

It duplicates to <a href="https://en.wikipedia.beta.wmcloud.org/wiki/Main_Page" class="cdx-card cdx-card--is-link cdx-card--is-link">

Requirement

Scope: ReadingLists (desktop + mobile).

  • Remove the duplicate cdx-card--is-link class from the rendered <cdx-card> elements in Reading List entry items.
  • Cards for saved pages on the Saved Pages (Special:ReadingLists) page must render with a single instance of the cdx-card--is-link class.
  • The removal must not affect card styling, interactivity, or link behavior.
  • The fix applies to all Reading List cards where entry.url or editing determines the link state.

BDD

Feature: Prevent duplicate `cdx-card--is-link` class in Reading List cards

  Scenario: Rendering saved page cards
    Given I open the Saved Pages (Special:ReadingLists) page
    When the Reading List entries are rendered
    Then each `<cdx-card>` element has only one instance of the `cdx-card--is-link` class
    And all card styles and link behavior remain unchanged

Test Steps

Test Case 1: Verify duplicate class removal

  1. Open Special:ReadingLists and view saved entries.
  2. Inspect a Reading List card element in the DOM.
  3. AC1: The <cdx-card> element contains only one instance of the cdx-card--is-link class.
  4. AC2: The card styling and clickable behavior remain functional.

QA Results - Prod

ACStatusDetails
1T405540#11326020
2T405540#11326020

Acceptance criteria for done

  • Remove duplicated class in output

Event Timeline

Volker_E set the point value for this task to 1.Sep 25 2025, 4:50 PM

Change #1198592 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/extensions/ReadingLists@master] app: Remove duplicated `.cdx-card--is-link` class from output

https://gerrit.wikimedia.org/r/1198592

Change #1198592 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] app: Remove duplicated `.cdx-card--is-link` class from output

https://gerrit.wikimedia.org/r/1198592

Test Result - Prod

Status: ✅ PASS
Environment: testwiki
OS: macOS Tahoe 26.x
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Verify duplicate class removal

  1. Open Special:ReadingLists and view saved entries.
  2. Inspect a Reading List card element in the DOM.
  3. AC1: The <cdx-card> element contains only one instance of the cdx-card--is-link class.
  4. AC2: The card styling and clickable behavior remain functional.

screenshot 336.png (1×2 px, 359 KB)

HFan-WMF claimed this task.