Add multi-tag filtering with active tag display, optimize directory browsing performance, and improve mobile editor UI
This commit is contained in:
+10
-7
@@ -114,13 +114,16 @@ async def api_browse(vault_name: str, path: str = ""):
|
||||
continue
|
||||
rel = str(entry.relative_to(vault_root)).replace("\\", "/")
|
||||
if entry.is_dir():
|
||||
# Count all supported files recursively (skip hidden dirs)
|
||||
file_count = sum(
|
||||
1 for f in entry.rglob("*")
|
||||
if f.is_file()
|
||||
and not any(p.startswith(".") for p in f.relative_to(entry).parts)
|
||||
and (f.suffix.lower() in SUPPORTED_EXTENSIONS or f.name.lower() in ("dockerfile", "makefile"))
|
||||
)
|
||||
# Count only direct children (files and subdirs) for performance
|
||||
try:
|
||||
file_count = sum(
|
||||
1 for child in entry.iterdir()
|
||||
if not child.name.startswith(".")
|
||||
and (child.is_file() and (child.suffix.lower() in SUPPORTED_EXTENSIONS or child.name.lower() in ("dockerfile", "makefile"))
|
||||
or child.is_dir())
|
||||
)
|
||||
except PermissionError:
|
||||
file_count = 0
|
||||
items.append({
|
||||
"name": entry.name,
|
||||
"path": rel,
|
||||
|
||||
Reference in New Issue
Block a user