Skip to content

#894 Reveal user message time by dragging the bubble left - #897

Merged
ivanfenenko merged 3 commits into
mainfrom
feature/894-drag-reveal-message-time
Oct 30, 2026
Merged

ivanfenenko merged 3 commits into
mainfrom
feature/894-drag-reveal-message-time

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Session Chat no longer draws the metadata footer ("Build · DeepSeek V4 Flash · 9:05 PM") under user messages, on iOS and Android, v1 and v2.
  • Drag a user bubble left to see its time: only that bubble (and its attachment chips) moves, at about 0.9× the finger with a rubber band up to 72 pt/dp. The time fades in at the right edge, centred on the bubble. Messages from before today show the day under the time ("Yesterday", the weekday within the last week, otherwise a short date), in the device's locale and 12/24-hour setting. Releasing springs it back. Dragging right does nothing.
  • The gesture lives in the design-system component (OpenCodeMessageTimeReveal on both platforms, used by OpenCodeOutgoingMessage), so screens don't own it.
    • iOS: a UIPanGestureRecognizer (iOS 18+) that only begins for a mostly-left drag past ~8 pt, works alongside the list scroll, and cancels the list's pan once it locks (the same pattern as table row swipes). iOS 17 falls back to a simultaneous SwiftUI drag with the same direction lock. Drags that start within 20 pt of a screen edge, or on a code block that scrolls sideways, are ignored.
    • Android: pointerInput decides the direction after 8 dp, consumes only a locked left drag, ignores drags that start in the system gesture insets, and springs back with an Animatable spring.
  • Accessibility: VoiceOver/TalkBack still read the agent, model and time as the message's accessibility value / state description, plus the day for older messages.
  • Rows carry sentAtEpochMs (the optimistic send row uses the local send time).

v1 decision

Session Chat only shows the "Agent changed" / "Switched to" notices because v2 servers record them; v1 servers don't. Hiding the footer would have hidden agent and model changes on v1. Every v1 user message still carries its agent and model, so the timeline now builds the same notices on v1 from consecutive user messages. It adds one before each user message whose agent or model differs from the previous one. The same model with a new variant shows "Switched variant to …".

Like v2, the first agent and model in a session get no notice. A new recordsTimelineChangeNotices capability (v2 true, v1 false) controls the derivation. v2 keeps only the server's notices, so there are no duplicates and no v1/v2 UI fork. Once the footer is gone, a v1 user can no longer see the agent and model of the session's first message in the chat (v2 already worked this way). The composer still shows the current agent and model, and screen readers still read them.

Checks

  • iOS: xcodebuild test (OpenCode MobileTests), 2881 tests passed on the iPhone 16 Pro Max simulator.
  • Android: :app:testDebugUnitTest passed (283 suites, no failures). ktlintMainSourceSetCheck still fails, but only on violations that were already there; the new files are clean.
  • New unit tests on both platforms:
    • time/day label (today, yesterday, this week, older, other year, future, 12/24 h)
    • drag mapping (follow, rubber band, cap, right drag clamps to 0, fade, direction lock, system edges)
    • accessibility value includes the time
    • derived v1 notices (changes only, variant change, server notices win, no agent/model)
  • Real apps against the scenario harness (opencode v2.2.2, fake model; the first exchange backdated to yesterday in the harness's own database):
    • footer gone at rest
    • left drag reveals "9:28 PM / Yesterday" on an older message and only the time on today's
    • springs back
    • right drag stays at 0
    • a vertical drag that starts on a bubble still scrolls
    • tap still opens the message actions sheet
    • live new messages render without a footer
    • dark and light on iOS and Android

Evidence

Screenshots are in the evidence comment.

Issue

Fixes #894

Risks / Follow-ups

  • v1 not checked in the real app: there's no 1.x opencode binary on this machine. The derived notices are covered by unit tests only.
  • iOS edge back-swipe: Session Chat hides the navigation bar, so there was no interactive back-swipe to keep. The reveal ignores drags that start within 20 pt of either edge anyway.
  • Attachment-only user messages (no text) have no text pill to carry the accessibility value, so the time isn't read for them.
  • Android shows the bubble's normal press highlight while it's being dragged (Material clickable indication).
  • Not checked: TalkBack/VoiceOver reading aloud on a device (covered by unit tests on the label value), and the iOS 17 fallback gesture (the simulator runs iOS 26).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Session Chat no longer draws the agent · model · time footer under user
messages. Dragging a user bubble left (with its attachment chips) reveals
its send time at the right edge, with the day under it for older
messages, and springs back on release. Vertical drags still scroll, right
drags do nothing, and tap / long-press message actions keep working.
VoiceOver and TalkBack still read the agent, model and time.

v1 records no agent/model change notices, so the timeline derives the same
"Agent changed" / "Switched to" notices from consecutive v1 user messages
(gated by a new recordsTimelineChangeNotices capability, true on v2).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

iOS (iPhone 16 Pro Max sim) and Android (Pixel 9a emulator), opencode v2 via the scenario harness with the fake model. The first exchange is backdated to yesterday in the harness's own database.

Step iOS Android
01 Footer gone (dark)
02 Mid-drag, older message shows the day (dark)
03 Mid-drag, today's message shows only the time (light)
04 Footer gone (light)

The blue dot in the mid-drag frames is the recorder's touch indicator.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: 1 finding(s) that 2+ of 3 passes agreed on.

9 finding(s) from a single pass, not posted
  • android/app/src/main/java/dev/opencode/mobile/ui/components/chat/OpenCodeMessageTimeReveal.kt:206 medium: Reveal ignores pointer consumption, fights list scroll (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/Components/Chat/OpenCodeOutgoingMessage.swift:122 medium: VoiceOver time mismatches revealed time in 24-hour locales (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/timeline/TimelineChangeNotices.kt:44 medium: Blank providerId not normalized, spurious model notice (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/components/chat/OpenCodeOutgoingMessage.kt:100 medium: Attachment-only user messages lose the agent/model/time accessibility value (deepseek-v4.1-flash)
  • ios/OpenCode Mobile/OpenCode Mobile/Components/Chat/OpenCodeOutgoingMessage.swift:150 medium: VoiceOver loses agent/model/time for attachment-only outgoing messages (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/ui/components/chat/OpenCodeMessageTimeReveal.kt:103 low: Same-year date ignores locale field order (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/Components/Chat/OpenCodeMessageTimeReveal.swift:10 low: 'Yesterday' hardcoded English, not localized (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/components/chat/OpenCodeMessageTimeReveal.kt:68 low: 'Yesterday' hardcoded English, not localized (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/Components/Chat/OpenCodeMessageTimeReveal.swift:163 low: Fallback edge check uses screen width, not window width (muse-spark-1.3-contributor)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.104 · 2 pass(es) stopped early

With the footer gone, a snackbar above the composer sat right on the last
user bubble (Android covered it). Both snackbar hosts now report the height
a shown snackbar takes, and Session Chat adds it to the timeline bottom
inset, so the last row keeps the usual 16 end gap above it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Gap between the last message and a snackbar

With the footer gone, a snackbar shown above the composer (here the one-time "Timeline: Activity Card" notice) sat on the last user bubble; it hid the bubble completely. While a snackbar shows, Session Chat now adds its height to the timeline's bottom inset, so the last message keeps the same 16 pt/dp end gap above the snackbar that it keeps above the composer. When the snackbar goes, the list settles back. Gaps between transcript rows stay at the shared 8 pt/dp message spacing on both platforms.

Captured against the scenario harness (opencode v2, scripted model), dark mode.

Step iOS Android
01 Before: snackbar covers the last bubble
02 After: 16 gap above the snackbar
03 After the snackbar dismisses

The time reveal locked onto a left drag after 8 dp of travel in any
direction, so a slightly diagonal swipe on a code block passed the reveal's
check before the block's own touch slop and lost its scroll. The reveal now
waits for the platform touch slop and yields once a child consumes the drag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko merged commit 009ac3e into main Oct 30, 2026
5 checks passed
@ivanfenenko
ivanfenenko deleted the feature/894-drag-reveal-message-time branch October 30, 2026 09:23
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.

Session Chat: reveal user message time by dragging the bubble left

1 participant