Page MenuHomePhabricator

Category pill popover shows placeholder data; needs real Commons fetch + 'Open on Commons' link
Closed, ResolvedPublic

Description

Bug

Click a category pill in a table cell → a preview popover appears with the category name, a generic description, an "Existing / Will be created" status, and an "Open on Commons" footer button.

Two problems:

  1. All preview content is placeholder. The description sentence is hardcoded; no Commons API fetch. The "existing" status comes from the local KNOWN_CATEGORIES pool plus the live-bridged results, but no real category-page data (description, file count, parent cats) is rendered.
  2. "Open on Commons" button has no onClick — dead button.

Where

src/table.jsx:2649-2671PillInfoPopover category branch. Dead button at line 2667.

Expected

Build the popover for real:

  • Fetch live category info from Commons (file count, lead description, parent cats); cache 5 min.
  • Wire "Open on Commons" to open https://commons.wikimedia.org/wiki/Category:<name> in a new tab.

Reported by

Daanvr, 2026-05-08, during dead-UI review.

Event Timeline

Daanvr triaged this task as Medium priority.
Daanvr moved this task from To do to Doing on the Tool-upload-workbench board.

@Daanvr — implementation done & pushed (MR: https://gitlab.wikimedia.org/daanvr/upload-workbench/-/merge_requests/10), but the MR preview URL is broken for all MRs, not just this one (sibling T425827 hit the same wall and is also in Needs input).

What works

What's broken

  • Toolforge's lighttpd 301-redirects /mr-10/index.html/mr-10/index/mr-10/mr-10/, then serves the root /index.html as a SPA fallback. So a user visiting https://upload-workbench.toolforge.org/mr-10/ sees the production build (assets resolving against /), not my MR's build. CLAUDE.md → Task workflow → step 5 explicitly says 'Do not push the task to Reviewing if its preview doesn't load' / 'assets resolve against /'.
  • All three open MR previews (/mr-9/, /mr-10/, and the not-yet-pushed !? for T425828) share the same etag: e505... as / — proof the preview is the root build.

Why this is happening

  • Toolforge's static-server config strips .html and falls back to root /index.html for any path that doesn't directly resolve to a file. The directory-as-URL convention (/mr-10/) doesn't auto-serve /mr-10/index.html because the .html-stripping rule kicks in first. /v0.4.0/ shows a directory listing instead — also evidence of the same routing.
  • Feature is only ~1 day old (commit 10031b9 on 2026-05-08). Likely never end-to-end tested with a real MR before now.

Options I see

  1. Server-side: add a lighttpd rewrite rule that maps /mr-<n>//mr-<n>/index.html *before* the SPA fallback. Needs Toolforge service config (out of scope for me).
  2. Client-side workaround: change deploy:mr to rsync the build to /mr-<iid>.html (not a directory) so the URL is a file the lighttpd resolves directly. Slightly awkward but no infra change needed.
  3. Inline asset: build with base: './' for MR previews so assets are referenced relatively. But the URL itself still serves root index.html, so this doesn't help.
  4. Document the limitation and have reviewers test on the maintainer's local checkout for now.

I'm holding T425829 here pending your call. The MR diff itself is small and self-contained — code review by reading is fine if you want to skip the live preview for now.

Preview infra fix !12 is merged & deployed; webservice restarted. Verified /mr-10/ now serves this MR's own build (etag 0771349b, asset /mr-10/assets/index-BcDhcQjV.js matches the deploy:mr build). Moving to Reviewing.

MR: https://gitlab.wikimedia.org/daanvr/upload-workbench/-/merge_requests/10
Preview: https://upload-workbench.toolforge.org/mr-10/