Add timestamps and back-to-top pill to message stream#71
Merged
Conversation
- Add timestamp field to ProviderEvent variants (Text, UserText, ToolUse, ToolResult, Thinking, Error, Done, QuestionAsked) - Add messages_add_timestamp DB migration column - Update persist_event() to save timestamp to DB - Backfill missing timestamps on transcript load - Add format_timestamp_pill() utility with smart date/time formatting - Render timestamp pills for start-of-conversation, user messages, and newest message - Add conversation_created_at prop to MessageStream component - Add back-to-top navigation pill with scroll-to-top JS - Add live newest-timestamp update on WS events - Add timestamp-pill CSS classes (left-side, max 10% width) - Handle edge case: skip newest-pill for single-event conversations - Update all event construction sites to include timestamps
- Remove backfill_timestamp() function and call site from src/webapp/mod.rs - Change messages.timestamp column default from '' to '1970-01-01 00:00:00' - Remove now-unused ProviderEvent import from src/webapp/mod.rs
…p fields Old events stored before the timestamp field was added to ProviderEvent would fail to deserialize because the field was required (no serde(default)). This caused load_transcript() to return Err, and unwrap_or_default() in chat_handler_with_conv() would produce an empty Vec, showing 'No messages yet'. Add #[serde(default)] to every timestamp field so missing timestamps deserialize to NaiveDateTime::default() (year 0001) instead of erroring.
- Back-to-top pill: blue bg/white text matching jump-to-newest, positioned at top:1rem instead of near bottom, text wrapped in <span> - Jump-to-newest pill: text now wrapped in <span> to fix icon overlap - load_transcript: skip bad events with warning instead of failing all - chat_handler_with_conv: log error when loading transcript fails - Add tests verifying old (pre-timestamp) ProviderEvent deserialization and serde(default) handling for NaiveDateTime
- Back-to-top pill: moved from chat-input-wrapper (footer) to message-stream-container (absolute, top:1rem) so it appears near the top of the stream, not overlapping input - Newest-timestamp pill now includes <hr> separator above it, consistent with start/user timestamp layout - WS live handler: removes old newest-timestamp pill before appending new event, adds user-timestamp pill for user_text events, appends new newest-timestamp pill below the new event - Removed unused updateNewestTimestamp JS function
- conversations.rs and agent_runs.rs now include formatted timestamp in the WS payload for user_text broadcasts - JS handler can now create user-timestamp pill immediately when user sends a message (no page reload needed)
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.
Summary
Adds three categories of timestamp pills and a back-to-top navigation pill to the conversation message stream.
Changes
timestamp: chrono::NaiveDateTimeto everyProviderEventvariant with#[serde(default)]for backward compatibility. Addedtimestampcolumn migration to messages table (default Unix epoch). All event creation sites populateUtc::now().naive_utc().is-lightand occupy ≤10% of stream width.#[serde(default)]. Loading transcript skips malformed events per-event with warning instead of failing entirely.Commits
9 implementation commits + 1 migration count fix, building incrementally from data model through SSR rendering to JS live updates.