Skip to content

Bug 1764713 - Easily switch between open/closed/both combined bugs in bug search list#2638

Merged
dklawren merged 6 commits into
mozilla-bteam:masterfrom
Xzzz:bug-1764713
Jun 15, 2026
Merged

Bug 1764713 - Easily switch between open/closed/both combined bugs in bug search list#2638
dklawren merged 6 commits into
mozilla-bteam:masterfrom
Xzzz:bug-1764713

Conversation

@Xzzz

@Xzzz Xzzz commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a quick-toggle widget at the top of the bug list results page (buglist.cgi), allowing users to switch between open, closed or all bugs without returning to the search form.

Details

  • buglist.cgi

    • Computes a new template variable status_filter ('open', 'closed', or 'all') by inspecting the bug_status CGI parameters of the current search. Handles both the special aliases (open, closed, all) and explicit lists of individual status names (NEW, ASSIGNED, RESOLVED, etc.)
    • Computes a new template variable urlquerypart_no_status: the current search query string with all bug_status parameters stripped out, used to build toggle links that preserve every other search criterion
  • template/en/default/list/list.html.tmpl

    • Adds a <div class="bz_status_toggle"> immediately after the <hr> separator, containing three controls: Open, Closed, All
    • The active state is rendered as a non-clickable <span>; the other two are <a> links pointing to the current search with bug_status=open, bug_status=closed, or bug_status=all appended
    • The toggle is hidden in the Change Several Bugs at Once (dotweak) mode
  • skins/standard/buglist.css

    Adds styles for the toggle widget following the existing bz_ naming convention:

    • .bz_status_toggle: Flex container for the widget
    • .bz_status_toggle_label: "Show:" label
    • .bz_status_toggle_btn: Individual button (link or span)
    • .bz_status_toggle_btn:hover: Hover state for inactive buttons
    • .bz_status_toggle_btn.active: Active/selected button (filled with --link-color)

How it works

The search engine already understands bug_status=open, bug_status=closed, and bug_status=all as special aliases that expand to the appropriate status sets at query time, so the toggle links are simple and require no server-side changes to the search logic.

Additional info

Test plan

  1. Run a search returning open bugs (bug_status=open) -- Open button is highlighted
  2. Click Closed -- redirects to the same search with bug_status=closed
  3. Click All -- redirects with bug_status=all
  4. Verify that other search parameters (product, assignee…) are preserved in the redirect
  5. Verify display on a search with multiple bug_status values (no button highlighted)

@dklawren dklawren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but needs a few minor changes. Thanks!

Comment thread buglist.cgi Outdated
Comment thread skins/standard/buglist.css
Comment thread template/en/default/list/list.html.tmpl
@Xzzz

Xzzz commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

BMO Test Suite / test_sanity failed cause of the 3 'grep' added at lines 893,896 and 899.
I propose to use List::Utils::any instead.

@Xzzz Xzzz requested a review from dklawren June 12, 2026 10:56
Comment thread buglist.cgi Outdated
Xzzz added 6 commits June 13, 2026 12:53
…rk mode support

--link-color is not defined anywhere in the codebase. The correct variable is --link-text-color (defined in global.css with a dark-mode variant). Also removes the hardcoded #0060df fallback on the active button background, which had poor contrast in dark mode
For named/saved searches, $params is reassigned to a fresh Bugzilla::CGI($buffer) containing bug_status, while $cgi only holds the raw request params. So bug_status is empty there, causing the toggle to always show "All" active for saved searches
… buttons

Toggle links were missing &order=$qorder, silently dropping the user's custom sort when switching between Open/Closed/All. Consistent with all other navigation links in this template (e.g. "all search results", "Change Several Bugs at Once", and "Remember search" links)
@Xzzz Xzzz requested a review from dklawren June 13, 2026 10:58

@dklawren dklawren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM r=dkl

@dklawren dklawren merged commit 819207f into mozilla-bteam:master Jun 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants