Skip to content

fix(web): ref switcher filter/keyboard/version sort, issue search and DPNS fixes (FG-7 L-13/14/53/42/43/72) - #162

Merged
PastaPastaPasta merged 12 commits into
masterfrom
fix/fg7-ref-switcher-lists
Sep 29, 2026
Merged

PastaPastaPasta merged 12 commits into
masterfrom
fix/fg7-ref-switcher-lists

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

FG-7 PR1: fixes the ref switcher, branches/tags pages, issue search, and DPNS author resolution against /Users/pasta/workspace/dash-forge-qa/evidence/dash-ux/LEDGER.md findings L-13, L-14, L-53, L-42, L-43, L-72.

  • L-13 / L-14 / L-53 — the ref switcher gets a live filter, keyboard navigation (arrow keys with wrap, Escape refocuses the trigger), and version-aware tag sort (newest first, not lexical). The branches/tags page's "name" sort mode used a bare naturalRuns comparator, which is not a total order ("foo-bar"/"foo_bar"/"Foo.bar" all compare equal), so its default sort could be non-deterministic and disagree with the switcher's own order. Both now share a single compareRefNames helper (new lib/repo/ref-order.ts) so the two pages sort identically.
  • L-42 — a plain search-box submit (typed text + Enter) used the whole current query as its base, so deleting a qualifier like label:bug from the box before hitting Enter didn't actually clear that filter. searchSubmitBase now keeps only the state tab, since the submitted text is the single source of truth for every other filter.
  • L-43 — author:/assignee: now resolve a DPNS name (not just a base58 identity id or @me) to an identity before filtering.
  • L-72 — DPNS name lookups now require the contract's actual 3-63 character label minimum (verified against dpns-contract's schema v1 and v2, both of which set label.minLength to 3) instead of accepting a 1-2 character value that could never resolve.

Also fixes a stale-focus edge case in the issue filters' PersonFilter: when value changes from outside the component (reload, "Clear filters", a resolved author:<id> qualifier), a leftover "the select's own onChange just fired" flag is now cleared so it can't steal focus for an unrelated later transition.

Live verification

forge-web/e2e/ref-switcher-search.spec.ts is a new read-only Playwright spec exercising all of the above against real devnet data (the dash-core mirror for ref-switcher/tags, forge-v2-demo/showcase fixtures for issue search and DPNS author resolution). It passed 6/6 against the moutai devnet.

Note on CI: shortly after that run, moutai was upgraded in place to platform v4.2.0-beta.7 on all nodes. The beta.6-registered forge contracts this branch (and master) read against can no longer be read by beta.5-era JS, so the live e2e job will show red in CI for every PR until the bonsia devnet cut-over — this is unrelated to this change. Unit tests, typecheck, and lint are all green.

Test plan

  • npx tsc --noEmit — clean
  • npx eslint on all changed files — clean
  • npx vitest run — 2847 passed, 18 skipped (full suite)
  • npx playwright test e2e/ref-switcher-search.spec.ts against moutai — 6/6 passed (before the beta.7 upgrade; expected red in CI until bonsia cut-over, see note above)

Explicitly out of scope: L-44, L-77 (PR list search/paging/request count), reserved for a separate PR; pulls-content.tsx and lib/repo/issues.ts's PR-list architecture are untouched.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Search branches and tags, sort them by name or version, and navigate the ref switcher with the keyboard.
    • Search issues by number and use DPNS names in author and assignee filters.
    • See clearer feedback when a name cannot be resolved or a search has no active matches.
  • Bug Fixes
    • Issue searches retain the selected state filter, and outdated lookups no longer replace newer search results.
    • Ref lists keep the default branch first and sort versioned tags in descending version order.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: ad302f7a-9d65-40b5-a5ca-69d84d3d86bd

📥 Commits

Reviewing files that changed from the base of the PR and between ad5641e and 3f76284.

📒 Files selected for processing (16)
  • forge-web/components/repo/issues-content.tsx
  • forge-web/components/repo/ref-list-content.tsx
  • forge-web/components/repo/ref-switcher.tsx
  • forge-web/e2e/ref-switcher-search.spec.ts
  • forge-web/lib/repo/index.ts
  • forge-web/lib/repo/issue-index.ts
  • forge-web/lib/repo/ref-order.ts
  • forge-web/lib/repo/releases.test.ts
  • forge-web/lib/repo/releases.ts
  • forge-web/lib/view/dpns.test.ts
  • forge-web/lib/view/dpns.ts
  • forge-web/lib/view/index.ts
  • forge-web/lib/view/issue-query.test.ts
  • forge-web/lib/view/issue-query.ts
  • forge-web/lib/view/refs.test.ts
  • forge-web/lib/view/refs.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Issue search now resolves DPNS names in author and assignee qualifiers. Repository ref views add search and sorting, while the ref switcher adds keyboard navigation. Issue-number matching and shared ref-ordering utilities are also updated.

Changes

Issue Search

Layer / File(s) Summary
DPNS name resolution
forge-web/lib/view/dpns.ts, forge-web/lib/view/index.ts, forge-web/lib/view/dpns.test.ts
Adds forward DPNS lookup for bare and qualified names, including normalized queries, shared in-flight lookups, absent-result caching, retry after query failure, and reverse-cache seeding on a hit.
Search qualifier handling
forge-web/lib/view/issue-query.ts, forge-web/lib/repo/issue-index.ts, forge-web/lib/view/issue-query.test.ts
Adds helpers to extract and resolve DPNS author and assignee values, preserve current state when building a search submission, and report dropped qualifiers. Bare issue numbers and #number now have distinct matching rules.
Issue search integration
forge-web/components/repo/issues-content.tsx, forge-web/e2e/ref-switcher-search.spec.ts
The issue list resolves submitted and linked searches when the SDK is ready, ignores stale or post-unmount lookup results, and reports unresolved names or unavailable lookup. Filter controls add outside-click and Escape handling, focus restoration, and trimmed identity-ID entry. End-to-end tests cover number searches and DPNS author lookup.

Ref Search and Navigation

Layer / File(s) Summary
Ref ordering helpers
forge-web/lib/repo/ref-order.ts, forge-web/lib/repo/releases.ts, forge-web/lib/repo/index.ts, forge-web/lib/repo/releases.test.ts
Adds natural ref-name and version-aware tag ordering helpers. Release ordering uses and re-exports the shared helpers, and the repo barrel exports the comparison functions.
Branch and tag list search
forge-web/components/repo/ref-list-content.tsx, forge-web/lib/view/refs.ts, forge-web/lib/view/index.ts, forge-web/lib/view/refs.test.ts
Ref lists gain search and name or version sorting, keep the default branch first, and separate filtered live and deleted refs. A shared matcher supports trimmed, case-insensitive substring queries.
Searchable ref picker
forge-web/components/repo/ref-switcher.tsx, forge-web/e2e/ref-switcher-search.spec.ts
The ref switcher gains searchable grouped options, keyboard highlighting, wrapped arrow-key movement, Enter navigation, and Escape focus restoration. End-to-end tests cover filtering, tag order, and keyboard behavior.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix · Severity of issue fixed: Low

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant RefSwitcher
  participant Router
  User->>RefSwitcher: enter search text
  RefSwitcher-->>User: display filtered branches and tags
  User->>RefSwitcher: select highlighted ref with Enter
  RefSwitcher->>Router: navigate to selected ref
Loading

Merge Risk: ⚪ Minimal · up to 3f762

The change adds DPNS-aware issue search and a searchable, consistently ordered ref picker and list. No concrete merge-blocking risk was identified. Live DPNS behavior on the devnet was not verified here, which is normal validation uncertainty.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 3f762

The new name lookup changes how issue filters are prepared, but resolved identities still use the existing filters, and older lookups are prevented from replacing newer searches. No new write or privilege path was identified. Some integration guarantees remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly reachable operation is a DPNS read initiated by issue-search input in the viewer’s selected network. The examined path did not expose a new write operation or allow input to select the queried contract.

Trust Boundaries and Controls

  • observed — Search text can request name resolution, but a returned value must pass identity parsing before becoming an author or assignee filter. A missing resolution stays an unresolved qualifier rather than falling through into free text.

Resilience and Maintainability Implications

  • observed — A linked query is capped at 200 characters before deferred name resolution, and its result is abandoned if the URL has changed. Interactive submission uses the same stale-result guard.

Hardening Proposals

  • proposed — Consider bounding distinct name lookups from an interactive submission as well as from linked queries: the interactive input has no length limit, and eligible names are resolved concurrently.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the pull request's main changes: ref switcher filtering, keyboard behavior, version sorting, issue search, and DPNS fixes.
Docstring Coverage ✅ Passed Docstring coverage is 80.43% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 16 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

PastaPastaPasta and others added 12 commits September 29, 2026 14:52
…(L-13, L-14, L-53)

The ref switcher had no filter box and sorted branches/tags with localeCompare, so a 575-tag repo like dash put v23.1.10 before v23.1.2 and made any one tag hard to find (L-13, L-14). The tags/branches pages had no search or sort control at all (L-53).

Add lib/repo/releases.ts#compareTagNames, reusing the existing tagVersion/versionDesc/naturalRuns primitives (parity with releaseOrder) so the switcher and the tags/branches pages sort identically to the releases page: versioned names first, highest version first, natural-sort fallback and tie-break for the rest. Add lib/view/refs.ts#matchesRefQuery for the shared filter-box matching.

RefSwitcher gets a filter input, a flattened keyboard-navigable option list (ArrowUp/ArrowDown/Enter/Escape, aria-activedescendant) and version-aware group ordering. RefListContent (tags/branches pages) gets a search box and a Name/Version sort toggle.

Covers L-13, L-14 and L-53 of dash-forge FG-7; the remaining FG-7 findings (L-42, L-43, L-44, L-72, L-77 and the PR2 releases findings) are not yet addressed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Must-fix: scroll the keyboard-highlighted option into view, return focus to the trigger button on Escape, and only show the tags/branches "every ref deleted" empty state when the search box is empty (a non-empty query that matches nothing now says so instead).

Should-fix: branches in the switcher sort by natural name order instead of version order (naturalRuns is now exported from releases.ts for this); options carry tabIndex={-1}; aria-selected now tracks the keyboard-highlighted row and aria-current marks the actual current ref (previously conflated); the listbox's children are now role=group sections with aria-labelledby, and the no-match message lives outside the listbox.

Also: memoized the branch/tag arrays (dropping the eslint-disable string-key workaround); each ref entry carries a global flat-list index used for both its DOM id (via useId()) and keyboard highlighting; hovering an option syncs the keyboard highlight (onMouseEnter); Enter ignores IME composition; the tags/branches Name sort uses natural order too; and the releases.test.ts "agrees with releaseOrder" case now actually runs releaseOrder and compares its output, instead of asserting a second hand-copied expectation.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
- naturalRuns: fall back to raw string compare on a full tie (case/separator
  folding made distinct names like foo-bar/foo_bar compare equal, so their
  order depended on caller enumeration order)
- ref-switcher: inline the scroll-into-view id instead of calling optionId
  (a fresh closure every render) so the effect's deps are accurate with no
  eslint-disable
- ref-switcher: also treat legacy keyCode 229 as an IME composition Enter
  (Safari can report isComposing===false on the confirming keystroke)
- ref-switcher: role=presentation on the group heading, per the ARIA
  grouped-listbox pattern
- ref-list-content: fix a backwards comment on the empty-query empty state,
  and retitle the query-yields-no-live-matches state "No active X match"
  since a matching deleted ref can still be listed below it
- releases.test.ts: hoist the newestPerTag describe's rel() helper to module
  scope and reuse it in the releaseOrder cross-check test instead of a
  hand-built duplicate object literal

Addresses the remaining minor findings from the code-review-validator's review of af53601 (verdict: approve with suggestions).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…42, L-72)

LabelFilter: Escape now closes the popover and returns focus to its trigger button (a backdrop click also dismisses it), matching the ref switcher's pattern.

PersonFilter: track whether the id input is being edited in its own state instead of deriving it from the committed value, so clearing filters (value becomes null) or picking a suggestion no longer fights with mid-edit typing; the id input also gets autoFocus when it opens.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
… match bare numbers

L-43: author:/assignee: only accepted a base58 identity id or @me, so a typed or
linked DPNS name (author:unofficial-dashpay-dash-mirror.dash) silently matched
nothing. Adds forward DPNS resolution (resolveDpnsId, via the contract's
unique parentNameAndLabel index and its homograph-safe normalization,
verified against both the js-dash-sdk and rs-dpp source) and resolves
author:/assignee: name candidates before the search box's qualifiers are
lifted into the query.

Also: is:pr (and state:pr) shared the generic author/assignee drop reason,
which was flatly wrong; it now gets its own explanation. A bare number
(7512, not just #7512) now also matches the issue number, alongside the
existing title-substring check.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…lifier helper

Merge dpns.ts's idCache/idPending pair into one idLookups map (a lookup never rejects, so its promise doubles as the in-flight dedupe and the cached answer) and share identityOf between the reverse and forward lookups. Extract issue-query.ts's repeated author:/assignee: token parsing into a personQualifier helper used by both dpnsAuthorCandidates and withResolvedNames.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…, copy

Gate #N to a number-only match (never a title-substring fallback); treat me/none case-insensitively in author:/assignee: matching everywhere, and check a value against the DPNS label shape before ever querying it. resolveDpnsId now caches only a proven absence (0 docs) and drops the entry on a failed read instead of caching it; a hit also seeds the reverse (id -> name) cache for free. Extract the DPNS-resolution step into a pure, injected-resolver resolveSearchNames helper so an out-of-order submit is race-safe and independently unit-testable; wire issues-content.tsx's search box through it with a generation counter and an unmounted flag, a busy-state icon, an honest not-connected reason, and an on-load effect that resolves a linked ?q= the same way a typed search does. Reword the is:pr note to name the Pull requests tab and give an unresolved DPNS name its own message.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
… round

code-simplifier: one ref (not two) for the pending linked-q state, readonly notFoundNames, a shared SearchIcon, trimmer docs.

code-review-validator (critical): a linked ?q= resolution could still overwrite a search, tab or filter change made while the SDK was connecting; change()/the clear-filters button now bump the same submit generation the search-box flow already used, and the on-load effect re-checks the URL before applying.

code-review-validator (note): idLookups' failure handler now only deletes its own entry, not a newer lookup for the same key that may have started since.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…nd list (L-13, L-53)

ref-list-content.tsx's 'name' sort mode called bare naturalRuns, which the ref switcher's branch sort had stopped using in favor of naturalRuns || byRawString for a fixed tie-break. naturalRuns alone isn't a total order (it treats "foo-bar"/"foo_bar"/"Foo.bar" as equal), so the branches/tags page's default sort was non-deterministic and could disagree with the switcher's order, violating L-53. Extract the shared comparator as compareRefNames in a new lib/repo/ref-order.ts (also home to the other pure, SDK-free ordering logic so an e2e spec can import it directly), and use it at both call sites plus compareTagNames's own unversioned fallback.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…um (L-72)

looksLikeDpnsName accepted a 1-2 character label, but the platform's dpns-contract schema (both v1 and v2) sets label's minLength to 3, so such a value could never resolve. Tightening LABEL_SHAPE to 3-63 chars means a value too short to ever match never spends a read on one. Verified against the real schema files in platform/packages/dpns-contract.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…rsonFilter focus flag (L-42)

A plain search-box submit (typed text + Enter) used the whole current query as its base, so a qualifier the viewer deleted from the box (e.g. label:bug) silently kept applying instead of actually clearing, because liftQualifiers only overrides a field a qualifier is present for. searchSubmitBase now keeps only the state tab as base, since searchText always writes the whole current query back into the box as text when it isn't being edited, making the submitted text the single source of truth for every other filter.

Also clears PersonFilter's focusIdRef when value changes from outside the component (reload, Clear filters, a resolved author:<id> qualifier), so a stale 'the select's own onChange just fired' flag can't steal focus for a gesture that already happened or never did.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
… (L-13, L-14, L-53, L-42, L-43, L-72)

Read-only Playwright spec against the dash-core mirror and forge-v2-demo/showcase fixtures: the switcher's live filter narrowing, keyboard nav (arrow keys + wrap + Escape refocus), version-aware tag sort against a real v0.11.2.x release train with both single- and double-digit patches, a bare-number and #N-prefixed issue search match, and author:<dpns-name> resolving to an identity. Passed 6/6 against moutai before its in-place beta.7 upgrade broke read access for all beta.5/beta.6 clients; that upgrade is unrelated to this change (see PR description).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@PastaPastaPasta
PastaPastaPasta force-pushed the fix/fg7-ref-switcher-lists branch from 9ada7c8 to 3f76284 Compare September 29, 2026 19:56
@PastaPastaPasta

Copy link
Copy Markdown
Owner Author

Merging with playwright (read-only, devnet moutai) red and ignored intentionally.

moutai was upgraded in place to Platform v4.2.0-beta.7 on all 13 nodes on 2026-09-29. The beta.6-registered forge contracts can no longer be read, and this branch (and master) ship beta.5-era JS that can't read the chain against that version. The live e2e spec passed 6/6 against moutai before the upgrade — that run is cited in the PR description. This job will stay red for every PR until the bonsia devnet cut-over; it is unrelated to this change, master has no branch protection gating on it, and it is not being chased or rerun. All other checks (install.sh on macOS and Ubuntu, mint-identity, web, CodeRabbit with no actionable findings) are green.


🤖 Posted autonomously by Claude on behalf of pasta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant