Skip to content

refactor: add timestamp support to TitleFormat for conversation replay#1776

Merged
tusharmath merged 11 commits intomainfrom
feat/titleformat-timestamp-support
Nov 8, 2025
Merged

refactor: add timestamp support to TitleFormat for conversation replay#1776
tusharmath merged 11 commits intomainfrom
feat/titleformat-timestamp-support

Conversation

@amitksingh1490
Copy link
Copy Markdown
Contributor

@amitksingh1490 amitksingh1490 commented Oct 26, 2025

Summary

Add optional timestamp support to TitleFormat to enable accurate timestamp preservation during conversation replay.

Usage

// Live conversation (existing behavior unchanged)
let title = TitleFormat::info("Processing file");

// Replay with preserved timestamp
let replay_title = TitleFormat::info("Processing file")
    .timestamp(saved_timestamp);

This enables the conversation replay system to display timestamps exactly as they occurred during the original conversation, while maintaining current behavior for live conversations.

- Add optional timestamp field to TitleFormat struct
- Update display logic to use replay timestamp when available, fallback to current time
- Add comprehensive tests for timestamp functionality
- Maintain backward compatibility for existing code

This enables accurate timestamp preservation during conversation replay
while keeping current behavior for live conversations.
@github-actions github-actions Bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Oct 26, 2025
Comment thread crates/forge_domain/src/chat_response.rs
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 1, 2025

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions Bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Nov 1, 2025
@github-actions github-actions Bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Nov 2, 2025
pub category: Category,
/// Optional timestamp for replay - when set, display logic uses this
/// instead of current time
pub timestamp: Option<chrono::DateTime<chrono::Utc>>,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pub timestamp: Option<chrono::DateTime<chrono::Utc>>,
pub timestamp: chrono::DateTime<chrono::Utc>,

Keep it required.

Comment thread crates/forge_main/src/title_display.rs Outdated
let local_time: chrono::DateTime<Local> = timestamp.into();
format!("[{}] ", local_time.format("%H:%M:%S"))
} else {
// Use current time for live conversations
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

display should only be concerned with formatting and not with generating timestamps.

@amitksingh1490 amitksingh1490 changed the title feat: add timestamp support to TitleFormat for conversation replay refactor: add timestamp support to TitleFormat for conversation replay Nov 6, 2025
@amitksingh1490 amitksingh1490 added type: chore Routine tasks like conversions, reorganization, and maintenance work. and removed type: feature Brand new functionality, features, pages, workflows, endpoints, etc. labels Nov 6, 2025
Comment thread crates/forge_main/src/title_display.rs Outdated
@@ -41,12 +41,9 @@ impl TitleDisplay {

// Add timestamp if requested
if self.with_timestamp {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

don't need this flag anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we need it because you can control if you want to show timestamp in the log.

@tusharmath tusharmath merged commit 98e26f6 into main Nov 8, 2025
9 checks passed
@tusharmath tusharmath deleted the feat/titleformat-timestamp-support branch November 8, 2025 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: chore Routine tasks like conversions, reorganization, and maintenance work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants