Fix: depicts pill popover fetches real Wikidata + adds working link

Summary

  • The depicts (P180) info popover used the local KNOWN_DEPICTS mock pool for label/description and had a <button> with no onClick / href for "Open on Wikidata" — placeholder UI for any Q-id the local vocabulary didn't already know.
  • Adds fetchWikidataEntity(qid) in src/api/commons.js (unauthenticated wbgetentities, CORS-enabled, 5-min apiCache) and bridges it as window.fetchWikidataEntity via the existing autocomplete installer.
  • New DepictsPopover component fetches the canonical label + description on mount (keyed by QID, cancels on unmount), falls back to KNOWN_DEPICTS for zero-latency on cached items, shows a brief loading line otherwise, and renders the footer as <a target="_blank" rel="noopener noreferrer" href="https://www.wikidata.org/wiki/<QID>">.

Phabricator

  • T425827 — Depicts pill popover shows placeholder data; needs real Wikidata fetch + 'Open on Wikidata' link

Test plan

  • Open a row with depicts; click a Q-id pill from the local pool — label/description show instantly, identical to before.
  • Click a depicts pill whose QID is not in KNOWN_DEPICTS (e.g. an obscure Q-id from a published row's SDC) — the popover briefly shows "Loading from Wikidata…" then the live label + description appear.
  • Click "Open on Wikidata" — opens https://www.wikidata.org/wiki/<QID> in a new tab.
  • Open the same pill again — the second open is cached (no network call within 5 min, verified via DevTools Network).
  • Try a malformed Q-id (e.g. an item with qid: "Q999999999999") — popover stays open with the QID heading and the local fallback (or a blank desc), no crash.

🤖 Generated with Claude Code

Merge request reports

Loading