Repository navigation
fix(web): ref switcher filter/keyboard/version sort, issue search and DPNS fixes (FG-7 L-13/14/53/42/43/72) - #162
Conversation
|
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 configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (16)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughIssue 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. ChangesIssue Search
Ref Search and Navigation
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
Merge Risk: ⚪ Minimal · up to 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 ReviewSecurity architecture risk: 🔵 Low · up to 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 Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…(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]>
9ada7c8 to
3f76284
Compare
|
Merging with
🤖 Posted autonomously by Claude on behalf of pasta. |
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.mdfindings L-13, L-14, L-53, L-42, L-43, L-72.naturalRunscomparator, 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 singlecompareRefNameshelper (newlib/repo/ref-order.ts) so the two pages sort identically.label:bugfrom the box before hitting Enter didn't actually clear that filter.searchSubmitBasenow keeps only the state tab, since the submitted text is the single source of truth for every other filter.author:/assignee:now resolve a DPNS name (not just a base58 identity id or@me) to an identity before filtering.dpns-contract's schema v1 and v2, both of which setlabel.minLengthto 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: whenvaluechanges from outside the component (reload, "Clear filters", a resolvedauthor:<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.tsis 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 themoutaidevnet.Note on CI: shortly after that run,
moutaiwas upgraded in place to platform v4.2.0-beta.7 on all nodes. The beta.6-registered forge contracts this branch (andmaster) 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 thebonsiadevnet cut-over — this is unrelated to this change. Unit tests, typecheck, and lint are all green.Test plan
npx tsc --noEmit— cleannpx eslinton all changed files — cleannpx vitest run— 2847 passed, 18 skipped (full suite)npx playwright test e2e/ref-switcher-search.spec.tsagainstmoutai— 6/6 passed (before the beta.7 upgrade; expected red in CI untilbonsiacut-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.tsxandlib/repo/issues.ts's PR-list architecture are untouched.🤖 Generated with Claude Code
Summary by CodeRabbit