Workflow Page Local Search Implementation
Overview
Each workflow category page (Administration, Examinations, LMS, Payments, Enrollment, Self-Service) now includes a local search bar that allows users to search and filter workflows specific to that category.
How It Works
Components Used
-
WorkflowPageSearch Component (
src/components/WorkflowPageSearch/WorkflowPageSearch.tsx
)- Provides the search input and filtering functionality
- Handles real-time search as users type
- Displays filtered results with highlighting
- Shows search tips when no query is active
-
Original Card Component (
src/components/Card/index.tsx
)- Renders individual workflow cards
- Used by the search component to display results
Implementation Pattern
Each workflow category page follows this pattern:
---
sidebar_position: X
---
import WorkflowPageSearch from '@site/src/components/WorkflowPageSearch/WorkflowPageSearch';
# Category Title
Description of the category...
export const categoryWorkflows = [
{
title: "Workflow Title",
description: "Workflow description...",
link: "Workflows/workflow-link"
},
// ... more workflows
];
<WorkflowPageSearch
workflows={categoryWorkflows}
placeholder="Search category workflows..."
categoryTitle="category workflows"
/>
Search Features
- Real-time filtering: Results update as you type
- Multi-field search: Searches both title and description
- Text highlighting: Matching text is highlighted in results
- Result count: Shows number of matching workflows
- No results handling: Displays helpful message when no matches found
- Search tips: Provides guidance when search is empty
Files Modified
docs/workflows/administration.md
docs/workflows/examinations.md
docs/workflows/lms-workflows.md
docs/workflows/payments.md
docs/workflows/enroll.md
docs/workflows/self_service.md
Adding New Workflows
To add a new workflow to any category:
- Open the respective workflow category file (e.g.,
docs/workflows/examinations.md
) - Add a new entry to the workflows array:
{
title: "New Workflow Title",
description: "Description of what this workflow does...",
link: "Workflows/new-workflow-link"
} - The search will automatically include the new workflow
Technical Details
- Framework: React component integrated with Docusaurus MDX
- Styling: CSS Modules for scoped styling
- Performance: Debounced search with useMemo for optimization
- Accessibility: Proper ARIA labels and keyboard navigation
- Responsive: Mobile-friendly grid layout
Benefits
- Improved UX: Users can quickly find specific workflows within each category
- Category-specific: Search is scoped to the current workflow category
- Fast: No external API calls - all filtering happens client-side
- Maintainable: Simple data structure for adding/removing workflows
- Consistent: Same search experience across all workflow pages