@@ -122,6 +122,53 @@ export function generateDocsHtml(routes: RouteInfo[], options: DocsGeneratorOpti
122122 </div>
123123 </div>
124124 </div>
125+
126+ <div class="search-filter-bar">
127+ <div class="search-box">
128+ <span class="iconify search-icon" data-icon="mdi:magnify"></span>
129+ <input
130+ type="search"
131+ id="searchInput"
132+ class="search-input"
133+ placeholder="Search endpoints, descriptions..."
134+ />
135+ </div>
136+
137+ <div class="filter-group">
138+ <select id="typeFilter" class="filter-select">
139+ <option value="all">All Types</option>
140+ <option value="query">Queries</option>
141+ <option value="mutation">Mutations</option>
142+ </select>
143+
144+ <select id="authFilter" class="filter-select">
145+ <option value="all">All Endpoints</option>
146+ <option value="public">Public</option>
147+ <option value="protected">Protected</option>
148+ </select>
149+
150+ <select id="tagFilter" class="filter-select">
151+ <option value="all">All Tags</option>
152+ ${ Array . from (
153+ new Set ( routes . flatMap ( r => ( r . meta ?. docs as RouteMeta [ 'docs' ] ) ?. tags || [ ] ) )
154+ )
155+ . sort ( )
156+ . map ( tag => `<option value="${ escapeHtml ( tag ) } ">${ escapeHtml ( tag ) } </option>` )
157+ . join ( '' ) }
158+ </select>
159+ </div>
160+
161+ <div class="filter-controls">
162+ <button class="clear-filters-btn" id="clearFiltersBtn" onclick="clearFilters()">
163+ <span class="iconify" data-icon="mdi:filter-remove" style="width: 14px; height: 14px;"></span>
164+ Clear Filters
165+ </button>
166+ </div>
167+
168+ <div class="results-count" id="resultsCount">
169+ Showing ${ routes . length } of ${ routes . length } endpoints
170+ </div>
171+ </div>
125172 </header>
126173
127174 ${ Object . entries ( groupedRoutes )
@@ -182,8 +229,23 @@ function generateRouteCard(route: RouteInfo): string {
182229 const docs = route . meta ?. docs as RouteMeta [ 'docs' ] ;
183230 const routeId = route . path . replace ( / \. / g, '-' ) ;
184231
232+ // Prepare searchable text and filter attributes
233+ const searchableText = [
234+ route . path ,
235+ route . meta ?. name || '' ,
236+ docs ?. description || '' ,
237+ ...( docs ?. tags || [ ] )
238+ ]
239+ . join ( ' ' )
240+ . toLowerCase ( ) ;
241+
185242 return `
186- <div class="route-card" id="${ routeId } ">
243+ <div class="route-card"
244+ id="${ routeId } "
245+ data-type="${ route . type } "
246+ data-auth="${ docs ?. auth ? 'true' : 'false' } "
247+ data-tags="${ ( docs ?. tags || [ ] ) . join ( ',' ) } "
248+ data-search="${ escapeHtml ( searchableText ) } ">
187249 <div class="route-header">
188250 <span class="method-badge method-${ route . type } ">${ route . type } </span>
189251 <div class="route-path-info">
0 commit comments