Skip to content

[QA] §8 — ~4 of 15 species cards silently fail to open their summary panel #188

Description

@bleonar5

[QA] §8 — ~4 of 15 species cards silently fail to open their summary panel

Section: §8 Species (/species)
Severity: medium (silent dead-click; ~27% of rows; no error, no feedback)
Environment: confirmed manually on local/preview; verify on staging
Found via: §8 manual pass + Playwright §8 clicking a species opens the summary panel

Summary

Clicking a species name on /species is supposed to open the EntitySummaryModal
(SpeciesSummary). For about 4 of the 15 species, clicking does nothing — no
panel, no error, no console message. The affected species have no obvious pattern from
the UI, which is itself a symptom of the root cause.

Repro

  1. Go to /species (signed out is fine).
  2. Click each species name in turn.
  3. Most open the right-hand summary panel; ~4 do nothing at all.

Expected: every species opens its summary panel.
Actual: ~4/15 are silent no-ops.

Root cause

The species grid is YAML-backed (useMarrYaml) and its rows carry no DB id, so
SpeciesBadge has to resolve the display name back to a species row at click time:

const { data: sp } = await supabase
  .from("species")
  .select("id, resource_id")
  .or(`common_name.ilike.${value},name.ilike.${value}`)  // exact match, no % wildcards
  .maybeSingle();                                          // null on 0 OR >1 matches
if (sp) { open(...) }                                      // else: nothing happens, silently

value is the YAML display name (capitalized common name, else the Latin name).
.maybeSingle() yields no row when the query returns 0 matches (the YAML name
doesn't exactly match any species.common_name or species.name) or >1 matches
(the name is ambiguous / duplicated). In both cases sp is falsy, open() is never
called, and there's no user-facing feedback — hence the "random" dead-clicks.

(Secondary: a display name containing a comma or parentheses would also break the
.or(...) filter string, producing the same silent failure.)

Suggested fix (any one, roughly in order of preference)

  1. Carry a stable id through the data — enrich the YAML→grid rows with the
    species table id (or resource_id) so the click opens directly by id, no lookup.
    This is what the Resources and Investigators grids do, and they don't have this bug.
  2. Make the lookup tolerant%value% ilike + .order(...).limit(1) instead of
    exact .ilike + .maybeSingle(), plus reconcile the species table's
    common_name/name values against the YAML names so they actually match.
  3. At minimum, fail loudly — if no row resolves, show a toast ("Couldn't open
    details for {name}") instead of a silent no-op, so it's never an invisible dead-click.

Acceptance criteria

  • Every species on /species opens its summary panel.
  • No species click is a silent no-op (either it opens, or it gives feedback).
  • The §8 every species opens its summary panel regression test (currently
    test.fail() + // bug #<this>) goes green; remove the test.fail().

Notes

  • Tracked in the suite two ways: §8 clicking a species opens the summary panel
    (green — proves the modal mechanism works for resolvable names) and
    §8 every species opens its summary panel (test.fail() — tracks this bug; its
    failure message lists exactly which species didn't open).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions