Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

style(links): update link preview styling (#1158)

Aidan Holloway-Bidwell23e2ecc5733a
diff --git a/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx b/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx
index d448b990ec..86fc05563d 100644
--- a/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx
+++ b/js/app/packages/core/component/LexicalMarkdown/component/core/LinkWithPreview.tsx
@@ -42,11 +42,11 @@ export function LinkWithPreview(props: UnfurlLinkProps) {
<Show when={previewOpen()}>
<ScopedPortal>
<div
- class="p-1 absolute top-full left-0 z-10 bg-menu w-80 shadow-lg ring-edge ring-1 mt-2"
+ class="absolute bg-panel rounded-xs ring ring-edge-muted border-edge left-0 z-10 shadow-lg max-w-72"
style={{
transform: 'translateY(0)',
}}
- use:floatWithElement={{ element: () => linkRef }}
+ use:floatWithElement={{ element: () => linkRef, spacing: 4 }}
>
{(() => {
const data = unfurlData();
diff --git a/js/app/packages/core/component/Link.tsx b/js/app/packages/core/component/Link.tsx
index 6952f47c2c..9af47057b3 100644
--- a/js/app/packages/core/component/Link.tsx
+++ b/js/app/packages/core/component/Link.tsx
@@ -21,30 +21,28 @@ export type UnfurlLinkProps = { unfurled: GetUnfurlResponse };
export function UnfurlLink(props: UnfurlLinkProps) {
const domain = extractDomain(props.unfurled.url);
- let icoRef: HTMLImageElement | undefined;
return (
<div
- class="hover:bg-hover p-1 px-2 overflow-clip text-sm transition-colors hover:transition-none"
+ class="hover:bg-hover p-1 px-1.5 overflow-clip text-xs transition-colors hover:transition-none cursor-pointer"
onClick={() => window.open(props.unfurled.url)}
>
- <div class="flex flex-row items-center gap-2 w-full h-full">
+ <div class="flex flex-row items-center gap-1.5 w-full h-full">
<div class="shrink-0">
<Show
when={props.unfurled.favicon_url}
- fallback={<LinkIcon class="w-6 h-6" />}
+ fallback={<LinkIcon class="w-4 h-4" />}
>
{(icon) => (
<Show
when={!badLinks[icon()]}
- fallback={<LinkIcon class="w-6 h-6" />}
+ fallback={<LinkIcon class="w-4 h-4" />}
>
<img
src={proxyResource(icon())}
- class="content-center rounded-sm w-6 h-6 object-cover"
+ class="content-center rounded-sm w-4 h-4 object-cover"
crossorigin="anonymous"
alt="ico"
- ref={icoRef}
on:error={() => {
setBadLinks(icon(), true);
}}
@@ -53,9 +51,11 @@ export function UnfurlLink(props: UnfurlLinkProps) {
)}
</Show>
</div>
- <div>
- <h1 class="font-medium text-ink truncate">{props.unfurled.title}</h1>
- <h2 class="font-medium text-ink-muted text-xs">{domain}</h2>
+ <div class="min-w-0">
+ <h1 class={`font-medium truncate text-ink`}>
+ {props.unfurled.title || domain}
+ </h1>
+ <h2 class="font-medium text-xxs text-ink-muted">{domain}</h2>
</div>
</div>
</div>