Visitar URL original
feat(app): restyle v2 jump-to-latest button (#33809) · BenGu3/opencode@d6756b6 · GitHub
Skip to content

Commit d6756b6

Browse files
arvsrnBenGu3
authored andcommitted
feat(app): restyle v2 jump-to-latest button (anomalyco#33809)
1 parent 17cbda9 commit d6756b6

1 file changed

Lines changed: 42 additions & 12 deletions

File tree

‎packages/app/src/pages/session/timeline/message-timeline.tsx‎

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,26 +1239,56 @@ export function MessageTimeline(props: {
12391239
return (
12401240
<div class="relative w-full h-full min-w-0">
12411241
<div
1242-
class="absolute left-1/2 -translate-x-1/2 bottom-6 z-[60] pointer-events-none transition-all duration-200 ease-out"
1242+
class="absolute left-1/2 -translate-x-1/2 z-[60] pointer-events-none transition-all duration-200 ease-out"
12431243
classList={{
1244+
"bottom-8": settings.general.newLayoutDesigns(),
1245+
"bottom-6": !settings.general.newLayoutDesigns(),
12441246
"opacity-100 translate-y-0 scale-100": props.scroll.overflow && props.scroll.jump,
1245-
"opacity-0 translate-y-2 scale-95 pointer-events-none": !props.scroll.overflow || !props.scroll.jump,
1247+
"opacity-0 translate-y-2 pointer-events-none": !props.scroll.overflow || !props.scroll.jump,
1248+
"scale-[0.8]": (!props.scroll.overflow || !props.scroll.jump) && settings.general.newLayoutDesigns(),
1249+
"scale-95": (!props.scroll.overflow || !props.scroll.jump) && !settings.general.newLayoutDesigns(),
12461250
}}
12471251
>
1248-
<button
1249-
class="pointer-events-auto flex items-center justify-center w-10 h-8 bg-transparent border-none cursor-pointer p-0 group"
1250-
onClick={props.onResumeScroll}
1252+
<Show
1253+
when={settings.general.newLayoutDesigns()}
1254+
fallback={
1255+
<button
1256+
type="button"
1257+
aria-label={language.t("session.messages.jumpToLatest")}
1258+
class="pointer-events-auto flex items-center justify-center w-10 h-8 bg-transparent border-none cursor-pointer p-0 group"
1259+
onClick={props.onResumeScroll}
1260+
>
1261+
<div
1262+
class="flex items-center justify-center w-8 h-6 rounded-[6px] border border-border-weaker-base bg-[color-mix(in_srgb,var(--surface-raised-stronger-non-alpha)_80%,transparent)] backdrop-blur-[0.75px] transition-colors group-hover:border-[var(--border-weak-base)] group-hover:[--icon-base:var(--icon-hover)]"
1263+
style={{
1264+
"box-shadow":
1265+
"0 51px 60px 0 rgba(0,0,0,0.10), 0 15px 18px 0 rgba(0,0,0,0.12), 0 6.386px 7.513px 0 rgba(0,0,0,0.12), 0 2.31px 2.717px 0 rgba(0,0,0,0.20)",
1266+
}}
1267+
>
1268+
<Icon name="arrow-down-to-line" size="small" />
1269+
</div>
1270+
</button>
1271+
}
12511272
>
1252-
<div
1253-
class="flex items-center justify-center w-8 h-6 rounded-[6px] border border-border-weaker-base bg-[color-mix(in_srgb,var(--surface-raised-stronger-non-alpha)_80%,transparent)] backdrop-blur-[0.75px] transition-colors group-hover:border-[var(--border-weak-base)] group-hover:[--icon-base:var(--icon-hover)]"
1273+
<button
1274+
type="button"
1275+
aria-label={language.t("session.messages.jumpToLatest")}
1276+
class="pointer-events-auto flex items-center justify-center w-8 h-7 px-2 py-1.5 rounded-lg border-none cursor-pointer text-v2-text-text-base backdrop-blur-[2px]"
12541277
style={{
1255-
"box-shadow":
1256-
"0 51px 60px 0 rgba(0,0,0,0.10), 0 15px 18px 0 rgba(0,0,0,0.12), 0 6.386px 7.513px 0 rgba(0,0,0,0.12), 0 2.31px 2.717px 0 rgba(0,0,0,0.20)",
1278+
background: "color-mix(in srgb, var(--v2-background-bg-base) 92%, transparent)",
1279+
"box-shadow": "var(--v2-elevation-raised), 0px 2px 8px var(--v2-background-bg-base)",
12571280
}}
1281+
onClick={props.onResumeScroll}
12581282
>
1259-
<Icon name="arrow-down-to-line" size="small" />
1260-
</div>
1261-
</button>
1283+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
1284+
<path
1285+
d="M12.3333 8.66665L8 13L3.66667 8.66665M8 12.6667V2.83332"
1286+
stroke="currentColor"
1287+
stroke-linecap="square"
1288+
/>
1289+
</svg>
1290+
</button>
1291+
</Show>
12621292
</div>
12631293
<ScrollView
12641294
viewportRef={bindListRoot}

0 commit comments

Comments
 (0)