diff --git a/ui/desktop/src/components/bottom_menu/DirSwitcher.tsx b/ui/desktop/src/components/bottom_menu/DirSwitcher.tsx index 32a88ba72..f269e00e5 100644 --- a/ui/desktop/src/components/bottom_menu/DirSwitcher.tsx +++ b/ui/desktop/src/components/bottom_menu/DirSwitcher.tsx @@ -43,6 +43,24 @@ const i18n = defineMessages({ }, }); +const splitDirPath = (dir: string): { name: string; parent: string } => { + const normalized = dir.replace(/[\\/]+$/, ''); + const parts = normalized.split(/[\\/]/); + const name = parts.pop() || dir; + const parent = parts.join('/'); + return { name, parent }; +}; + +const DirNameLabel: React.FC<{ dir: string }> = ({ dir }) => { + const { name, parent } = splitDirPath(dir); + return ( +