Fix work item features path bugs on boards and linked items

What does this MR do and why?

Fixes three frontend bugs on the features path that surfaced when work_item_features_field was defaulted to on. This lets !253548 (merged) only flip the flag.

  • Board cards don't update after editing in the drawer: mapWorkItemWidgetsToIssuableFields only looked values up in widgets, but the drawer's work item carries them under features. We now read workItem.features[camelCase(widgetType)] first and fall back to widgets.
  • The blocked-by popover on board cards shows no title: work_items_linked_items_slim.query.graphql selects titleHtml in the widgets branch but not in the features branch. We add titleHtml to the features branch.
  • Removing a linked item from an epic leaves it in the list: the WorkItem.widgets merge policy returned the existing LINKED_ITEMS widget whenever the incoming one had no linkedItems, which dropped incoming blockedByCount and blockingCount. The workItemLinkedItems query then became incomplete, so readQuery returned null and the cache update was skipped. We now shallow merge { ...existingWidget, ...incomingWidget }, which keeps linkedItems and picks up the counts.

Jest coverage is added in spec/frontend/work_items/list/utils_spec.js and spec/frontend/graphql_shared/issuable_client_spec.js.

References

Screenshots or screen recordings

Both recordings show, in order: editing weight and a label from the board drawer, hovering the blocked-by icon on a board card, and linking then removing an epic's linked item.

Before After

How to set up and validate locally

  1. In a Rails console, enable the feature flag:
    Feature.enable(:work_item_features_field)
  2. On a project issue board, open a card and change the weight and labels in the drawer. Confirm the card updates without a reload.
  3. Create a "blocks" link between two issues on the board, then hover the blocked-by icon on the blocked card. Confirm the blocker's title shows.
  4. On a group epic, link another epic via search by title, then remove it. Confirm it disappears from Linked items.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

🤖 Generated with Claude Code

Merge request reports

Loading
Loading