Skip to content

feat(opencode): timestamp gutter mode for messages#29113

Draft
guyshe-jfrog wants to merge 1 commit into
anomalyco:devfrom
guyshe-jfrog:feat/tui-timestamp-gutter
Draft

feat(opencode): timestamp gutter mode for messages#29113
guyshe-jfrog wants to merge 1 commit into
anomalyco:devfrom
guyshe-jfrog:feat/tui-timestamp-gutter

Conversation

@guyshe-jfrog
Copy link
Copy Markdown

Issue for this PR

Refs #29112 — opening as a draft pending design sign-off there.

Type of change

  • New feature

What does this PR do?

Extends /timestamps to cycle three modes instead of two: hide → footer → gutter → hide. The new gutter mode renders a fixed 5-cell HH:MM column to the left of each user message; clicking the gutter opens a small popup with the full local datetime and a relative time. Adds an optional tui.json key timestamps_mode (default "hide") that seeds the starting mode. Existing users with the legacy kv value "show" are mapped to "footer" at read time so their toggle keeps working.

Why it works:

  • The kv signal stays the source of truth in-session, so /timestamps still toggles immediately without writing to tui.json.
  • showTimestamps() (the existing alias used to gate the footer render) now returns true only for "footer" mode — gutter mode draws the time on its own row-level box, so there's no duplicate render.
  • The gutter is a sibling of the bordered message box inside a flexDirection="row" wrapper, so its onMouseUp doesn't bubble into the row's existing click handler (which opens DialogMessage). The two interactions stay independent.

Scope is deliberately small — user messages only, mouse-only popup. Keyboard support needs a selectedMessageID signal that doesn't exist yet; happy to do that in a follow-up.

How did you verify your code works?

  • bun turbo typecheck — clean across all 15 packages.
  • bunx oxlint on the changed files — no new warnings.
  • New tests: packages/opencode/test/cli/cmd/tui/timestamps.test.ts covers getTimestampsMode config resolution, nextTimestampsMode cycle order, normalizeTimestampsMode legacy "show" mapping, and hourMinute 24-hour formatting. 11/11 pass; full TUI test directory 61/61 pass.
  • Manual: ran the TUI locally, cycled the three modes via /timestamps, clicked the gutter to confirm the popup, restarted to confirm the kv signal persists and the config-seeded default applies on a fresh state.

Screenshots / recordings

Will attach when the design direction is confirmed.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The /timestamps slash command now cycles hide → footer → gutter → hide.
Gutter mode renders a fixed 5-char HH:MM column to the left of each user
message; clicking the gutter opens a popup with the full local datetime.

Adds a new tui.json key `timestamps_mode` ("hide" | "footer" | "gutter",
default "hide") that seeds the default mode for new users. The kv signal
that backs the toggle was previously "hide" | "show"; "show" is mapped
to "footer" at read time so existing toggles keep working.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants