cheogram-www

created pr with cheogram-www/link-previews.1 on 2026-11-26T21:42:19Z · by 3c31bc8c
commented on 2026-11-26T21:42:20Z · by 3c31bc8c
Changes are available at https://tangled.org/mrry.band/cheogram-www link-previews
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-www:link-previews | git am -3
checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-www:link-previews [rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-www:link-previews
add comment to patch request:
ssh pr.pico.sh comment cheogram-www:link-previews "lgtm!"

Patchset cheogram-www/link-previews.1 on 2026-11-26T21:42:19Z · commit 693092c

Fix some more link styling
Eric Roberts 2026-11-26T20:01:45Z
Link previews looked bad on dark mode because of a hover that turned the
text black. I took the opportunity to give them a quick refresh as well,
and updated their styling to be a bit more like our link styling.

I expanded the link styling to pretty much every anchor tag, just
excluding a couple that shouldn't have those styles.

Included a small fix for inline code blurbs in dark mode. Forgive me for
this sin.
Diff stat
src/App.scss | 94 ++++++++++++++++++++----------
2 files changed, 71 insertions(+), 33 deletions(-)
Semantic diff summary
0 added, 0 modified, 0 signature changed, 0 removed across 1 analyzed file (1 file skipped: unsupported file type)
+64 -30 src/App.scss #
......@@ -196,6 +196,11 @@ $main-container-sidebar-right-max-width: 22em;
196196 .ql-editor.ql-blank::before {
197197 color: var(--color-text-disabled);
198198 }
199+
200+ .ql-editor code {
201+ background-color: var(--paper-background);
202+ color: var(--color-text);
203+ }
199204 }
200205 }
201206
......@@ -568,17 +573,9 @@ li.MuiListSubheader-root {
568573 margin-top: 1em;
569574 }
570575
571- a:link,
572- a:visited {
576+ a {
573577 display: block;
574- color: var(--color-secondary-dark);
575578 margin-top: 1em;
576- text-decoration: none;
577- }
578-
579- a:active,
580- a:hover {
581- text-decoration: underline;
582579 }
583580 }
584581 }
......@@ -1104,33 +1101,70 @@ div.cs-message__content {
11041101 }
11051102
11061103 ~ .h-item {
1107- display: block;
1104+ display: flex;
1105+ align-items: flex-start;
1106+ gap: 0.75em;
1107+ width: fit-content;
1108+ max-width: 100%;
1109+ box-sizing: border-box;
11081110 text-decoration: none;
11091111 color: var(--color-text);
1110- background: var(--color-bg-focus);
1112+ background: color-mix(
1113+ in srgb,
1114+ var(--theme-primary) 8%,
1115+ var(--surface-base)
1116+ );
1117+ border: 1px solid
1118+ color-mix(in srgb, var(--theme-primary) 30%, var(--surface-base));
11111119 border-radius: $default-border-radius;
1112- margin: 1em;
1113- padding: 1.5em;
1120+ margin: 0.65em 0;
1121+ padding: 0.75em;
1122+
1123+ &:hover,
1124+ &:focus-visible {
1125+ border-color: var(--color-primary-dark);
1126+ }
1127+
1128+ &:focus-visible {
1129+ outline: 2px solid var(--color-primary-dark);
1130+ outline-offset: 2px;
1131+ }
11141132
11151133 .u-photo {
1116- display: block;
1117- margin: auto;
1118- margin-bottom: 0.5em;
1134+ flex-shrink: 0;
1135+ width: min(14em, 40%);
11191136 max-height: 10em;
1120- max-width: 80vw;
1137+ object-fit: contain;
1138+ object-position: top;
11211139 border-radius: $default-border-radius;
11221140 }
11231141
1142+ .link-preview-text {
1143+ align-self: center;
1144+ display: grid;
1145+ gap: 0.25em;
1146+ min-width: 0;
1147+ overflow-wrap: anywhere;
1148+ }
1149+
11241150 .p-name {
1125- font-weight: bold;
1151+ font-weight: 600;
1152+ justify-self: start;
1153+ max-width: 100%;
11261154 }
11271155
11281156 .u-url {
1129- text-decoration: underline;
1130- font-size: 0.9em;
1157+ overflow: hidden;
1158+ text-overflow: ellipsis;
1159+ white-space: nowrap;
1160+ font-size: 0.8em;
11311161 }
11321162
11331163 .p-summary {
1164+ display: -webkit-box;
1165+ -webkit-box-orient: vertical;
1166+ -webkit-line-clamp: 3;
1167+ overflow: hidden;
11341168 font-size: 0.9em;
11351169 }
11361170 }
......@@ -1765,10 +1799,10 @@ img.thread {
17651799 }
17661800 }
17671801
1768-.cs-conversation-header__content .pinned a,
1769-#welcome-box a,
1770-.chat-composer .ql-editor a,
1771-section.cs-message .cs-message__custom-content a {
1802+$text-link: "a[href]:not(:where(.h-item, #account-nav a))";
1803+
1804+#{$text-link},
1805+a.h-item .p-name {
17721806 color: var(--chat-link-color, var(--theme-chat-link));
17731807 text-decoration: underline;
17741808 text-decoration-thickness: 1px;
......@@ -1787,13 +1821,13 @@ section.cs-message .cs-message__custom-content a {
17871821 -webkit-box-decoration-break: clone;
17881822 box-decoration-break: clone;
17891823 transition: background-size 250ms ease;
1824+}
17901825
1791- &:hover,
1792- &:focus-visible {
1793- color: var(--color-on-secondary);
1794- text-decoration-color: transparent;
1795- background-size: 100% 100%;
1796- }
1826+#{$text-link}:is(:hover, :focus-visible),
1827+a.h-item:is(:hover, :focus-visible) .p-name {
1828+ color: var(--color-on-secondary);
1829+ text-decoration-color: transparent;
1830+ background-size: 100% 100%;
17971831 }
17981832
17991833 section.cs-message {
+7 -3 src/components/MessageBubble.tsx #
......@@ -70,9 +70,13 @@ const linkMeta = (meta: borogove.LinkMetadata) => {
7070 title={"Description of " + meta.about}
7171 >
7272 {image && <img className="u-photo" src={image} alt="Image of link" />}
73- {meta.title && <div className="p-name">{meta.title}</div>}
74- <div className="u-url">{meta.url}</div>
75- {meta.description && <div className="p-summary">{meta.description}</div>}
73+ <div className="link-preview-text">
74+ {meta.title && <div className="p-name">{meta.title}</div>}
75+ <div className="u-url">{meta.url}</div>
76+ {meta.description && (
77+ <div className="p-summary">{meta.description}</div>
78+ )}
79+ </div>
7680 </a>
7781 );
7882 };
Back to top