fix wrong ui

This commit is contained in:
2026-06-28 02:23:30 +02:00
parent d3d52a5432
commit a15d6c0b2c
2 changed files with 67 additions and 2 deletions
+18
View File
@@ -1206,6 +1206,24 @@
.resolve-path { overflow: hidden; color: var(--color-ink-faint); font-family: var(--font-mono); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
}
/* Custom tooltip — appended to body, not clipped by overflow:hidden parents */
.path-tooltip {
position: fixed;
z-index: 300;
max-width: 480px;
padding: 5px 10px;
border: 1px solid var(--color-border);
border-radius: 6px;
background: var(--color-surface-raised);
color: var(--color-ink-muted);
font-family: var(--font-mono);
font-size: 12px;
white-space: pre-wrap;
word-break: break-all;
pointer-events: none;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
@keyframes spin { to { transform: rotate(360deg); } }
/* --- Responsive breakpoints --- */
+49 -2
View File
@@ -27,13 +27,60 @@
if (Number.isNaN(date.getTime())) return value;
return new Intl.DateTimeFormat(undefined, { dateStyle: "medium", timeStyle: "short" }).format(date);
}
function fileName(path: string): string {
return path.split("/").pop() ?? path;
}
function pathTooltip(node: HTMLElement, text: string) {
let el: HTMLDivElement | null = null;
function show(e: MouseEvent) {
if (!text || !text.includes("/")) return;
el = document.createElement("div");
el.className = "path-tooltip";
el.textContent = text;
document.body.appendChild(el);
move(e);
}
function move(e: MouseEvent) {
if (!el) return;
const tw = el.offsetWidth;
const left = Math.max(8, Math.min(e.clientX - tw / 2, window.innerWidth - tw - 8));
el.style.left = `${left}px`;
el.style.top = `${e.clientY - 44}px`;
}
function hide() {
el?.remove();
el = null;
}
node.addEventListener("mouseenter", show);
node.addEventListener("mousemove", move);
node.addEventListener("mouseleave", hide);
return {
update(v: string) { text = v; },
destroy() {
hide();
node.removeEventListener("mouseenter", show);
node.removeEventListener("mousemove", move);
node.removeEventListener("mouseleave", hide);
},
};
}
</script>
<section class="panel grid grid-rows-[auto_1fr] overflow-hidden" aria-label="Selected file history">
<div class="section-head">
<div class="min-w-0">
<div class="min-w-0 flex-1 overflow-hidden">
<span class="eyebrow">{selectedExplorerLabel}</span>
<h2 class="mt-0.5 text-ink text-base font-bold leading-tight truncate">{selectedExplorerPath || "No file"}</h2>
<h2
class="mt-0.5 text-ink text-base font-bold leading-tight truncate"
use:pathTooltip={selectedExplorerPath}
>{selectedExplorerPath ? fileName(selectedExplorerPath) : "No file"}</h2>
</div>
<span class="pill pill-count flex-shrink-0">{fileHistory.length}</span>
</div>