WorkDesk
Global Search
The global search bar in WorkDesk's top navigation searches across tasks, workflow history, and notifications simultaneously. Results are grouped by section and sorted by relevance. Press Ctrl+K to focus the search bar from anywhere.
Activating Global Search
- Click the search bar in the top navigation
- Press
Ctrl+K(orCmd+Kon macOS) from anywhere in WorkDesk - Click the search icon in the top bar
Search Behavior
| Behavior | Detail |
|---|---|
| Minimum query length | 2 characters — shorter queries are ignored |
| Debounce delay | 300ms after last keystroke — prevents excessive API calls |
| Results per section | Default: top 5 per section — expandable to 20 |
| Result ranking | Exact title match > partial title match > body/description match |
| Empty query | Clears results — shows recent searches if any |
| Loading state | Spinner shown while API call is in progress (typically <200ms) |
React Component Implementation
import { useState, useCallback } from 'react';
import { useDebouncedCallback } from 'use-debounce';
import { useSearchStore } from '../stores/searchStore';
function GlobalSearch() {
const [query, setQuery] = useState('');
const { results, setResults, isLoading, setLoading } = useSearchStore();
const search = useDebouncedCallback(async (q: string) => {
if (q.length < 2) { setResults(null); return; }
setLoading(true);
try {
const data = await api.get(`/workdesk/search?q=${encodeURIComponent(q)}&limit=5`);
setResults(data);
} finally {
setLoading(false);
}
}, 300);
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setQuery(e.target.value);
search(e.target.value);
};
return (
<div className="global-search">
<input
type="text"
placeholder="Search tasks, workflows, notifications..."
value={query}
onChange={handleChange}
/>
{isLoading && <Spinner />}
{results && <SearchResults results={results} query={query} />}
</div>
);
}
Result Navigation
Clicking a search result navigates directly to that item:
- Task result → opens the task detail page:
/workdesk/inbox/task/{taskId} - Execution result → opens the execution in Observer Panel:
/workdesk/history/{executionId} - Notification result → navigates to the
linkedUrlfrom the notification payload
Scoped Search
Global search can be scoped to a single section by appending a section parameter. This is useful when you know the result is in a specific section:
// Scope to tasks only
GET /api/workdesk/search?q=budget+review§ion=tasks
// Scope to history only
GET /api/workdesk/search?q=payroll§ion=history
// All sections (default)
GET /api/workdesk/search?q=budget+review
Recent Searches
WorkDesk stores the last 10 search queries in localStorage and shows them as suggestions when the search bar is focused with an empty query. This makes re-running recent searches one click away.