← Back to Pull requests

frontend: keep the other filter values after a selection #1627

Closed
unknown closed this pull request without merging on Nov 03, 2026 19:54 UTC
View on GitHub
unknown unknown commented on Nov 02, 2026 10:01 UTC
Author

When you selected a filter value, the other values of the same filter went away and the sidebar became shorter and narrower. The cause: the bucket filters were in the query, so they also applied to the aggregation of their own filter.

Now the bucket filters go in post_filter. They apply to the hits, but not to the aggregations. Each filter's aggregation is in a filter aggregation that applies the selections of the other filters only. Thus:

  • The hits, the total and the scores (with rescore) do not change.

  • A filter shows all its values, with the counts that the other filters give.

  • A selected value always shows in its filter, also when the other filters push it out of the top values. Thus you can clear it.
  • In a checkbox filter (for example Licenses), the count of a value that is not selected is the number of packages with that value under the other filters. Before, it was the number of packages with that value and a selected value of the same filter. The selections of one filter combine with OR, thus the new count is the correct one.

    Fixes https://github.com/NixOS/nixos-search/issues/1626

    Test

  • On latest-52-nixos-unstable, query test with haskellPackages selected: the hits, the total (389) and the scores are the same as with the filter in the query. The Package sets filter shows all package sets, not only haskellPackages.

  • The request body from Search.Query.packagesBody (from elm repl, with haskellPackages and two licenses selected) runs on the live index, and Page.Packages.decodeResultAggregations decodes the response.

  • elm make, elm-test and elm-format --validate pass. elm-review gives the same findings as on main.
  • To check by hand: search test, then select a package set. The other package sets stay in the list and the sidebar keeps its width.

    Assisted-by: Claude:claude-opus-5-5

    https://claude.ai/code/session_01RbKyH3R5kxc54AtQcTKEz4

    Diff: 239 lines (+179 / -60) across 2 files Reviewer: Sigmanificient Review duration: 2033m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 239 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.328
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1627"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.7% · Safe to merge
    14.7%