2424 />
2525
2626 <!-- Modal Body -->
27- <div class =" modal-body flex flex-col gap-4 px-4 pt-6 pb-2 flex-1" >
27+ <div class =" modal-body flex flex-col gap-4 px-0 pt-0 pb-2 flex-1" >
2828 <!-- Release Content -->
2929 <div class =" content-text" v-html =" formattedContent" ></div >
3030 </div >
4343 <i class =" icon-[lucide--external-link]" ></i >
4444 {{ $t('whatsNewPopup.learnMore') }}
4545 </a >
46- <div class =" footer-actions flex items-center gap-4" >
47- <button
48- class =" action-secondary h-8 px-0 bg-transparent border-none text-sm font-normal rounded cursor-pointer"
49- @click =" closePopup"
50- >
51- {{ $t('whatsNewPopup.later') }}
52- </button >
53- <button
54- class =" action-primary h-10 px-4 border-none text-sm font-normal rounded-lg cursor-pointer"
55- @click =" handleCTA"
56- >
57- {{ $t('whatsNewPopup.update') }}
58- </button >
59- </div >
46+ <div class =" footer-actions flex items-center gap-4" ></div >
6047 </div >
6148 </div >
6249 </div >
@@ -115,15 +102,20 @@ const formattedContent = computed(() => {
115102
116103 try {
117104 const markdown = latestRelease .value .content
118- // Replace the h1 with our custom title
119- const versionText = latestRelease .value .version
120- ? ` (${latestRelease .value .version }) `
121- : ' '
122- const customContent = markdown .replace (
123- / ^ # . + $ / m ,
124- ` # What's new in our latest update${versionText } `
125- )
126- return renderMarkdownToHtml (customContent )
105+
106+ // Extract image and remaining content separately
107+ const imageMatch = markdown .match (/ !\[ . *? \]\( . *? \) / )
108+ const image = imageMatch ? imageMatch [0 ] : ' '
109+
110+ // Remove image from content but keep original title
111+ const contentWithoutImage = markdown .replace (/ !\[ . *? \]\( . *? \) / , ' ' ).trim ()
112+
113+ // Reorder: image first, then original content
114+ const reorderedContent = [image , contentWithoutImage ]
115+ .filter (Boolean )
116+ .join (' \n\n ' )
117+
118+ return renderMarkdownToHtml (reorderedContent )
127119 } catch (error ) {
128120 console .error (' Error parsing markdown:' , error )
129121 // Fallback to plain text with line breaks
@@ -148,11 +140,6 @@ const closePopup = async () => {
148140 hide ()
149141}
150142
151- const handleCTA = async () => {
152- window .open (' https://docs.comfy.org/installation/update_comfyui' , ' _blank' )
153- await closePopup ()
154- }
155-
156143// Initialize on mount
157144onMounted (async () => {
158145 // Fetch releases if not already loaded
@@ -165,7 +152,6 @@ onMounted(async () => {
165152defineExpose ({
166153 show ,
167154 hide ,
168- handleCTA ,
169155 closePopup
170156})
171157 </script >
@@ -198,7 +184,7 @@ defineExpose({
198184 display : flex ;
199185 flex-direction : column ;
200186 gap : 1rem ;
201- padding : 1.5 rem 1 rem 0.5 rem ;
187+ padding : 0 ;
202188 flex : 1 ;
203189}
204190
@@ -213,6 +199,7 @@ defineExpose({
213199 font-size : 14px ;
214200 line-height : 1.5 ;
215201 word-wrap : break-word ;
202+ padding : 0 1rem ;
216203}
217204
218205/* Style the markdown content */
@@ -225,6 +212,8 @@ defineExpose({
225212 color : var (--text-primary );
226213 font-family : Inter, sans-serif ;
227214 font-size : 14px ;
215+ margin-top : 1rem ;
216+ margin-bottom : 1rem ;
228217}
229218
230219/* Version subtitle - targets the first p tag after h1 */
@@ -312,10 +301,23 @@ defineExpose({
312301.content-text :deep(img ) {
313302 width : 100% ;
314303 height : 200px ;
315- border-radius : 8px ;
316304 margin : 0 0 16px ;
317305 object-fit : cover ;
318306 display : block ;
307+ border-radius : 8px ;
308+ }
309+
310+ .content-text :deep(img :first-child ) {
311+ margin : -1rem -1rem 16px ;
312+ width : calc (100% + 2rem );
313+ border-top-left-radius : var (--corner-radius-corner-radius-md , 8px );
314+ border-top-right-radius : var (--corner-radius-corner-radius-md , 8px );
315+ border-bottom-left-radius : 0 ;
316+ border-bottom-right-radius : 0 ;
317+ }
318+
319+ .content-text :deep(img + h1 ) {
320+ margin-top : 0 ;
319321}
320322
321323.content-text :deep(h2 ) {
@@ -327,24 +329,6 @@ defineExpose({
327329 line-height : 1.4 ;
328330}
329331
330- /* Remove top margin for first media element */
331- .content-text :deep(img :first-child ),
332- .content-text :deep(video :first-child ),
333- .content-text :deep(iframe :first-child ) {
334- margin-top : -32px ; /* Align with the top edge of the popup content */
335- margin-bottom : 24px ;
336- }
337-
338- /* Media elements */
339- .content-text :deep(img ),
340- .content-text :deep(video ),
341- .content-text :deep(iframe ) {
342- width : calc (100% + 64px );
343- height : auto ;
344- margin : 24px -32px ;
345- display : block ;
346- }
347-
348332/* Modal Footer */
349333.modal-footer {
350334 display : flex ;
0 commit comments