feat: add chat timestamps and normalise LLM output whitespace#56
Open
juman909 wants to merge 1 commit intovirtualcell:mainfrom
Open
feat: add chat timestamps and normalise LLM output whitespace#56juman909 wants to merge 1 commit intovirtualcell:mainfrom
juman909 wants to merge 1 commit intovirtualcell:mainfrom
Conversation
…ace (backend) Frontend – ChatBox.tsx: - Render the already-stored `timestamp` field below each message bubble. Previously the field was populated but never displayed, so users had no indication of when messages were sent. - Timestamp is locale-aware (toLocaleTimeString with hour/minute) and aligned to match the bubble side (right for user, left for assistant). Backend – llms_service.py: - After receiving the final LLM response in get_response_with_tools(), strip leading/trailing whitespace and collapse runs of 3+ consecutive newlines to a single blank line. - Fixes inconsistent spacing that appeared when tool results with extra blank lines were mirrored into the model's output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
ChatBox.tsx): Renders thetimestampfield that was already stored in everyMessageobject but never displayed. Each bubble now shows a locale-aware time string (e.g.2:34 PM) beneath it, aligned to the bubble's side.llms_service.py): After the final LLM response is returned inget_response_with_tools(), strips leading/trailing whitespace and collapses runs of 3+ consecutive newlines to a single blank line. This prevents extra spacing that appeared when tool results with excessive blank lines were mirrored into the model output.Both changes include thorough inline comments explaining the motivation and implementation decisions.
Test plan