Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

fix(ui): show link URL below title in link preview card

Deepender25a034513e15cb
diff --git a/src/components/LinkPreviewCard.tsx b/src/components/LinkPreviewCard.tsx
index 4665b00..4b26400 100644
--- a/src/components/LinkPreviewCard.tsx
+++ b/src/components/LinkPreviewCard.tsx
@@ -19,8 +19,17 @@ export const LinkPreviewCard: React.FC<LinkPreviewCardProps> = ({
// Top: Link SVG + Domain (e.g. 🔗 github.com)
const domain = info.domain || 'link'
- // Main: Clean, human-readable link target or title
- const displayTitle = info.title || info.cleanUrl.replace(/^https?:\/\//, '')
+ // Clean URL without protocol (e.g. linkedin.com/in/gaurav-jha-hr)
+ const displayUrl = info.cleanUrl.replace(/^https?:\/\//, '')
+
+ // Main: Clean, human-readable title if distinct from domain and URL
+ const rawTitle = info.title?.trim()
+ const hasDistinctTitle = Boolean(
+ rawTitle &&
+ rawTitle.toLowerCase() !== displayUrl.toLowerCase() &&
+ rawTitle.toLowerCase() !== domain.toLowerCase()
+ )
+ const displayTitle = hasDistinctTitle ? rawTitle : displayUrl
return (
<div
@@ -35,6 +44,12 @@ export const LinkPreviewCard: React.FC<LinkPreviewCardProps> = ({
<div className="link-card-body" title={info.cleanUrl}>
{displayTitle}
</div>
+
+ {hasDistinctTitle && (
+ <div className="link-card-url" title={info.cleanUrl}>
+ {displayUrl}
+ </div>
+ )}
</div>
)
}
diff --git a/src/styles/item.css b/src/styles/item.css
index f0beb3c..08c398f 100644
--- a/src/styles/item.css
+++ b/src/styles/item.css
@@ -219,7 +219,7 @@
.link-card {
display: flex;
flex-direction: column;
- gap: 5px;
+ gap: 4px;
width: 100%;
min-width: 0;
user-select: none;
@@ -243,6 +243,7 @@
.link-card-icon {
color: rgba(255, 255, 255, 0.55);
flex-shrink: 0;
+ transition: color 0.15s ease;
}
.link-card-domain {
@@ -251,6 +252,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
+ transition: color 0.15s ease;
}
.link-card-body {
@@ -267,12 +269,45 @@
letter-spacing: 0;
}
+.link-card-url {
+ font-family: var(--font-ui);
+ font-size: calc(11.5px * var(--font-scale, 1));
+ font-weight: 400;
+ color: rgba(255, 255, 255, 0.42);
+ line-height: 1.35;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ letter-spacing: 0.01em;
+ min-width: 0;
+ transition: color 0.15s ease;
+}
+
+.link-card.compact {
+ gap: 3px;
+}
+
+.link-card.compact .link-card-body {
+ font-size: calc(12.5px * var(--font-scale, 1));
+ -webkit-line-clamp: 1;
+}
+
+.link-card.compact .link-card-url {
+ font-size: calc(10.5px * var(--font-scale, 1));
+}
+
+.item:hover .link-card-icon,
.item-main:hover .link-card-icon {
color: rgba(255, 255, 255, 0.8);
}
+.item:hover .link-card-domain,
.item-main:hover .link-card-domain {
color: rgba(255, 255, 255, 0.72);
}
+.item:hover .link-card-url,
+.item-main:hover .link-card-url {
+ color: rgba(255, 255, 255, 0.68);
+}
/* Image thumbnails */
.thumb {