Skip to content

Commit 882dcac

Browse files
Adebesin-Cellautofix-ci[bot]ghostdevv
authored
fix(blog): ui improvements and comment layout fix (#2139)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Willow (GHOST) <git@willow.sh>
1 parent 1cd901f commit 882dcac

File tree

14 files changed

+82
-28
lines changed

14 files changed

+82
-28
lines changed

app/components/BlueskyComment.vue

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,27 @@ function getHostname(uri: string): string {
3838
return uri
3939
}
4040
}
41+
42+
let segmenter: Intl.Segmenter | null = null
43+
function firstChar(str: string): string {
44+
segmenter ??= new Intl.Segmenter(undefined, { granularity: 'grapheme' })
45+
return Array.from(segmenter.segment(str))[0]?.segment ?? ''
46+
}
4147
</script>
4248

4349
<template>
44-
<div :class="depth === 0 ? 'flex gap-3' : 'flex gap-3 mt-3'">
45-
<!-- Avatar -->
50+
<!--
51+
Depth 0: classic avatar-column layout (all screens)
52+
Depth 1+: Medium-style inline avatar on mobile, avatar-column on desktop
53+
-->
54+
<div :class="depth === 0 ? 'flex gap-3' : 'sm:flex sm:gap-3'">
55+
<!-- Column avatar: always shown at depth 0, desktop-only at depth 1+ -->
4656
<a
4757
:href="`https://bsky.app/profile/${comment.author.handle}`"
4858
target="_blank"
4959
rel="noopener noreferrer"
5060
class="shrink-0"
61+
:class="depth > 0 ? 'hidden sm:block' : ''"
5162
>
5263
<img
5364
v-if="comment.author.avatar"
@@ -65,22 +76,45 @@ function getHostname(uri: string): string {
6576
depth === 0 ? 'w-10 h-10' : 'w-8 h-8 text-sm',
6677
]"
6778
>
68-
{{ (comment.author.displayName || comment.author.handle).charAt(0).toUpperCase() }}
79+
{{ firstChar(comment.author.displayName || comment.author.handle).toUpperCase() }}
6980
</div>
7081
</a>
7182

7283
<div class="flex-1 min-w-0">
7384
<!-- Author info + timestamp -->
74-
<div class="flex flex-wrap items-baseline gap-x-2 gap-y-0">
85+
<div class="flex flex-wrap items-center gap-x-2 gap-y-0">
86+
<!-- Inline avatar: mobile-only for nested comments -->
87+
<a
88+
v-if="depth > 0"
89+
:href="`https://bsky.app/profile/${comment.author.handle}`"
90+
target="_blank"
91+
rel="noopener noreferrer"
92+
class="shrink-0 sm:hidden"
93+
>
94+
<img
95+
v-if="comment.author.avatar"
96+
:src="comment.author.avatar"
97+
:alt="comment.author.displayName || comment.author.handle"
98+
class="w-6 h-6 rounded-full"
99+
width="24"
100+
height="24"
101+
loading="lazy"
102+
/>
103+
<div
104+
v-else
105+
class="w-6 h-6 rounded-full bg-border flex items-center justify-center text-fg-muted text-xs"
106+
>
107+
{{ firstChar(comment.author.displayName || comment.author.handle).toUpperCase() }}
108+
</div>
109+
</a>
75110
<a
76111
:href="`https://bsky.app/profile/${comment.author.handle}`"
77112
target="_blank"
78113
rel="noopener noreferrer"
79-
class="font-medium text-fg hover:underline"
114+
:class="['font-medium text-fg hover:underline', depth > 0 ? 'text-sm' : '']"
80115
>
81116
{{ comment.author.displayName || comment.author.handle }}
82117
</a>
83-
<span class="text-fg-subtle text-sm">@{{ comment.author.handle }}</span>
84118
<span class="text-fg-subtle text-sm">·</span>
85119
<a
86120
:href="getCommentUrl(props.comment)"
@@ -93,7 +127,7 @@ function getHostname(uri: string): string {
93127
</div>
94128

95129
<!-- Comment text with rich segments -->
96-
<p class="text-fg-muted whitespace-pre-wrap">
130+
<p class="text-fg-muted whitespace-pre-wrap mt-2 mb-3">
97131
<template v-for="(segment, i) in processedSegments" :key="i">
98132
<a
99133
v-if="segment.url"
@@ -162,7 +196,7 @@ function getHostname(uri: string): string {
162196
<!-- Like/repost counts -->
163197
<div
164198
v-if="comment.likeCount > 0 || comment.repostCount > 0"
165-
class="mt-2 flex gap-4 text-sm text-fg-subtle"
199+
class="mt-1 flex gap-4 text-sm text-fg-subtle"
166200
>
167201
<span v-if="comment.likeCount > 0">
168202
{{ $t('blog.atproto.like_count', { count: comment.likeCount }, comment.likeCount) }}
@@ -174,7 +208,10 @@ function getHostname(uri: string): string {
174208

175209
<!-- Nested replies -->
176210
<template v-if="comment.replies.length > 0">
177-
<div v-if="depth < MaxDepth" class="mt-2 ps-2 border-is-2 border-border flex flex-col">
211+
<div
212+
v-if="depth < MaxDepth"
213+
class="mt-3 ps-3 border-is-2 border-border flex flex-col gap-3"
214+
>
178215
<BlueskyComment
179216
v-for="reply in comment.replies"
180217
:key="reply.uri"

app/components/global/BlogPostFederatedArticles.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const federatedArticles = computed(() => {
4141
</script>
4242

4343
<template>
44-
<aside class="px-4 sm:-mx-6 sm:px-6 sm:-my-3 sm:py-3 sm:rounded-md">
44+
<aside class="sm:-mx-6 sm:px-6 sm:-my-3 sm:py-3 sm:rounded-md">
4545
<h2 class="font-mono text-xl font-medium text-fg mt-0">
4646
{{ headline }}
4747
</h2>
@@ -55,7 +55,7 @@ const federatedArticles = computed(() => {
5555
rel="noopener noreferrer"
5656
v-for="article in federatedArticles"
5757
:key="article.url"
58-
class="grid grid-cols-[auto_1fr] gap-x-5 no-underline hover:no-underline rounded-lg border border-border p-4 transition-shadow hover:shadow-lg hover:shadow-gray-500/50"
58+
class="grid grid-cols-[auto_1fr] gap-x-5 no-underline hover:no-underline rounded-lg border border-border p-4 transition-all hover:shadow-md hover:shadow-fg/5 hover:border-border-hover"
5959
>
6060
<AuthorAvatar v-if="article.author" :author="article.author" size="md" class="row-span-2" />
6161
<div class="flex flex-col">

app/components/global/BlogPostWrapper.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const blueskyPostUri = computed(() => blueskyLink.value?.postUri ?? null)
5858
<AuthorList :authors="post.authors" variant="expanded" />
5959
</div>
6060
</div>
61-
<article class="max-w-prose mx-auto p-2 prose dark:prose-invert">
61+
<article class="max-w-prose mx-auto prose dark:prose-invert">
6262
<div class="text-sm text-fg-muted font-mono mb-4">
6363
<DateTime :datetime="frontmatter.date" year="numeric" month="short" day="numeric" />
6464
</div>
@@ -77,4 +77,19 @@ const blueskyPostUri = computed(() => blueskyLink.value?.postUri ?? null)
7777
:deep(.markdown-body) {
7878
@apply prose dark:prose-invert;
7979
}
80+
81+
:deep(.prose a:not(.not-prose a):not([class*='no-underline'])) {
82+
text-decoration: underline;
83+
text-underline-offset: 0.2rem;
84+
text-decoration-thickness: 1px;
85+
text-decoration-color: var(--fg-subtle);
86+
transition:
87+
text-decoration-color 0.2s,
88+
color 0.2s;
89+
}
90+
91+
:deep(.prose a:not(.not-prose a):not([class*='no-underline']):hover) {
92+
text-decoration-color: var(--fg);
93+
color: var(--fg);
94+
}
8095
</style>

app/components/global/BlueskyPostEmbed.client.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,16 @@ const postUrl = computed(() => {
107107
:href="postUrl ?? '#'"
108108
target="_blank"
109109
rel="noopener noreferrer"
110-
class="not-prose block rounded-lg border border-border bg-bg-subtle p-4 sm:p-5 no-underline hover:border-border-hover transition-colors duration-200"
110+
class="not-prose block rounded-lg border border-border bg-bg-subtle p-4 sm:p-5 no-underline hover:border-border-hover transition-colors duration-200 relative group"
111111
>
112+
<!-- Bluesky icon -->
113+
<span
114+
class="i-simple-icons:bluesky w-5 h-5 text-fg-subtle group-hover:text-blue-500 absolute top-4 end-4 sm:top-5 sm:end-5"
115+
aria-hidden="true"
116+
/>
117+
112118
<!-- Author row -->
113-
<div class="flex items-center gap-3 mb-3">
119+
<div class="flex items-center gap-3 mb-3 pe-7">
114120
<img
115121
v-if="post.author.avatar"
116122
:src="`${post.author.avatar}?size=48`"
@@ -126,10 +132,6 @@ const postUrl = computed(() => {
126132
</div>
127133
<div class="text-sm text-fg-subtle truncate">@{{ post.author.handle }}</div>
128134
</div>
129-
<span
130-
class="i-simple-icons:bluesky w-5 h-5 text-fg-subtle ms-auto shrink-0"
131-
aria-hidden="true"
132-
/>
133135
</div>
134136

135137
<!-- Post text -->

i18n/locales/az-AZ.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"reply_count": "{count} cavab",
108108
"like_count": "{count} bəyənmə",
109109
"repost_count": "{count} yenidən paylaşım",
110-
"more_replies": "{count} cavab daha..."
110+
"more_replies": "daha {count} cavab... | daha {count} cavab..."
111111
}
112112
},
113113
"settings": {

i18n/locales/cs-CZ.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"reply_count": "{count} odpověď | {count} odpovědi | {count} odpovědí",
108108
"like_count": "{count} lajk | {count} lajky | {count} lajků",
109109
"repost_count": "{count} repost | {count} reposty | {count} repostů",
110-
"more_replies": "{count} další odpověď ... | {count} další odpovědi ... | {count} dalších odpovědí ..."
110+
"more_replies": "ještě {count} odpověď… | ještě {count} odpovědi… | ještě {count} odpovědí"
111111
}
112112
},
113113
"settings": {

i18n/locales/de-DE.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"reply_count": "{count} Antwort | {count} Antworten",
108108
"like_count": "{count} Like | {count} Likes",
109109
"repost_count": "{count} Repost | {count} Reposts",
110-
"more_replies": "{count} weitere Antwort anzeigen | {count} weitere Antworten anzeigen"
110+
"more_replies": "noch {count} Antwort… | noch {count} Antworten"
111111
}
112112
},
113113
"settings": {

i18n/locales/fr-FR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"reply_count": "{count} réponse | {count} réponses",
108108
"like_count": "{count} j'aime | {count} j'aime",
109109
"repost_count": "{count} repartage | {count} repartages",
110-
"more_replies": "{count} réponse de plus... | {count} réponses de plus..."
110+
"more_replies": "{count} réponse supplémentaire... | {count} réponses supplémentaires..."
111111
}
112112
},
113113
"settings": {

i18n/locales/id-ID.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"reply_count": "{count} balasan | {count} balasan",
110110
"like_count": "{count} suka | {count} suka",
111111
"repost_count": "{count} repost | {count} repost",
112-
"more_replies": "{count} balasan lainnya... | {count} balasan lainnya..."
112+
"more_replies": "{count} balasan lagi... | {count} balasan lagi..."
113113
}
114114
},
115115
"settings": {

i18n/locales/ja-JP.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"reply_count": "{count} 件の返信",
108108
"like_count": "{count} 件のいいね",
109109
"repost_count": "{count} 件のリポスト",
110-
"more_replies": "さらに {count} 件のリプライを表示..."
110+
"more_replies": "さらに{count}件の返信…"
111111
}
112112
},
113113
"settings": {

0 commit comments

Comments
 (0)