fix: import folder scans project's folder_path not current_dir

Was scanning state.current_dir which could differ from the project's
actual folder, causing no JSON files to be found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 00:26:17 +02:00
parent 735d905833
commit 9ffdf6287d
+4 -2
View File
@@ -216,8 +216,10 @@ def render_projects_tab(state: AppState):
async def _import_folder(state: AppState, project_id: int, project_name: str, refresh_fn): async def _import_folder(state: AppState, project_id: int, project_name: str, refresh_fn):
"""Bulk import all .json files from current directory into a project.""" """Bulk import all .json files from the project's folder_path into a project."""
json_files = sorted(state.current_dir.glob('*.json')) proj = state.db.get_project(project_name)
scan_dir = Path(proj['folder_path']) if proj else state.current_dir
json_files = sorted(scan_dir.glob('*.json'))
json_files = [f for f in json_files if f.name not in ( json_files = [f for f in json_files if f.name not in (
'.editor_config.json', '.editor_snippets.json')] '.editor_config.json', '.editor_snippets.json')]