ux: admin/shared: remove special visualization for items named the same name as their source, to avoid user confusion
Massimo Melina committed
Sep 28, 2025 at 20:05 UTC
54579ccb7b62ca79f0b63e5fa4fad0cb913aa116
1 file changed
+8
-15
admin/src/VfsTree.ts
+8
-15
@@ -62,11 +62,13 @@ export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, Vf
62
},
63
h(Box, { display: 'flex', flex: 0, },
64
vfsNodeIcon(node),
65
- // attributes
66
- h(Box, { sx: {
67
- flex: 0, ml: '2px', my: '2px', '&>*': { fontSize: '87%', opacity: .6, mt: '-2px' },
68
- display: 'grid', gridAutoFlow: 'column', gridTemplateRows: 'auto auto', height: '1em',
69
- } },
65
+ // attributes, as icons
66
+ h(Box, {
67
+ sx: {
68
+ flex: 0, ml: '2px', my: '2px', '&>*': { fontSize: '87%', opacity: .6, mt: '-2px' },
69
+ display: 'grid', gridAutoFlow: 'column', gridTemplateRows: 'auto auto', height: '1em',
70
+ }
71
+ },
72
node.can_delete !== undefined && iconTooltip(Delete, "Delete permission"),
73
node.can_upload !== undefined && iconTooltip(Upload, "Upload permission"),
74
!isRoot && !node.source && !node.url && iconTooltip(Cloud, "Virtual (no source)"),
@@ -79,16 +81,7 @@ export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, Vf
81
host && iconTooltip(Home, `home for ${host}`))
82
),
83
),
82
- isRoot ? "Home folder" : (() => { // special rendering if the whole source is not too long, and the name was not customized
83
- const ps = node.parent?.source
84
- const { source } = node
85
- const rel = ps && source?.startsWith(ps) && source > ps ? '.' + source.slice(ps.length) : source
86
- return !rel || !source?.endsWith(name) || rel.length > 45 ? name
87
- : h('span', {},
88
- h('span', { style: { opacity: .4, fontSize: 'small' } }, rel.slice(0,-name.length)),
89
- rel.slice(-name.length),
90
- )
91
- })()
84
+ isRoot ? "Home folder" : name
85
),
86
collapseIcon: h(ExpandMore, { onClick: toggle }),
87
expandIcon: h(ChevronRight, { onClick: toggle }),