fix(ui): truncate right panel paths from start
Use RTL ellipsis with bidi isolation so long paths keep the filename visible.
This commit is contained in:
@@ -144,7 +144,7 @@ const ChangesTab: Component<ChangesTabProps> = (props) => {
|
|||||||
>
|
>
|
||||||
<div class="file-list-item-content">
|
<div class="file-list-item-content">
|
||||||
<div class="file-list-item-path" title={item.file}>
|
<div class="file-list-item-path" title={item.file}>
|
||||||
{item.file}
|
<span class="file-path-text">{item.file}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-list-item-stats">
|
<div class="file-list-item-stats">
|
||||||
<span class="file-list-item-additions">+{item.additions}</span>
|
<span class="file-list-item-additions">+{item.additions}</span>
|
||||||
@@ -170,7 +170,7 @@ const ChangesTab: Component<ChangesTabProps> = (props) => {
|
|||||||
>
|
>
|
||||||
<div class="file-list-item-content">
|
<div class="file-list-item-content">
|
||||||
<div class="file-list-item-path" title={item.file}>
|
<div class="file-list-item-path" title={item.file}>
|
||||||
{item.file}
|
<span class="file-path-text">{item.file}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-list-item-stats">
|
<div class="file-list-item-stats">
|
||||||
<span class="file-list-item-additions">+{item.additions}</span>
|
<span class="file-list-item-additions">+{item.additions}</span>
|
||||||
@@ -190,7 +190,7 @@ const ChangesTab: Component<ChangesTabProps> = (props) => {
|
|||||||
header={
|
header={
|
||||||
<>
|
<>
|
||||||
<span class="files-tab-selected-path" title={headerPath()}>
|
<span class="files-tab-selected-path" title={headerPath()}>
|
||||||
{headerPath()}
|
<span class="file-path-text">{headerPath()}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="files-tab-stats" style={{ flex: "0 0 auto" }}>
|
<div class="files-tab-stats" style={{ flex: "0 0 auto" }}>
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ const FilesTab: Component<FilesTabProps> = (props) => {
|
|||||||
<div class="file-list-item" onClick={() => props.onLoadEntries(p())}>
|
<div class="file-list-item" onClick={() => props.onLoadEntries(p())}>
|
||||||
<div class="file-list-item-content">
|
<div class="file-list-item-content">
|
||||||
<div class="file-list-item-path" title={p()}>
|
<div class="file-list-item-path" title={p()}>
|
||||||
..
|
<span class="file-path-text">..</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -131,7 +131,7 @@ const FilesTab: Component<FilesTabProps> = (props) => {
|
|||||||
>
|
>
|
||||||
<div class="file-list-item-content">
|
<div class="file-list-item-content">
|
||||||
<div class="file-list-item-path" title={item.path}>
|
<div class="file-list-item-path" title={item.path}>
|
||||||
{item.name}
|
<span class="file-path-text">{item.name}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-list-item-stats">
|
<div class="file-list-item-stats">
|
||||||
<span class="text-[10px] text-secondary">{item.type}</span>
|
<span class="text-[10px] text-secondary">{item.type}</span>
|
||||||
@@ -150,7 +150,7 @@ const FilesTab: Component<FilesTabProps> = (props) => {
|
|||||||
<div class="files-tab-stats">
|
<div class="files-tab-stats">
|
||||||
<span class="files-tab-stat">
|
<span class="files-tab-stat">
|
||||||
<span class="files-tab-selected-path" title={headerDisplayedPath()}>
|
<span class="files-tab-selected-path" title={headerDisplayedPath()}>
|
||||||
{headerDisplayedPath()}
|
<span class="file-path-text">{headerDisplayedPath()}</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<Show when={props.browserLoading()}>
|
<Show when={props.browserLoading()}>
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ const GitChangesTab: Component<GitChangesTabProps> = (props) => {
|
|||||||
>
|
>
|
||||||
<div class="file-list-item-content">
|
<div class="file-list-item-content">
|
||||||
<div class="file-list-item-path" title={item.path}>
|
<div class="file-list-item-path" title={item.path}>
|
||||||
{item.path}
|
<span class="file-path-text">{item.path}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-list-item-stats">
|
<div class="file-list-item-stats">
|
||||||
<Show when={item.status === "deleted"}>
|
<Show when={item.status === "deleted"}>
|
||||||
@@ -188,7 +188,7 @@ const GitChangesTab: Component<GitChangesTabProps> = (props) => {
|
|||||||
>
|
>
|
||||||
<div class="file-list-item-content">
|
<div class="file-list-item-content">
|
||||||
<div class="file-list-item-path" title={item.path}>
|
<div class="file-list-item-path" title={item.path}>
|
||||||
{item.path}
|
<span class="file-path-text">{item.path}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="file-list-item-stats">
|
<div class="file-list-item-stats">
|
||||||
<Show when={item.status === "deleted"}>
|
<Show when={item.status === "deleted"}>
|
||||||
@@ -213,7 +213,7 @@ const GitChangesTab: Component<GitChangesTabProps> = (props) => {
|
|||||||
header={
|
header={
|
||||||
<>
|
<>
|
||||||
<span class="files-tab-selected-path" title={selectedEntry?.path || "Git Changes"}>
|
<span class="files-tab-selected-path" title={selectedEntry?.path || "Git Changes"}>
|
||||||
{selectedEntry?.path || "Git Changes"}
|
<span class="file-path-text">{selectedEntry?.path || "Git Changes"}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<div class="files-tab-stats" style={{ flex: "0 0 auto" }}>
|
<div class="files-tab-stats" style={{ flex: "0 0 auto" }}>
|
||||||
|
|||||||
@@ -164,9 +164,15 @@
|
|||||||
@apply text-xs font-mono min-w-0 flex-1 overflow-hidden whitespace-nowrap;
|
@apply text-xs font-mono min-w-0 flex-1 overflow-hidden whitespace-nowrap;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
/* Truncate from the start; keep filename visible. */
|
||||||
direction: rtl;
|
direction: rtl;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
unicode-bidi: plaintext;
|
unicode-bidi: isolate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.files-tab-selected-path .file-path-text {
|
||||||
|
direction: ltr;
|
||||||
|
unicode-bidi: isolate;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files-tab-stat {
|
.files-tab-stat {
|
||||||
@@ -240,9 +246,15 @@
|
|||||||
@apply text-xs font-mono min-w-0 flex-1 overflow-hidden whitespace-nowrap;
|
@apply text-xs font-mono min-w-0 flex-1 overflow-hidden whitespace-nowrap;
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
/* Truncate from the start; keep filename visible. */
|
||||||
direction: rtl;
|
direction: rtl;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
unicode-bidi: plaintext;
|
unicode-bidi: isolate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-list-item-path .file-path-text {
|
||||||
|
direction: ltr;
|
||||||
|
unicode-bidi: isolate;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-list-item-stats {
|
.file-list-item-stats {
|
||||||
|
|||||||
Reference in New Issue
Block a user