Skip to content

/timestamps command has no visible effect and /exit missing from autocomplete #26625

@welbonwang

Description

@welbonwang

Description

Bug Report

Description

The /timestamps slash command (and its alias /toggle-timestamps) is supposed to show a timestamp below each user message in the TUI session view. While the command correctly toggles between "Show timestamps" and "Hide timestamps" state (persisted via KV store), the timestamps are not visually rendered in any theme.

Steps to Reproduce

  1. Start OpenCode TUI (v1.14.42+)
  2. Have a conversation with at least one user message
  3. Type /timestamps in the prompt — the command title reads "Show timestamps"
  4. Select it to toggle timestamps ON
  5. Observe: no timestamp appears under any user message bubble
  6. Run /timestamps again — title now reads "Hide timestamps", confirming the toggle state changed

Expected Behavior

When timestamps are enabled, each user message bubble should display a creation time (e.g. 14:32 or 14:32 · 2026-05-10) at the bottom, rendered in theme.textMuted.

Actual Behavior

No visible timestamp text appears under user messages in any theme (tested with multiple built-in themes via /themes).

Environment

Root Cause Analysis

The rendering code at packages/opencode/src/cli/cmd/tui/routes/session/index.tsx:1361-1376:

<Show
  when={queued()}
  fallback={
    <Show when={ctx.showTimestamps()}>
      <text fg={theme.textMuted}>
        <span style={{ fg: theme.textMuted }}>
          {Locale.todayTimeOrDateTime(props.message.time.created)}
        </span>
      </text>
    </Show>
  }
>

The toggle logic itself is correct:

  • KV signal defaults to "hide" (line 218)
  • Toggle switches between "hide" / "show" (line 681)
  • showTimestamps memo derives boolean state (line 233)

The likely issue is a layout/rendering problem: the timestamp <text> element is the last child inside a <box> with paddingBottom={1} (line 1336). In OpenTUI's flex layout, this trailing <text> without an explicit wrapping <box> may collapse into the bottom padding area, rendering it invisible. The <text> element may need to be wrapped in its own <box> or the padding structure needs adjustment.

Related: /exit command also affected by the same commit

The same commit (98f5e6e71) also introduced an enabled guard on the /exit slash command (app.tsx:651-655) that makes it unreachable in the autocomplete dropdown whenever the prompt input has text:

enabled: () => {
  const current = promptRef.current
  if (!current?.focused) return true
  return current.current.input === ""
},

Since typing / to open the autocomplete means the prompt is focused and contains text, the enabled check returns false and /exit is filtered out of the slash command list. This appears to be an unintended side effect — the guard was likely intended to prevent accidental exits during typing, but it also prevents the slash command from appearing in autocomplete.

Plugins

No response

OpenCode version

1.14.42+

Steps to reproduce

  1. Start OpenCode TUI (v1.14.42+)
  2. Have a conversation with at least one user message
  3. Type /timestamps in the prompt — the command title reads "Show timestamps"
  4. Select it to toggle timestamps ON
  5. Observe: no timestamp appears under any user message bubble
  6. Run /timestamps again — title now reads "Hide timestamps", confirming the toggle state changed

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04

Terminal

ssh to Ubuntu at Windows Terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions