LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-julia
createdAtNov 20, 2026, 6:40 PM
updatedAtNov 20, 2026, 10:31 PM
githubUrlhttps://github.com/neomjs/neo/issues/21606
authorneo-gemini-julia
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 20, 2026, 10:31 PM

Examples cards keep at most one detail panel expanded

Closed v14.0.0/archive-v14-0-0-chunk-5 bugdesignaiportal
neo-gemini-julia
neo-gemini-julia commented on Nov 20, 2026, 6:40 PM

Context

Operator-reported live defect on the /examples overview (Start here) and group pages: two example cards (Community Garden Plan and Sprint Board) easily remain expanded simultaneously, and once a card such as Sprint Board is clicked, its .portal-example-more detail section stays permanently expanded even when walking across cards with Arrow keys or hovering other cards with the mouse.

The Problem

Three interacting rules in Portal.view.examples.List (apps/portal/view/examples/List.mjs) and resources/css/src/apps/portal/examples/List.css allow multiple cards to expand at once and latch clicked cards open indefinitely on desktop:

  1. Desktop .neo-selected latches a clicked card open permanently (List.css:158-163, ListModel.mjs:67-82):
    • Portal.view.examples.List inherits disableSelection: false and selectOnFocus: false from Neo.list.Base.
    • Clicking anywhere on a card—including clicking its title or Open live ↗ link (target="_blank")—triggers ListModel#onListClick and adds .neo-selected to <li class="neo-list-item">.
    • Because .neo-list-item.neo-selected { .portal-example-more { grid-template-rows: 1fr; } } in List.css:159 is unscoped instead of restricted to touch/phone viewports (@media (max-width: 600px), (hover: none)), and because Arrow-key navigation (selectOnFocus: false) moves DOM focus without moving .neo-selected while singleSelect: true never deselects on re-click or mouse leave, that card stays expanded forever on desktop.
  2. Mouse-click :focus-within keeps a clicked card open after the pointer leaves (List.css:158):
    • :focus-within matches mouse-click focus on <li tabindex="-1"> and <a class="neo-title">, keeping a clicked card expanded even after the pointer leaves the list, whereas :focus-visible / :has(:focus-visible) activates only on keyboard modality (Tab, Arrow keys).
  3. Simultaneous :hover and keyboard focus (:focus-visible) expand two cards at once (List.css:158-174):
    • Hovering Card B while Card A holds keyboard focus expands both cards unless hover and keyboard focus yield to whichever input modality acted last (pointer mouseenter vs keyboard Tab / Arrow navigation).
    • On touch/phone viewports (max-width: 600px / hover: none), tapping an <a> launch link should also avoid latching .neo-selected, and tapping an already-open card body should toggle .neo-selected closed so a single card is never irrevokably open there either.

The Architectural Reality

  • apps/portal/view/examples/List.mjs (Portal.view.examples.List, extending Neo.list.Base) and resources/css/src/apps/portal/examples/List.css own card rendering and .portal-example-more disclosure across Overview, GroupPage, and SearchResults.
  • Design authority: "The cover fills the card, title and proof line stand on a scrim at its foot; the action appears on hover and focus, and under the image on touch widths" (#21119 operator-selected Full bleed contract; echoed in apps/portal/view/examples/List.mjs:202-205).

The Fix

  1. resources/css/src/apps/portal/examples/List.css (plus plain-CSS theme build sync):
    • Remove unscoped desktop .neo-list-item.neo-selected and mouse :focus-within expansion from the base card rule.
    • Under @media (min-width: 601px) and (hover: hover):
      • Expand .portal-example-more on .neo-list-item:hover when the list is not in .portal-examples-keyboard mode.
      • Expand .portal-example-more on .neo-list-item:is(:focus-visible, :has(:focus-visible)) when .portal-examples-keyboard is active or no card in the list is :hover (&:not(:has(.neo-list-item:hover))), guaranteeing at most 1 expanded card on desktop across click, hover, Tab, and Arrow keys.
    • Under @media (max-width: 600px), (hover: none):
      • Keep .neo-list-item.neo-selected and .neo-list-item:focus-within expanding .portal-example-more (with max-width: 600px opening under the 16:9 cover as today).
  2. apps/portal/view/examples/List.mjs:
    • Add keydown (ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Tab) and delegated .neo-list-item mouseenter handling on Portal.view.examples.List to toggle 'portal-examples-keyboard' on cls so Arrow-key navigation cleanly overrides a stationary pointer hover and moving the pointer onto a card hands control back to :hover (clearing any stale selection).
    • Guard card selection so clicks on <a> links (neo-title, portal-example-open-cue, neo-github-image) do not latch .neo-selected, and tapping an already-selected card body toggles it closed.
  3. Whitebox E2E Verification (test/playwright/e2e/portal/ExamplesCatalogNL.spec.mjs):
    • Add real-browser assertions verifying: (a) clicking Card A (Sprint Board) then hovering Card B (Community Garden Plan) leaves only Card B expanded (1 open), and moving the mouse to (0, 0) leaves 0 open; (b) keyboard-focusing Card A then hovering Card B leaves only Card B (1 open); (c) keeping the mouse stationary over Card B and pressing ArrowRight/Tab to Card C leaves only Card C (1 open); and (d) hovering a [Multi-window] badge then moving the pointer to (5, 5) dismisses .neo-tooltip.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
.portal-example-more disclosure (apps/portal/view/examples/List.mjs, resources/css/src/apps/portal/examples/List.css) #21119 (Full bleed) · List.mjs:202-205 At most one card in a list expands .portal-example-more at a time: active hover or keyboard :focus-visible on (min-width: 601px) and (hover: hover), and toggleable tap selection / focus on (max-width: 600px), (hover: none) Tile mode (tiles: true) renders no .portal-example-more JSDoc in List.mjs ExamplesCatalogNL.spec.mjs

Decision Record impact: none.

Acceptance Criteria

  • AC-1 (No Stuck Card After Desktop Click): Clicking an example card or its launch/source links on desktop (1440×900) does not latch .portal-example-more open once the pointer leaves the card or moves to another card (0 open at (0, 0), 1 open when hovering a sibling card).
  • AC-2 (Single-Card Mutual Exclusion Across Hover & Keyboard Focus): Hovering Card B while Card A holds keyboard focus expands only Card B (1 open), and pressing Arrow / Tab keys while the pointer rests over Card B expands only the keyboard-focused card (1 open).
  • AC-3 (Touch / Narrow Phone Toggle & Link Cleanliness): On 390×844 / touch, tapping a card body opens its details under the cover (1 open), tapping a second card switches to that card (1 open), tapping the open card again closes it (0 open), and tapping Open live ↗ or the title link launches without leaving a stale .neo-selected card.
  • AC-4 (Theme Build & Whitebox E2E): npm run build-themes -- -n -e dev -t all and test/playwright/e2e/portal/ExamplesCatalogNL.spec.mjs pass with explicit multi-modality regression coverage.

Out of Scope

  • Desktop resting caption line-clamp and opaque scrim token changes (#21584 / PR #21585 — disjoint lines in List.css).
  • Phone first-screen header/intro height (#21598, #21591).

Avoided Traps

  • Using :focus-within unconditionally on desktop: Matches mouse clicks on <li tabindex="-1"> and <a>, leaving clicked cards open after pointer departure even without .neo-selected.
  • Pure CSS :not(:has(.neo-list-item:hover)) without keyboard-modality handoff: Leaves a card under a stationary cursor stuck open while the user navigates elsewhere with Arrow keys.

Related

Related: #21140 (filed beside #21140, which already holds 40 sub-issues), #21119, #21584.

Not good first issue / help wanted: urgent operator-reported Engine 14 Portal UX defect ahead of the 2026-11-23 cut, claimed immediately by @neo-gemini-julia.

Live latest-open + closed sweep: checked latest 20 open (62 open, red band) + open and closed search (examples card hover focus selected; Out of Scope / Avoided Traps and Full bleed contract read on #21119, diff of #21585 checked for zero hunk overlap) at 2026-11-20T17:38Z; no equivalent ticket or prior exclusion found. A2A in-flight claim sweep: latest 30 messages across all read-states (16:46Z–17:34Z); zero competing [lane-claim] or [lane-intent] on example card detail expansion (#21584/#21585 covers resting caption line-clamp & scrim opacity; #21598 covers phone header/intro height). MC sweep: "examples overview card detail expanded hover focus keyboard stuck", 6 results (ce471f9d), no prior mapping found. Own-assignment sweep: 3 open (#21573, #20987, #20671), none overlapping.

Origin Session ID: fdac7b58-4686-4e42-9233-7d3e0be881f4 Retrieval Hint: "examples overview 2 card detail infos expanded Sprint Board stuck neo-selected hover focus-visible"