feat(dashboard): extract inline script to standalone dashboard.ts/js, add UI build/check recipes, and add route unit tests

This commit is contained in:
Riz Ashraf committed 2026-10-05 12:48:36 +01:00
1 parent 4b307b55b9
commit 19f9c7ace7
24 files changed
+2343 -1819

No files matched your search

+27 -21
View File
@@ -13,32 +13,38 @@ pub async fn start_background_indexer(state: Arc<MemoryState>) {
tokio::spawn(async move {
tracing::info!("Starting background indexer in {:?}", workspace_root);
let walker = WalkBuilder::new(&workspace_root)
.hidden(true)
.git_ignore(true)
.build();
let root_clone = workspace_root.clone();
let files_to_process = tokio::task::spawn_blocking(move || {
let walker = WalkBuilder::new(&root_clone)
.hidden(true)
.git_ignore(true)
.build();
let mut files_to_process = Vec::new();
for result in walker {
match result {
Ok(entry) => {
if entry.file_type().is_some_and(|ft| ft.is_file()) {
let path = entry.path().to_path_buf();
let ext = path.extension().and_then(|e| e.to_str()).unwrap_or("");
if [
"rs", "ts", "js", "jsx", "tsx", "py", "java", "c", "cpp", "go",
]
.contains(&ext)
{
files_to_process.push(path);
let mut files = Vec::new();
for result in walker {
match result {
Ok(entry) => {
if entry.file_type().is_some_and(|ft| ft.is_file()) {
let path = entry.path().to_path_buf();
let ext = path.extension().and_then(|e| e.to_str()).unwrap_or("");
if [
"rs", "ts", "js", "jsx", "tsx", "py", "java", "c", "cpp", "go",
]
.contains(&ext)
{
files.push(path);
}
}
}
}
Err(e) => {
tracing::warn!("Error walking directory: {}", e);
Err(e) => {
tracing::warn!("Error walking directory: {}", e);
}
}
}
}
files
})
.await
.unwrap_or_default();
let idx = state.get_search_index();