Skip to content

Bucket list filter changes#207

Open
ksy36 wants to merge 2 commits into
mainfrom
bucket-list-filters
Open

Bucket list filter changes#207
ksy36 wants to merge 2 commits into
mainfrom
bucket-list-filters

Conversation

@ksy36
Copy link
Copy Markdown
Collaborator

@ksy36 ksy36 commented May 16, 2026

I've made these changes:

  1. Changed the buttons on the buckets page to display buckets that are only in a selected state, so "Triaged" will only display triaged, "Logged" will only display bugs that are linked to a bugzilla bug (instead of these buckets being added to the same list).
  2. Added filter by triage status (worksforme, invalid, etc.), it's displayed when selecting "Triaged" state.
  3. Changed url hash from query string to a format that's closer to something that github search has, along the lines of #status=triaged&domain=example.com&triage_status=worksforme. It also supports multiple items with the same key, for future support for labels i.e .#status=triaged&label=nsfw&label=-worldcup2026.
  4. Separated Advance query into a separate "mode", so it's possible to edit it and see results, but it won't be converted back into the simple filter or url.

ksy36 added 2 commits May 15, 2026 22:11
…uttons and filter by triage status, change url hash from query string to a different format, separate Advance query mode
@ksy36 ksy36 marked this pull request as ready for review May 19, 2026 01:45
@ksy36 ksy36 requested a review from jgraham May 19, 2026 01:45
Copy link
Copy Markdown
Collaborator

@jgraham jgraham left a comment

Choose a reason for hiding this comment

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

I think the only blocking comment here is about using Logged as a label. But I'm not sure that this frontend design is going to scale well to more kinds of search, and I also think the code is likely to need a refactor to make other searches work well. Given we know we have requirements around country-specific searches and so on I think we should consider doing that work sooner rather than later.

@@ -0,0 +1,41 @@
export const BUCKET_STATES = [
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.

Why is this a list and not a mapping like {key: {label, queryFields}}?

0: query,
1: {
op: "AND",
0: { op: "OR", domain, domain__endswith: "." + domain },
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.

It's a bit unclear to me why this works when there isn't a domain filter; it seems like in that case it's either going to match the empty string or a domain that ends with ".". Clearly it does work however :)

I think for the purposes of future extension it would be good to create a query builder object that creates a query based on the fields that are part of the query.


export const parseHash = (hash) => {
return hash
const result = {};
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.

I don't love the way that the handling of each part of the filter is now split across multiple files, so adding new filters requires you to update code in lots of places. In particular buildHash requires you to know specifics about what filter properties are supported.

const parts = [];
if (activeState !== "needs_triage") parts.push(`status=${activeState}`);
if (domainFilter) parts.push(`domain=${encodeURIComponent(domainFilter)}`);
if (triageStatus)
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.

I think we should start linting against this if-without-braces style.

);
.filter(Boolean)
.forEach((part) => {
const eqIdx = part.indexOf("=");
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.

What if it doesn't contain an =? I guess key ends up being the empty string and value ends up being whatever's in that part of the query which is sort of fine, but it's not obvious from the code if it's intended or not.

queryFields: () => ({ bug__isnull: true, triage_status__isnull: true }),
},
{
key: "logged",
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.

I think "Logged" is a bit unclear. AIUI the semantics are "has a bug".

<template>
<div>
<div class="btn-group" role="group" aria-label="Bucket status filter">
<button
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.

When I look at this locally it doesn't quite make sense to me. "Needs Triage" and "Triaged" are obviously different, but "Logged" seems most like a subset of "Triaged" (presumably untriaged buckets don't have bugs").


<div class="filter-row">
<div class="input-group input-group-sm domain-input">
<span class="input-group-addon"><i class="bi bi-globe2"></i></span>
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.

Having two icons on this control makes it feel busy. I'm also not a huge fan of the only clue about what the control does being placeholder text. If we add a second text input, having the search button on this one won't work.

If we want to make things visually simple we could go down the github route where you write the search as domain:youtube.com label:wordcup status:untriaged or something like that.

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.

2 participants