feat(opencode): timestamp gutter mode for messages#29113
Draft
guyshe-jfrog wants to merge 1 commit into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Refs #29112 — opening as a draft pending design sign-off there.
Type of change
What does this PR do?
Extends
/timestampsto cycle three modes instead of two:hide → footer → gutter → hide. The newguttermode renders a fixed 5-cellHH:MMcolumn 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 optionaltui.jsonkeytimestamps_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:
/timestampsstill toggles immediately without writing totui.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.flexDirection="row"wrapper, so itsonMouseUpdoesn't bubble into the row's existing click handler (which opensDialogMessage). The two interactions stay independent.Scope is deliberately small — user messages only, mouse-only popup. Keyboard support needs a
selectedMessageIDsignal 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 oxlinton the changed files — no new warnings.packages/opencode/test/cli/cmd/tui/timestamps.test.tscoversgetTimestampsModeconfig resolution,nextTimestampsModecycle order,normalizeTimestampsModelegacy"show"mapping, andhourMinute24-hour formatting. 11/11 pass; full TUI test directory 61/61 pass./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