Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

As part of this change, all database queries were removed from `riverui` in favor of being implemented directly in the underlying OSS and Pro drivers. [PR #379](https://github.com/riverqueue/riverui/pull/379).

- For job kind and queue name searching, match input against substrings instead of only prefixes. Particularly for long names, this is far more convenient. [PR #398](https://github.com/riverqueue/riverui/pull/398).

## [v0.11.0] - 2025-06-05

### Changed
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ toolchain go1.24.1
require (
github.com/jackc/pgx/v5 v5.7.5
github.com/riverqueue/apiframe v0.0.0-20250408034821-b206bbbd0fb4
github.com/riverqueue/river v0.23.2-0.20250814074605-de60166d37e9
github.com/riverqueue/river/riverdriver v0.23.2-0.20250814074605-de60166d37e9
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250814074605-de60166d37e9
github.com/riverqueue/river/rivershared v0.23.2-0.20250814074605-de60166d37e9
github.com/riverqueue/river/rivertype v0.23.2-0.20250814074605-de60166d37e9
github.com/riverqueue/river v0.23.2-0.20250816150517-3bbe023cb707
github.com/riverqueue/river/riverdriver v0.23.2-0.20250816150517-3bbe023cb707
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250816150517-3bbe023cb707
github.com/riverqueue/river/rivershared v0.23.2-0.20250816150517-3bbe023cb707
github.com/riverqueue/river/rivertype v0.23.2-0.20250816150517-3bbe023cb707
github.com/rs/cors v1.11.1
github.com/samber/slog-http v1.7.0
github.com/stretchr/testify v1.10.0
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/apiframe v0.0.0-20250408034821-b206bbbd0fb4 h1:ejJogJ57bF+jMbvGjZQ6H6LR0NCTDQr30SJ/wSVepgs=
github.com/riverqueue/apiframe v0.0.0-20250408034821-b206bbbd0fb4/go.mod h1:6aXA9FSXKkxwjbOUSXdrIOuw478Lvtz/eEu45R4MoQk=
github.com/riverqueue/river v0.23.2-0.20250814074605-de60166d37e9 h1:lZo9jQ3W4UbYb0O5HQt5q1J8nnLhwlWANKbuLce35uM=
github.com/riverqueue/river v0.23.2-0.20250814074605-de60166d37e9/go.mod h1:Msv4R+qLAFDKhz7B6N4ktnQGavDUCW2AJhbj+61DQoA=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250814074605-de60166d37e9 h1:mlNUAYvgJ6Hr55qjc1gRTVhjF8t3wtkrkJDm5QfMuZ0=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250814074605-de60166d37e9/go.mod h1:GN3r8XgDN/YwY1mudkPdrtyFTE3Pq/AMKrUePlcH0Uc=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250814074605-de60166d37e9 h1:MD2m/oOrSmC220RE+xoWh9pM6jvVZiZnbHou/5BTYas=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250814074605-de60166d37e9/go.mod h1:Mt3zongTp4MafONJWcvP8zQHgp8o6agzNMwqdo78HT4=
github.com/riverqueue/river/rivershared v0.23.2-0.20250814074605-de60166d37e9 h1:iCWXmRads4f0TtsikZc0SbfHGGJw+XO0hUanGYwO0oc=
github.com/riverqueue/river/rivershared v0.23.2-0.20250814074605-de60166d37e9/go.mod h1:cWMyuFTeoEVawX7VwXZztDFY3BdAI4SgOwrNUfAFAAg=
github.com/riverqueue/river/rivertype v0.23.2-0.20250814074605-de60166d37e9 h1:MBPx8FjzjWBaJsLpx+0p+0/heTNT5ODB8fU/xHDDRfA=
github.com/riverqueue/river/rivertype v0.23.2-0.20250814074605-de60166d37e9/go.mod h1:lmdl3vLNDfchDWbYdW2uAocIuwIN+ZaXqAukdSCFqWs=
github.com/riverqueue/river v0.23.2-0.20250816150517-3bbe023cb707 h1:4gNkOxixPCM6L6HXACL16K8VG2XFk+lYIyYNXkok65Y=
github.com/riverqueue/river v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:Msv4R+qLAFDKhz7B6N4ktnQGavDUCW2AJhbj+61DQoA=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250816150517-3bbe023cb707 h1:s3wIREfkSdanJO0b+bDWWfN+g5tdv+B6SS7y498lsfY=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:GN3r8XgDN/YwY1mudkPdrtyFTE3Pq/AMKrUePlcH0Uc=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250816150517-3bbe023cb707 h1:c8gQvgual5K0j7NXqGqjF+35yXjwKE47UNQ0JEi4Row=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:Mt3zongTp4MafONJWcvP8zQHgp8o6agzNMwqdo78HT4=
github.com/riverqueue/river/rivershared v0.23.2-0.20250816150517-3bbe023cb707 h1:SsQNTlS+FmCtDSAhfFgZUz0qm1GkYzMviMNkFZmYeko=
github.com/riverqueue/river/rivershared v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:cWMyuFTeoEVawX7VwXZztDFY3BdAI4SgOwrNUfAFAAg=
github.com/riverqueue/river/rivertype v0.23.2-0.20250816150517-3bbe023cb707 h1:v0yjw2clr+BykJkNsFtnV4rrta5b7d3u54mpNlqT71c=
github.com/riverqueue/river/rivertype v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:lmdl3vLNDfchDWbYdW2uAocIuwIN+ZaXqAukdSCFqWs=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
Expand Down
20 changes: 10 additions & 10 deletions handler_api_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type autocompleteListRequest struct {
After *string `json:"-"` // from ExtractRaw
Exclude []string `json:"-"` // from ExtractRaw
Facet autocompleteFacet `json:"-"` // from ExtractRaw
Prefix *string `json:"-"` // from ExtractRaw
Match *string `json:"-"` // from ExtractRaw
}

func (req *autocompleteListRequest) ExtractRaw(r *http.Request) error {
Expand All @@ -86,8 +86,8 @@ func (req *autocompleteListRequest) ExtractRaw(r *http.Request) error {
req.Facet = autocompleteFacet(facet)
}

if prefix := r.URL.Query().Get("prefix"); prefix != "" {
req.Prefix = &prefix
if match := r.URL.Query().Get("match"); match != "" {
req.Match = &match
}

return nil
Expand All @@ -97,9 +97,9 @@ func (a *autocompleteListEndpoint[TTx]) Execute(ctx context.Context, req *autoco
return dbutil.WithTxV(ctx, a.DB, func(ctx context.Context, execTx riverdriver.ExecutorTx) (*listResponse[string], error) {
tx := a.Driver.UnwrapTx(execTx)

prefix := ""
if req.Prefix != nil {
prefix = *req.Prefix
match := ""
if req.Match != nil {
match = *req.Match
}

after := ""
Expand All @@ -109,11 +109,11 @@ func (a *autocompleteListEndpoint[TTx]) Execute(ctx context.Context, req *autoco

switch req.Facet {
case autocompleteFacetJobKind:
kinds, err := a.Driver.UnwrapExecutor(tx).JobKindListByPrefix(ctx, &riverdriver.JobKindListByPrefixParams{
kinds, err := a.Driver.UnwrapExecutor(tx).JobKindList(ctx, &riverdriver.JobKindListParams{
After: after,
Exclude: req.Exclude,
Match: match,
Max: 100,
Prefix: prefix,
})
if err != nil {
return nil, fmt.Errorf("error listing job kinds: %w", err)
Expand All @@ -128,11 +128,11 @@ func (a *autocompleteListEndpoint[TTx]) Execute(ctx context.Context, req *autoco
return listResponseFrom(kindPtrs), nil

case autocompleteFacetQueueName:
queues, err := a.Driver.UnwrapExecutor(tx).QueueNameListByPrefix(ctx, &riverdriver.QueueNameListByPrefixParams{
queues, err := a.Driver.UnwrapExecutor(tx).QueueNameList(ctx, &riverdriver.QueueNameListParams{
After: after,
Exclude: req.Exclude,
Match: match,
Max: 100,
Prefix: prefix,
})
if err != nil {
return nil, fmt.Errorf("error listing queue names: %w", err)
Expand Down
6 changes: 3 additions & 3 deletions handler_api_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ func runAutocompleteTests(t *testing.T, facet autocompleteFacet, setupFunc func(

prefix := alphaPrefix
resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &autocompleteListRequest{
Facet: facet,
Prefix: &prefix,
Facet: facet,
Match: &prefix,
})
require.NoError(t, err)
require.Len(t, resp.Data, 2)
Expand Down Expand Up @@ -155,7 +155,7 @@ func runAutocompleteTests(t *testing.T, facet autocompleteFacet, setupFunc func(
resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &autocompleteListRequest{
Exclude: []string{"alpha_" + facet.baseString()},
Facet: facet,
Prefix: &prefix,
Match: &prefix,
})
require.NoError(t, err)
require.Len(t, resp.Data, 1)
Expand Down
10 changes: 5 additions & 5 deletions riverproui/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ require (
github.com/google/uuid v1.6.0
github.com/jackc/pgx/v5 v5.7.5
github.com/riverqueue/apiframe v0.0.0-20250708014637-e55c49c01ff7
github.com/riverqueue/river v0.23.2-0.20250815071441-5c69b13473c3
github.com/riverqueue/river/riverdriver v0.23.2-0.20250815071441-5c69b13473c3
github.com/riverqueue/river/rivershared v0.23.2-0.20250816032405-9c54d2b91689
github.com/riverqueue/river/rivertype v0.23.2-0.20250816032405-9c54d2b91689
github.com/riverqueue/river v0.23.2-0.20250816150517-3bbe023cb707
github.com/riverqueue/river/riverdriver v0.23.2-0.20250816150517-3bbe023cb707
github.com/riverqueue/river/rivershared v0.23.2-0.20250816150517-3bbe023cb707
github.com/riverqueue/river/rivertype v0.23.2-0.20250816150517-3bbe023cb707
github.com/stretchr/testify v1.10.0
riverqueue.com/riverpro v0.16.0-rc.2
riverqueue.com/riverpro/driver v0.16.0-rc.2
Expand All @@ -29,7 +29,7 @@ require (
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250815071441-5c69b13473c3 // indirect
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250816150517-3bbe023cb707 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/samber/slog-http v1.7.0 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions riverproui/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/riverqueue/apiframe v0.0.0-20250708014637-e55c49c01ff7 h1:A16RTdTAQ2cIY++FPjiQ9yL8/2FXR4wYmaN7SpP3yP0=
github.com/riverqueue/apiframe v0.0.0-20250708014637-e55c49c01ff7/go.mod h1:jV49jb/qzxSqwDajmG4N2Cm50KATxblxlSiXMF9Ck1E=
github.com/riverqueue/river v0.23.2-0.20250815071441-5c69b13473c3 h1:UhPFvHKTwT3LHvNBObURfOBH0LmLntRz9CKnc1cN3Hw=
github.com/riverqueue/river v0.23.2-0.20250815071441-5c69b13473c3/go.mod h1:Msv4R+qLAFDKhz7B6N4ktnQGavDUCW2AJhbj+61DQoA=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250815071441-5c69b13473c3 h1:Yc5wv5zKCuqReC94wbOrBRBXq+ACnNRgft2diur1+NY=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250815071441-5c69b13473c3/go.mod h1:GN3r8XgDN/YwY1mudkPdrtyFTE3Pq/AMKrUePlcH0Uc=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250815071441-5c69b13473c3 h1:0B65rob4gUeoHDDiO6axSzYZglAqVMWGgiuzgPT9DBk=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250815071441-5c69b13473c3/go.mod h1:Mt3zongTp4MafONJWcvP8zQHgp8o6agzNMwqdo78HT4=
github.com/riverqueue/river/rivershared v0.23.2-0.20250816032405-9c54d2b91689 h1:I+J37HauI5ycvKAIXtiEDjzjwhS2nIF/k6qTs8tAg+g=
github.com/riverqueue/river/rivershared v0.23.2-0.20250816032405-9c54d2b91689/go.mod h1:cWMyuFTeoEVawX7VwXZztDFY3BdAI4SgOwrNUfAFAAg=
github.com/riverqueue/river/rivertype v0.23.2-0.20250816032405-9c54d2b91689 h1:LoGoceiBQ8yiv7zRvowYOyXufwbL6xFn7G2++DUVEz4=
github.com/riverqueue/river/rivertype v0.23.2-0.20250816032405-9c54d2b91689/go.mod h1:lmdl3vLNDfchDWbYdW2uAocIuwIN+ZaXqAukdSCFqWs=
github.com/riverqueue/river v0.23.2-0.20250816150517-3bbe023cb707 h1:4gNkOxixPCM6L6HXACL16K8VG2XFk+lYIyYNXkok65Y=
github.com/riverqueue/river v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:Msv4R+qLAFDKhz7B6N4ktnQGavDUCW2AJhbj+61DQoA=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250816150517-3bbe023cb707 h1:s3wIREfkSdanJO0b+bDWWfN+g5tdv+B6SS7y498lsfY=
github.com/riverqueue/river/riverdriver v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:GN3r8XgDN/YwY1mudkPdrtyFTE3Pq/AMKrUePlcH0Uc=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250816150517-3bbe023cb707 h1:c8gQvgual5K0j7NXqGqjF+35yXjwKE47UNQ0JEi4Row=
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:Mt3zongTp4MafONJWcvP8zQHgp8o6agzNMwqdo78HT4=
github.com/riverqueue/river/rivershared v0.23.2-0.20250816150517-3bbe023cb707 h1:SsQNTlS+FmCtDSAhfFgZUz0qm1GkYzMviMNkFZmYeko=
github.com/riverqueue/river/rivershared v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:cWMyuFTeoEVawX7VwXZztDFY3BdAI4SgOwrNUfAFAAg=
github.com/riverqueue/river/rivertype v0.23.2-0.20250816150517-3bbe023cb707 h1:v0yjw2clr+BykJkNsFtnV4rrta5b7d3u54mpNlqT71c=
github.com/riverqueue/river/rivertype v0.23.2-0.20250816150517-3bbe023cb707/go.mod h1:lmdl3vLNDfchDWbYdW2uAocIuwIN+ZaXqAukdSCFqWs=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
Expand Down
22 changes: 11 additions & 11 deletions src/components/job-search/JobSearch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,25 @@ export const WithInitialFilters: Story = {
initialFilters: [
{
id: "1",
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
},
{
id: "2",
prefix: "queue:",
match: "queue:",
typeId: FilterTypeId.QUEUE,
values: ["default"],
},
{
id: "3",
prefix: "priority:",
match: "priority:",
typeId: FilterTypeId.PRIORITY,
values: ["1"],
},
{
id: "4",
prefix: "id:",
match: "id:",
typeId: FilterTypeId.ID,
values: ["123", "456"],
},
Expand All @@ -108,7 +108,7 @@ const FilterChangeDemo = () => {

// Create a log entry summarizing the change
const filterSummary = newFilters
.map((f) => `${f.prefix}${f.values.join(",")}`)
.map((f) => `${f.match}${f.values.join(",")}`)
.join("; ");

setFilterLog((prev) => [
Expand All @@ -135,7 +135,7 @@ const FilterChangeDemo = () => {
initialFilters={[
{
id: "1",
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["email"],
},
Expand Down Expand Up @@ -229,7 +229,7 @@ const KeyboardInteractionDemo = () => {
initialFilters={[
{
id: "1",
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["email"],
},
Expand Down Expand Up @@ -270,13 +270,13 @@ const MultiValueDemo = () => {
initialFilters={[
{
id: "1",
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["email"],
},
{
id: "2",
prefix: "queue:",
match: "queue:",
typeId: FilterTypeId.QUEUE,
values: ["high-priority"],
},
Expand Down Expand Up @@ -307,7 +307,7 @@ export const NarrowWithLongFilters: Story = {
initialFilters={[
{
id: "1",
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: [
"very-long-job-kind-value-that-should-truncate",
Expand All @@ -317,7 +317,7 @@ export const NarrowWithLongFilters: Story = {
},
{
id: "2",
prefix: "queue:",
match: "queue:",
typeId: FilterTypeId.QUEUE,
values: ["queue-with-a-really-really-long-name-that-will-not-fit"],
},
Expand Down
22 changes: 11 additions & 11 deletions src/components/job-search/JobSearch.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe("JobSearch", () => {
const initialFilters: Filter[] = [
{
id: "1",
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
},
Expand Down Expand Up @@ -99,7 +99,7 @@ describe("JobSearch", () => {
await waitFor(() => {
expect(onFiltersChange).toHaveBeenCalledWith([
expect.objectContaining({
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
}),
Expand Down Expand Up @@ -129,7 +129,7 @@ describe("JobSearch", () => {
// Should have called onFiltersChange after debounce
expect(onFiltersChange).toHaveBeenCalledWith([
expect.objectContaining({
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
}),
Expand Down Expand Up @@ -274,7 +274,7 @@ describe("JobSearch", () => {
await waitFor(() => {
expect(onFiltersChange).toHaveBeenCalledWith([
expect.objectContaining({
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: [],
}),
Expand Down Expand Up @@ -307,7 +307,7 @@ describe("JobSearch", () => {
await waitFor(() => {
expect(onFiltersChange).toHaveBeenCalledWith([
expect.objectContaining({
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
}),
Expand Down Expand Up @@ -336,7 +336,7 @@ describe("JobSearch", () => {
const initialFilters: Filter[] = [
{
id: "1",
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
},
Expand Down Expand Up @@ -488,7 +488,7 @@ describe("JobSearch", () => {
await waitFor(() => {
expect(onFiltersChange).toHaveBeenCalledWith([
expect.objectContaining({
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch", "stream"],
}),
Expand All @@ -509,12 +509,12 @@ describe("JobSearch", () => {
await waitFor(() => {
expect(onFiltersChange).toHaveBeenCalledWith([
expect.objectContaining({
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
}),
expect.objectContaining({
prefix: "queue:",
match: "queue:",
typeId: FilterTypeId.QUEUE,
values: ["priority"],
}),
Expand All @@ -535,12 +535,12 @@ describe("JobSearch", () => {
await waitFor(() => {
expect(onFiltersChange).toHaveBeenCalledWith([
expect.objectContaining({
prefix: "kind:",
match: "kind:",
typeId: FilterTypeId.KIND,
values: ["batch"],
}),
expect.objectContaining({
prefix: "queue:",
match: "queue:",
typeId: FilterTypeId.QUEUE,
values: ["priority"],
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/job-search/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export function useSuggestions({
const suggestions = AVAILABLE_FILTERS.filter(
(f) =>
f.label.toLowerCase().includes(query.toLowerCase()) ||
f.prefix.toLowerCase().startsWith(query.toLowerCase()),
f.match.toLowerCase().startsWith(query.toLowerCase()),
).map((f) => f.label);

setSuggestionsState((prev) => ({
Expand Down
Loading
Loading