From 2c33eb2e47940b6342222475a9410da698453d60 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 23 Aug 2023 20:02:55 +0200 Subject: [PATCH] feat(FilePicker): Always show file extension as a trailing text part Signed-off-by: Ferdinand Thiessen --- lib/components/FilePicker/FileListRow.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/components/FilePicker/FileListRow.vue b/lib/components/FilePicker/FileListRow.vue index f99f912f..3655402d 100644 --- a/lib/components/FilePicker/FileListRow.vue +++ b/lib/components/FilePicker/FileListRow.vue @@ -12,6 +12,7 @@
+
@@ -47,9 +48,14 @@ const emit = defineEmits<{ }>() /** - * The displayname of the current node + * The displayname of the current node (excluding file extension) */ -const displayName = computed(() => props.node.attributes?.displayname || props.node.basename) +const displayName = computed(() => props.node.attributes?.displayName || props.node.basename.slice(0, props.node.extension ? -props.node.extension.length : undefined)) + +/** + * The file extension of the file + */ +const fileExtension = computed(() => props.node.extension) /** * If this node can be picked, basically just check if picking a directory is allowed @@ -116,5 +122,10 @@ function handleKeyDown(event: KeyboardEvent) { overflow: hidden; text-overflow: ellipsis; } + + &__file-extension { + color: var(--color-text-maxcontrast); + min-width: fit-content; + } }