Skip to content

tui: goal view cuts off long content and is not scrollable #65814

Done

Description

@nadeeshafdo

Summary

Goal feature in the TUI cuts off long content with no way to scroll, making part of the goal unreadable.

Environment

  • opencode version: v2.4.0
  • OS: Linux pentium 6.12.117+deb13-amd64 feat: compact and other improvements #1 SMP PREEMPT_DYNAMIC Debian 6.12.117-1 (2026-11-12) x86_64 GNU/Linux
  • Terminal: TERM=xterm-256color, COLORTERM=truecolor, TERM_PROGRAM=unset
  • Shell: /bin/bash
  • Install/channel: latest (v2.4.0)
  • Active plugins: None found in config (MCP servers configured: canva, ui-skills; no local .opencode/plugin/ or .opencode/plugins/)

Reproduction

  1. Open opencode TUI (opencode)
  2. Open the goal feature/view
  3. Show a goal with content longer than the visible area
  4. Try to scroll with keyboard / mouse

Expected Behavior

Goal view should be scrollable so all long goal content can be read.

Actual Behavior

Content is cut off with no scroll. Always reproducible per reporter.

Additional Context

Frequency: always. No logs/screenshots provided yet. Workarounds: none known.

Activity

  1. added
    area/tui
    type/bug
    version/v2
    on Nov 23, 2026
  2. opencodejr commented on Nov 23, 2026

    @opencodejr
    Contributor

    Seen with a simulated model or a mock server, not a real provider; a maintainer should confirm.

    Thanks for the report. I reproduced this on v2.4.0, and it still happens on the latest dev (d1f9870).

    Steps: in a 100×30 terminal, set a goal with a long objective using /goal <about 2,000 characters>, then click ◎ goal under the prompt to open the Goal dialog. The dialog grows past the bottom of the screen. The end of the objective, the goal's status line and the pause/clear actions are never shown, and neither the mouse wheel nor PageDown/Down/End scrolls it. A simulated model answered the turn that /goal starts. That reply has nothing to do with how the dialog is drawn.

    The recording and screenshot below show it, and the script below reproduces it.

    recording.mp4

    Screenshot

    Reproduction script (drive.ts)
    import { Effect, Stream } from "effect"
    import { Llm, OpenCodeDriver } from "opencode-drive"
    
    // A goal objective far longer than the dialog can show at 100x30.
    const sentences = Array.from({ length: 40 }, (_, i) => `Step ${i + 1}: refactor module ${i + 1} and keep tests green.`)
    const objective = sentences.join(" ") + " FINAL-LINE-MARKER"
    
    const lineText = (line: { spans: ReadonlyArray<{ text: string }> }) => line.spans.map((s) => s.text).join("")
    
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tui: { recording: true, keypressOverlay: true, pointerOverlay: true, viewport: { cols: 100, rows: 30 } },
      },
      ({ ui, llm }) =>
        Effect.gen(function* () {
          yield* llm.serve(() => Stream.make(Llm.text("Working on it.")))
          yield* ui.submit(`/goal ${objective}`)
          yield* ui.waitFor("goal", { timeout: 15000 })
          yield* Effect.sleep(1500)
          // Find the "◎ goal" status under the prompt and click it.
          const frame = yield* ui.capture()
          let pos: { x: number; y: number } | undefined
          frame.lines.forEach((line, y) => {
            const t = lineText(line)
            const x = t.indexOf("◎ goal")
            if (x >= 0 && !pos) pos = { x: x + 2, y }
          })
          if (!pos) return yield* Effect.die(new Error("goal status not found"))
          yield* ui.mouse({ action: "move", x: pos.x, y: pos.y })
          yield* ui.mouse({ action: "down", x: pos.x, y: pos.y })
          yield* ui.mouse({ action: "up", x: pos.x, y: pos.y })
          yield* ui.waitFor("Goal", { timeout: 5000 })
          yield* Effect.sleep(500)
          yield* ui.screenshot("goal-dialog")
          // Try to scroll the dialog with mouse wheel and keyboard.
          for (let i = 0; i < 10; i++) yield* ui.mouse({ action: "scroll", x: 50, y: 15, direction: "down" })
          yield* ui.press("pagedown")
          yield* ui.press("down")
          yield* ui.press("end")
          yield* Effect.sleep(500)
          yield* ui.screenshot("goal-dialog-after-scroll")
          const after = yield* ui.capture()
          const text = after.lines.map(lineText).join("\n")
          yield* Effect.log(text)
          yield* Effect.log(`FINAL-LINE-MARKER visible: ${text.includes("FINAL-LINE-MARKER")}`)
          yield* Effect.log(`status line visible: ${/◎ (Active|Paused|Met)/.test(text)}`)
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  3. added
    status/repro-simulated
    on Nov 23, 2026
  4. gmatt20 commented on Nov 23, 2026

    @gmatt20

    Hi! I'd like to work on this, could I be assigned? I reproduced it with a long /goal objective in a small terminal and the dialog overflows and won't scroll. My plan is to cap the dialog's height and wrap the objective text in a scrollable box so the status line and pause/clear actions stay visible. Let me know if I need to adjust my plan if there's a preferred approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tuiplatform/linuxstatus/repro-simulatedtype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions