From 1f43f232f723f6cb38864fe150ab78b1c0c62cd3 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 8 Dec 2025 00:31:46 +0000 Subject: feat: add is:broken search qualifier for broken links (#2225) Add a new search qualifier `is:broken` that allows users to filter bookmarks with broken or failed links. This matches the functionality on the broken links settings page, where a link is considered broken if: - crawlStatus is "failure" - crawlStatusCode is less than 200 - crawlStatusCode is greater than 299 The qualifier supports negation with `-is:broken` to find working links. Changes: - Add brokenLinks matcher type definition - Update search query parser to handle is:broken qualifier - Implement query execution logic for broken links filtering - Add autocomplete support with translations - Add parser tests - Update search query language documentation Co-authored-by: Claude --- apps/web/components/dashboard/search/useSearchAutocomplete.ts | 6 ++++++ apps/web/lib/i18n/locales/en/translation.json | 2 ++ 2 files changed, 8 insertions(+) (limited to 'apps') diff --git a/apps/web/components/dashboard/search/useSearchAutocomplete.ts b/apps/web/components/dashboard/search/useSearchAutocomplete.ts index cce5fc0b..ba55d51f 100644 --- a/apps/web/components/dashboard/search/useSearchAutocomplete.ts +++ b/apps/web/components/dashboard/search/useSearchAutocomplete.ts @@ -63,6 +63,12 @@ const QUALIFIER_DEFINITIONS = [ value: "is:media", appendSpace: true, }, + { + value: "is:broken", + descriptionKey: "search.is_broken_link", + negatedDescriptionKey: "search.is_not_broken_link", + appendSpace: true, + }, { value: "url:", descriptionKey: "search.url_contains", diff --git a/apps/web/lib/i18n/locales/en/translation.json b/apps/web/lib/i18n/locales/en/translation.json index ccd80ba2..33c7d6e2 100644 --- a/apps/web/lib/i18n/locales/en/translation.json +++ b/apps/web/lib/i18n/locales/en/translation.json @@ -662,6 +662,8 @@ "type_is_not": "Type is not", "is_from_feed": "Is from RSS Feed", "is_not_from_feed": "Is not from RSS Feed", + "is_broken_link": "Has Broken Link", + "is_not_broken_link": "Has Working Link", "and": "And", "or": "Or", "history": "Recent Searches", -- cgit v1.2.3-70-g09d2