mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: desktop layout
This commit is contained in:
parent
ccdd77032a
commit
9efe09564b
2 changed files with 13 additions and 3 deletions
|
|
@ -214,10 +214,10 @@
|
|||
}
|
||||
|
||||
[data-component="sticky-accordion-header"] {
|
||||
top: 40px;
|
||||
top: var(--sticky-header-height, 40px);
|
||||
|
||||
&[data-expanded]::before {
|
||||
top: -40px;
|
||||
top: calc(-1 * var(--sticky-header-height, 40px));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ export function SessionTurn(
|
|||
|
||||
let scrollRef: HTMLDivElement | undefined
|
||||
let contentRef: HTMLDivElement | undefined
|
||||
let stickyHeaderRef: HTMLDivElement | undefined
|
||||
const [userScrolled, setUserScrolled] = createSignal(false)
|
||||
const [stickyHeaderHeight, setStickyHeaderHeight] = createSignal(0)
|
||||
|
||||
function handleScroll() {
|
||||
if (!scrollRef) return
|
||||
|
|
@ -93,6 +95,13 @@ export function SessionTurn(
|
|||
})
|
||||
})
|
||||
|
||||
onMount(() => {
|
||||
if (!stickyHeaderRef) return
|
||||
createResizeObserver(stickyHeaderRef, ({ height }) => {
|
||||
setStickyHeaderHeight(height + 8)
|
||||
})
|
||||
})
|
||||
|
||||
return (
|
||||
<div data-component="session-turn" class={props.classes?.root}>
|
||||
<div ref={scrollRef} onScroll={handleScroll} data-slot="session-turn-content" class={props.classes?.content}>
|
||||
|
|
@ -238,9 +247,10 @@ export function SessionTurn(
|
|||
data-message={message().id}
|
||||
data-slot="session-turn-message-container"
|
||||
class={props.classes?.container}
|
||||
style={{ "--sticky-header-height": `${stickyHeaderHeight()}px` }}
|
||||
>
|
||||
{/* Sticky Header */}
|
||||
<div data-slot="session-turn-sticky-header">
|
||||
<div ref={stickyHeaderRef} data-slot="session-turn-sticky-header">
|
||||
<div data-slot="session-turn-message-header">
|
||||
<div data-slot="session-turn-message-title">
|
||||
<Switch>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue