Fix API directory listing: build paths relative to request, not workspace

This commit is contained in:
Echo
2026-02-09 10:40:42 +00:00
parent f896cef01c
commit e47f2179ea

View File

@@ -707,12 +707,14 @@ class TaskBoardHandler(SimpleHTTPRequestHandler):
try:
for item in sorted(target.iterdir()):
stat = item.stat()
# Build relative path from original request path
item_path = f"{path}/{item.name}" if path else item.name
items.append({
'name': item.name,
'type': 'dir' if item.is_dir() else 'file',
'size': stat.st_size if item.is_file() else None,
'mtime': stat.st_mtime,
'path': str(item.relative_to(workspace))
'path': item_path
})
self.send_json({
'type': 'dir',