feat: add per-vault reindexing with selective reload based on modified vaults, simplify hidden files whitelist logic to include all sub-hidden files when parent is whitelisted, and auto-uncheck includeHidden when adding whitelist items

This commit is contained in:
2026-03-26 15:08:01 -04:00
parent 80e2a7fc53
commit ac962bd416
4 changed files with 146 additions and 14 deletions
+14 -8
View File
@@ -5,6 +5,12 @@ from typing import Dict, Any, Tuple
def should_include_path(rel_parts: Tuple[str, ...], vault_config: Dict[str, Any]) -> bool:
"""Check if a path should be included based on hidden files configuration.
Simplified logic:
- If includeHidden=True: include ALL hidden files/folders recursively
- If includeHidden=False: check whitelist
- If a whitelisted folder is in the path, include ALL sub-hidden files/folders
- Otherwise, exclude the path
Args:
rel_parts: Tuple of path parts relative to vault root
vault_config: Vault configuration dict with includeHidden and hiddenWhitelist
@@ -23,14 +29,14 @@ def should_include_path(rel_parts: Tuple[str, ...], vault_config: Dict[str, Any]
return True
if include_hidden:
# Include all hidden files/folders
# Include all hidden files/folders recursively
return True
# Check if ALL hidden parts are in the whitelist
# If any hidden part is NOT in the whitelist, exclude the path
for hidden_part in hidden_parts:
if hidden_part not in hidden_whitelist:
return False
# Check if the FIRST hidden part is in the whitelist
# If yes, include all sub-hidden files/folders automatically
first_hidden = hidden_parts[0]
if first_hidden in hidden_whitelist:
return True
# All hidden parts are in the whitelist
return True
# First hidden part not in whitelist, exclude
return False