feat/linkding-search #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/7/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds an inline search bar to the Linkding widget. Searches use Linkding's native
q=parameter, which means the same input box does both name search (matching title/description/url) and tag filtering (with the#tagsyntax). 300 ms debounce;Load morepreserves the active query.What's new
Server (
server/src/routes/api.routes.ts)POST /api/linkding/bookmarksnow accepts an optionalq: stringfield. When present, it's URL-encoded and appended to the upstream call as&q=.... The query string is built withURLSearchParamsso the#token used by Linkding's tag syntax (e.g.#tag) is encoded correctly. Backwards compatible — omittingqproduces the same upstream URL as before.Client (
client/src/components/widgets/LinkdingWidget.tsx)query+debouncedQuerystate with a 300 ms debounce<input>above the bookmark list with aSearchicon prefix and anXclear button on the rightoffset = 0and refetch on debounced query changeq: debouncedQuery || undefinedin the existing POST bodyLoad morecontinues to send the activeq, so paginated results stay filteredDocs
Updated
docs/widgets/linkding.mdFeatures section and the Linkding bullets in the top-level README.Compatibility
App.tsxwidget map,WidgetConfigModalform, andTabbedWidgetare unchanged.linkdingUrl,apiToken,initialLimit./linkding/bookmark/update,/linkding/bookmark/archive) are untouched, so per-item mark-read and archive continue to work in search results.Testing
Tested against a Linkding 1.x instance with ~600 bookmarks across multiple tags:
rust→ list filters to matching bookmarks (title/description/url match)#linux→ list filters to bookmarks taggedlinuxLoad moreafter a filter appends only matching bookmarksType check (
tsc --noEmit) reports no new errors in either workspace.Notes for review
/api/linkding/tagsendpoint + a dropdown UI but kept the single-bar approach to match the widget's compact footprint. The#tagsyntax matches what people who use Linkding directly already type.I'm going to merge this one and then push a couple trivial fixies.