Release RuneStone 0.1.4 with installable plugins and settings

This commit is contained in:
Knotty Wyvern
2026-10-04 15:05:51 -07:00
parent 0268c5c9f0
commit 6b7af0d527
82 changed files with 4150 additions and 212 deletions
+40 -13
View File
@@ -456,7 +456,11 @@ pub fn workspace_open(
#[tauri::command]
pub fn workspace_list(window: tauri::Window, state: State<WorkspaceState>, rel: String) -> WsResult<Vec<TreeEntry>> {
let root = current_root(&state, window.label())?;
let dir = resolve_existing(&root, &rel)?;
list_entries(&root, &rel)
}
fn list_entries(root: &Path, rel: &str) -> WsResult<Vec<TreeEntry>> {
let dir = resolve_existing(root, rel)?;
if !dir.is_dir() {
return Err(err("path is not a folder"));
}
@@ -464,12 +468,7 @@ pub fn workspace_list(window: tauri::Window, state: State<WorkspaceState>, rel:
let mut entries = Vec::new();
let walker = ignore::WalkBuilder::new(&dir)
.max_depth(Some(1))
.hidden(false)
.git_ignore(true)
.require_git(false)
.git_global(true)
.git_exclude(true)
.parents(true)
.standard_filters(false)
.build();
for result in walker {
@@ -788,17 +787,18 @@ pub struct SearchHit {
#[tauri::command]
pub fn workspace_search(window: tauri::Window, state: State<WorkspaceState>, query: String) -> WsResult<Vec<SearchHit>> {
let root = current_root(&state, window.label())?;
search_entries(&root, &query)
}
fn search_entries(root: &Path, query: &str) -> WsResult<Vec<SearchHit>> {
let needle = query.trim().to_lowercase();
if needle.is_empty() {
return Ok(Vec::new());
}
let root = current_root(&state, window.label())?;
let mut hits = Vec::new();
let walker = ignore::WalkBuilder::new(&root)
.hidden(false)
.git_ignore(true)
.require_git(false)
.git_global(true)
let walker = ignore::WalkBuilder::new(root)
.standard_filters(false)
.filter_entry(|entry| {
entry.depth() == 0 || !is_internal_name(&entry.file_name().to_string_lossy())
})
@@ -887,6 +887,33 @@ mod tests {
use super::*;
use std::path::PathBuf;
#[test]
fn ignore_files_do_not_hide_workspace_entries_or_search_results() {
let fixture = std::env::temp_dir().join(format!("rs-ignore-rules-{}", std::process::id()));
let root = fixture.join("workspace");
fs::create_dir_all(root.join(".git/info")).unwrap();
fs::write(fixture.join(".ignore"), "parent-excluded/\n").unwrap();
fs::write(root.join(".gitignore"), "papers/\n").unwrap();
fs::write(root.join(".ignore"), "local-excluded/\n").unwrap();
fs::write(root.join(".git/info/exclude"), "git-excluded/\n").unwrap();
for folder in ["papers", "local-excluded", "git-excluded", "parent-excluded", ".hidden-notes"] {
fs::create_dir_all(root.join(folder)).unwrap();
fs::write(root.join(folder).join("note.md"), "unique search phrase").unwrap();
}
fs::write(root.join("papers/.gitignore"), "note.md\n").unwrap();
let root = dunce::canonicalize(root).unwrap();
let entries = list_entries(&root, "").unwrap();
let hits = search_entries(&root, "unique search phrase").unwrap();
for folder in ["papers", "local-excluded", "git-excluded", "parent-excluded", ".hidden-notes"] {
assert!(entries.iter().any(|entry| entry.rel_path == folder && entry.kind == "folder"), "{folder}");
let note = format!("{folder}/note.md");
assert!(list_entries(&root, folder).unwrap().iter().any(|entry| entry.rel_path == note), "{note}");
assert!(hits.iter().any(|hit| hit.rel_path == note && hit.line == 1), "{note}");
}
assert!(!entries.iter().any(|entry| entry.name == ".git"));
fs::remove_dir_all(fixture).unwrap();
}
#[test]
fn windows_keep_independent_roots_and_cleanup() {
let state = WorkspaceState::new();