feat(MediaManager): improve URL display handling with LTR embedding for better BiDi support
This commit is contained in:
parent
507be5eeab
commit
e6dabbe0a6
|
|
@ -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) && (
|
||||
<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(/\/$/, '')}
|
||||
>
|
||||
{[dev.base_url, dev.url].filter(Boolean).join('').replace(/\/$/, '')}
|
||||
</div>
|
||||
)}
|
||||
{(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={displayUrl}
|
||||
>
|
||||
{/* 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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user