GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(app): prompt input shouldn't cover content · flowingboy/opencode@d315026

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/app/src
    • components/session
      • session-new-view.tsx
    • pages
      • session.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/app/src/components/session/session-new-view.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/session/session-new-view.tsx
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export function NewSessionView(props: NewSessionViewProps) {
4444
}
4545

4646
return (
47-
<div class="size-full flex flex-col pb-45 justify-end items-start gap-4 flex-[1_0_0] self-stretch max-w-200 mx-auto px-6">
47+
<div
48+
class="size-full flex flex-col pb-45 justify-end items-start gap-4 flex-[1_0_0] self-stretch max-w-200 mx-auto px-6"
49+
style={{ "padding-bottom": "calc(var(--prompt-height, 11.25rem) + 64px)" }}
50+
>
4851
<div class="text-20-medium text-text-weaker">New session</div>
4952
<div class="flex justify-center items-center gap-3">
5053
<Icon name="folder" size="small" />
Collapse file

‎packages/app/src/pages/session.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/pages/session.tsx
+35-4Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { For, onCleanup, Show, Match, Switch, createMemo, createEffect, on } from "solid-js"
22
import { createMediaQuery } from "@solid-primitives/media"
3+
import { createResizeObserver } from "@solid-primitives/resize-observer"
34
import { Dynamic } from "solid-js/web"
45
import { useLocal } from "@/context/local"
56
import { selectionFromLines, useFile, type SelectedLineRange } from "@/context/file"
@@ -248,6 +249,7 @@ export default function Page() {
248249
messageId: undefined as string | undefined,
249250
mobileTab: "session" as "session" | "review",
250251
newSessionWorktree: "main",
252+
promptHeight: 0,
251253
})
252254

253255
const newSessionWorktree = createMemo(() => {
@@ -289,6 +291,8 @@ export default function Page() {
289291

290292
const idle = { type: "idle" as const }
291293
let inputRef!: HTMLDivElement
294+
let promptDock: HTMLDivElement | undefined
295+
let scroller: HTMLDivElement | undefined
292296

293297
createEffect(() => {
294298
if (!params.id) return
@@ -668,9 +672,30 @@ export default function Page() {
668672
const anchor = (id: string) => `message-${id}`
669673

670674
const setScrollRef = (el: HTMLDivElement | undefined) => {
675+
scroller = el
671676
autoScroll.scrollRef(el)
672677
}
673678

679+
createResizeObserver(
680+
() => promptDock,
681+
({ height }) => {
682+
const next = Math.ceil(height)
683+
684+
if (next === store.promptHeight) return
685+
686+
const el = scroller
687+
const stick = el ? el.scrollHeight - el.clientHeight - el.scrollTop < 10 : false
688+
689+
setStore("promptHeight", next)
690+
691+
if (stick && el) {
692+
requestAnimationFrame(() => {
693+
el.scrollTo({ top: el.scrollHeight, behavior: "auto" })
694+
})
695+
}
696+
},
697+
)
698+
674699
const updateHash = (id: string) => {
675700
window.history.replaceState(null, "", `#${anchor(id)}`)
676701
}
@@ -776,7 +801,10 @@ export default function Page() {
776801
"@container relative shrink-0 flex flex-col min-h-0 h-full bg-background-stronger": true,
777802
"flex-1 md:flex-none py-6 md:py-3": true,
778803
}}
779-
style={{ width: isDesktop() && showTabs() ? `${layout.session.width()}px` : "100%" }}
804+
style={{
805+
width: isDesktop() && showTabs() ? `${layout.session.width()}px` : "100%",
806+
"--prompt-height": store.promptHeight ? `${store.promptHeight}px` : undefined,
807+
}}
780808
>
781809
<div class="flex-1 min-h-0 overflow-hidden">
782810
<Switch>
@@ -791,7 +819,7 @@ export default function Page() {
791819
view={view}
792820
diffStyle="unified"
793821
classes={{
794-
root: "pb-32",
822+
root: "pb-[calc(var(--prompt-height,8rem)+32px)]",
795823
header: "px-4",
796824
container: "px-4",
797825
}}
@@ -822,7 +850,7 @@ export default function Page() {
822850
>
823851
<div
824852
ref={autoScroll.contentRef}
825-
class="flex flex-col gap-32 items-start justify-start pb-32 md:pb-40 transition-[margin]"
853+
class="flex flex-col gap-32 items-start justify-start pb-[calc(var(--prompt-height,8rem)+64px)] md:pb-[calc(var(--prompt-height,10rem)+64px)] transition-[margin]"
826854
classList={{
827855
"mt-0.5": !showTabs(),
828856
"mt-0": showTabs(),
@@ -894,7 +922,10 @@ export default function Page() {
894922
</div>
895923

896924
{/* Prompt input */}
897-
<div class="absolute inset-x-0 bottom-0 pt-12 pb-4 md:pb-8 flex flex-col justify-center items-center z-50 px-4 md:px-0 bg-gradient-to-t from-background-stronger via-background-stronger to-transparent pointer-events-none">
925+
<div
926+
ref={(el) => (promptDock = el)}
927+
class="absolute inset-x-0 bottom-0 pt-12 pb-4 md:pb-8 flex flex-col justify-center items-center z-50 px-4 md:px-0 bg-gradient-to-t from-background-stronger via-background-stronger to-transparent pointer-events-none"
928+
>
898929
<div
899930
classList={{
900931
"w-full md:px-6 pointer-events-auto": true,

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.