- Remove 3-state logic (normal/50%/80%) - now only normal/expanded - Remove double-click detection and tooltips for simplicity - Remove platform-specific behavior (same UX for Electron and web) - Optimize button layout: reduce from 36px to 28px to fit 3 buttons - Position expand button above history buttons in vertical stack - Keep 15-line expanded height (360px, capped to available space) Per upstream dev feedback to keep it simple with one approach
31 lines
813 B
TypeScript
31 lines
813 B
TypeScript
import { Show } from "solid-js"
|
|
import { Maximize2, Minimize2 } from "lucide-solid"
|
|
|
|
interface ExpandButtonProps {
|
|
expandState: () => "normal" | "expanded"
|
|
onToggleExpand: (nextState: "normal" | "expanded") => void
|
|
}
|
|
|
|
export default function ExpandButton(props: ExpandButtonProps) {
|
|
function handleClick() {
|
|
const current = props.expandState()
|
|
props.onToggleExpand(current === "normal" ? "expanded" : "normal")
|
|
}
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
class="prompt-expand-button"
|
|
onClick={handleClick}
|
|
aria-label="Toggle chat input height"
|
|
>
|
|
<Show
|
|
when={props.expandState() === "normal"}
|
|
fallback={<Minimize2 class="h-4 w-4" aria-hidden="true" />}
|
|
>
|
|
<Maximize2 class="h-4 w-4" aria-hidden="true" />
|
|
</Show>
|
|
</button>
|
|
)
|
|
}
|