Fix default columns sizes so table doesn't jump around whilst scrolling, skip .DS_Store files in tree
All checks were successful
build / build (push) Successful in 1m16s

This commit is contained in:
2025-05-21 08:29:00 +09:30
parent 95855b9e99
commit fb797f980e
2 changed files with 24 additions and 10 deletions

View File

@@ -12,6 +12,8 @@ import { Tree, TreeNodeSelectEvent } from 'primeng/tree';
const collator = new Intl.Collator(undefined, { numeric: true }); const collator = new Intl.Collator(undefined, { numeric: true });
const SKIP_FILES = '.DS_Store';
@Component({ @Component({
selector: 'app-file-tree', selector: 'app-file-tree',
imports: [ButtonModule, Tree], imports: [ButtonModule, Tree],
@@ -78,12 +80,15 @@ export class FileTreeComponent {
} }
currentChildren = matchingChild.children; currentChildren = matchingChild.children;
} }
if (!SKIP_FILES.includes(file.name)) {
currentChildren?.push({ currentChildren?.push({
key: file.name, key: file.name,
label: file.name, label: file.name,
data: file, data: file,
}); });
}
} else { } else {
if (!SKIP_FILES.includes(file.name)) {
mappedFiles.push({ mappedFiles.push({
label: file.name, label: file.name,
key: file.webkitRelativePath, key: file.webkitRelativePath,
@@ -91,6 +96,7 @@ export class FileTreeComponent {
}); });
} }
} }
}
this.recursiveSort(mappedFiles); this.recursiveSort(mappedFiles);
this.files.set(mappedFiles); this.files.set(mappedFiles);
this.isFileSelected.set(true); this.isFileSelected.set(true);

View File

@@ -2,3 +2,11 @@
display: block; display: block;
height: 100%; height: 100%;
} }
/* Default column widths */
th,
td {
width: 200px;
max-width: 200px;
min-width: 200px;
}