diff --git a/static/css/components/itemTooltip.css b/static/css/components/itemTooltip.css new file mode 100644 index 00000000..0c4a0efc --- /dev/null +++ b/static/css/components/itemTooltip.css @@ -0,0 +1,115 @@ +/* ── Item tooltip — "technical sheet" ─────────────────────────────────────── */ +/* */ +/* Overlays the search bar area in the top-bar while hovering a file item. */ +/* Spans from the sidebar right-edge to just before .user-controls. */ +/* */ +/* 3-column CSS grid: [icon] [label] [value] */ +/* All values start at the same x position regardless of label width. */ + +.path-tooltip { + position: fixed; + + /* Fill most of the top-bar (topbar height 70px, 8px margin top/bottom) */ + top: 8px; + + /* Desktop: starts at sidebar right edge + top-bar padding */ + left: calc(var(--sidebar-width) + 30px); + + /* + * Right edge stops just before .user-controls: + * 30px (top-bar right padding) + ~90px (notif bell + gap + avatar btn) + 4px gap + * Using left + right instead of width so the browser computes it dynamically. + */ + right: 124px; + + /* High enough to sit above the top-bar content */ + z-index: 200; + + display: grid; + grid-template-columns: 1em max-content 1fr; + column-gap: 0.6em; + row-gap: 6px; + align-items: center; + + /* Fill the top-bar height minus an 8px margin on each side */ + height: 54px; + padding: 0 16px; + border-radius: 10px; + border: 2px solid var(--color-border-medium); + + background-color: var(--color-bg-input); + color: var(--color-text-muted); + font-size: 0.75rem; + + pointer-events: none; + + /* avoid blinking when pointer moves between items */ + transition: display 0.2s allow-discrete; +} + +/* Icon column */ +.path-tooltip__icon { + color: var(--color-text-faint); + font-size: 0.7rem; + text-align: center; + justify-self: center; +} + +/* Label column */ +.path-tooltip__label { + font-weight: 600; + color: var(--color-text-secondary); + white-space: nowrap; +} + +.path-tooltip__label::after { + content: ':'; +} + +/* Value column */ +.path-tooltip__value { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + min-width: 0; +} + +/* Path value uses monospace to read folder separators clearly */ +.path-tooltip__value--path { + font-family: monospace; +} + +/* "?" placeholder when data is absent */ +.path-tooltip__value--unknown { + color: var(--color-text-faint); + font-style: italic; +} + +/* ── Narrow screens (sidebar hidden) ────────────────────────────────────── */ +/* On mobile the sidebar slides off-screen; align after the #sidebar-toggle */ +/* button (≈44px) that takes its place in the top-bar. */ + +@media (max-width: 768px) { + .path-tooltip { + /* 16px topbar padding + ~44px sidebar-toggle + 8px gap */ + left: 68px; + + /* + * Right edge stops before search-toggle-btn + user-controls: + * ~40px (search-toggle) + 12px (gap) + ~90px (user-controls) + 16px (padding) + */ + right: 158px; + } +} + +/* ── Vignette inside tooltip ─────────────────────────────────────────────── */ +/* The vignette name hard-codes 14px; scale it down to match the tooltip. */ + +.path-tooltip .user-vignette { + overflow: hidden; + min-width: 0; +} + +.path-tooltip .user-vignette__name { + font-size: 0.75rem; +} diff --git a/static/css/components/pathTooltip.css b/static/css/components/pathTooltip.css deleted file mode 100644 index 575c0ff8..00000000 --- a/static/css/components/pathTooltip.css +++ /dev/null @@ -1,25 +0,0 @@ -.path-tooltip { - position: fixed; - bottom: 8px; - left: calc(var(--sidebar-width) + 8px); - z-index: 5; - - max-width: 120ch; - padding: 4px 10px; - border-radius: 3px; - - background-color: var(--color-bg-subtle); - border: 1px solid var(--color-border-faint); - color: var(--color-text-muted); - font-size: 0.75rem; - font-family: monospace; - - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - - pointer-events: none; - - /* avoid blinking when pointer change items */ - transition: display 0.2s allow-discrete; -} diff --git a/static/css/main.css b/static/css/main.css index 83aa67a1..158ed1ee 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -30,7 +30,7 @@ @import url("./components/search.css"); @import url("./components/icons.css"); @import url("./components/csp-utilities.css"); -@import url("./components/pathTooltip.css"); +@import url("./components/itemTooltip.css"); /* Theme */ @import url("./themes/dark.css"); diff --git a/static/js/app/trashView.js b/static/js/app/trashView.js index 2b4ceb1b..91414e31 100644 --- a/static/js/app/trashView.js +++ b/static/js/app/trashView.js @@ -6,7 +6,7 @@ import { escapeHtml, formatDateTime } from '../core/formatters.js'; import { i18n } from '../core/i18n.js'; import { batchToolbar } from '../features/files/batchToolbar.js'; import { fileOps } from '../features/files/fileOperations.js'; -import * as pathTooltip from '../features/pathTooltip.js'; +import * as itemTooltip from '../features/itemTooltip.js'; import { appElements } from './state.js'; import { ui } from './ui.js'; @@ -23,7 +23,7 @@ async function loadTrashItems() { try { if (batchToolbar) batchToolbar.clear(); - pathTooltip.destroy(elements.filesList); + itemTooltip.destroy(elements.filesList); ui.resetFilesList(); // ensure also list visible & error hidden elements.filesList.innerHTML = `