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 SKIP_FILES = '.DS_Store';
@Component({
selector: 'app-file-tree',
imports: [ButtonModule, Tree],
@@ -78,17 +80,21 @@ export class FileTreeComponent {
}
currentChildren = matchingChild.children;
}
currentChildren?.push({
key: file.name,
label: file.name,
data: file,
});
if (!SKIP_FILES.includes(file.name)) {
currentChildren?.push({
key: file.name,
label: file.name,
data: file,
});
}
} else {
mappedFiles.push({
label: file.name,
key: file.webkitRelativePath,
data: file,
});
if (!SKIP_FILES.includes(file.name)) {
mappedFiles.push({
label: file.name,
key: file.webkitRelativePath,
data: file,
});
}
}
}
this.recursiveSort(mappedFiles);

View File

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