Skip to content

Commit ac99c35

Browse files
committed
Show full file path in recent preview hover tooltip and fix truncation
- Add right padding to recent-file-item so close button doesn't overlap long filenames - Show full file path in the hover tooltip alongside title, modified time, and digest
1 parent 9befaed commit ac99c35

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

crates/markdown_preview_core/js/styles.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
}
261261

262262
.recent-file-item {
263-
padding: 6px 8px;
263+
padding: 6px 24px 6px 8px;
264264
margin: 4px 0;
265265
background: #ffffff;
266266
border: 1px solid #d0d7de;
@@ -431,6 +431,13 @@
431431
border-radius: 4px;
432432
}
433433

434+
.path-tooltip-path {
435+
font-size: 11px;
436+
color: #57606a;
437+
word-break: break-all;
438+
margin-top: 4px;
439+
}
440+
434441
.path-tooltip-modified {
435442
margin-top: 6px;
436443
padding-top: 6px;

crates/markdown_preview_core/js/themes.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
color: #7ee787;
8585
background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
8686
}
87+
body.theme-dark .path-tooltip-path {
88+
color: rgba(255, 255, 255, .5);
89+
}
8790
body.theme-dark .path-tooltip-modified {
8891
color: rgba(255, 255, 255, .4);
8992
border-top-color: #363839;
@@ -261,6 +264,9 @@
261264
color: #fff;
262265
background: linear-gradient(135deg, #f48237 0%, #ff9f43 100%);
263266
}
267+
body.theme-material-dark .path-tooltip-path {
268+
color: rgba(255, 255, 255, .5);
269+
}
264270
body.theme-material-dark .path-tooltip-modified {
265271
color: rgba(255, 255, 255, .4);
266272
border-top-color: #4f585e;
@@ -435,6 +441,9 @@
435441
color: #fff;
436442
background: linear-gradient(135deg, #528bff 0%, #61afef 100%);
437443
}
444+
body.theme-one-dark .path-tooltip-path {
445+
color: #7f848e;
446+
}
438447
body.theme-one-dark .path-tooltip-modified {
439448
color: #5c6370;
440449
border-top-color: #3a3f4b;
@@ -774,6 +783,9 @@
774783
color: #7ee787;
775784
background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
776785
}
786+
body.theme-github-dark .path-tooltip-path {
787+
color: #8b949e;
788+
}
777789
body.theme-github-dark .path-tooltip-modified {
778790
color: #6e7781;
779791
border-top-color: #30363d;

crates/markdown_preview_core/js/tooltips.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ function showPathTooltip(element, fullPath, previewInfo = {}) {
5757

5858
const { title, digest, modified_at } = previewInfo;
5959

60-
// Build tooltip content with optional title
60+
// Build tooltip content
6161
let html = '';
6262
if (title) {
6363
// Render backtick-wrapped text as inline code
6464
const rendered = renderInlineCode(title);
6565
html += `<div class="path-tooltip-title">${rendered}</div>`;
6666
}
67+
html += `<div class="path-tooltip-path">${escapeHtml(fullPath)}</div>`;
6768

6869
// Add modification time if available
6970
if (modified_at) {

0 commit comments

Comments
 (0)