feat(MediaManager): improve URL display handling with LTR embedding for better BiDi support

This commit is contained in:
Jaime Idolpx 2026-06-12 05:22:58 -04:00
parent 507be5eeab
commit e6dabbe0a6

View File

@ -1300,15 +1300,20 @@ export default function MediaManager({ initialPath, rootPath, title, config, set
<HardDrive className={`w-5 h-5 flex-shrink-0 ${dev.enabled ? 'text-blue-500' : 'text-neutral-400'}`} />
<div className="min-w-0 flex-1">
<div className="font-medium text-sm">Device #{dev.key}</div>
{(dev.base_url || dev.url) && (
{(dev.base_url || dev.url) && (() => {
const displayUrl = [dev.base_url, dev.url]
.filter(Boolean).join('');
return (
<div
className="text-xs text-neutral-500 overflow-hidden whitespace-nowrap"
style={{ direction: 'rtl', textOverflow: 'ellipsis' }}
title={[dev.base_url, dev.url].filter(Boolean).join('').replace(/\/$/, '')}
title={displayUrl}
>
{[dev.base_url, dev.url].filter(Boolean).join('').replace(/\/$/, '')}
{/* LTR embed prevents BiDi from reordering the leading '/' to the visual right */}
<span style={{ direction: 'ltr', unicodeBidi: 'embed' }}>{displayUrl}</span>
</div>
)}
);
})()}
</div>
{!dev.enabled && <span className="text-xs text-neutral-400 flex-shrink-0">disabled</span>}
</button>