Skip to content

refactor: HistoryPreview and HistoryView components have lots of duplicated code between variants #4018

@KJ7LNW

Description

@KJ7LNW

The HistoryPreview and HistoryView components currently have significant code duplication between its compact and full variants:

  • Both variants share similar metadata display logic (timestamp, tokens, cost, cache info)
  • Both variants have similar button handling and workspace display
  • The large if/else structure makes maintenance difficult and error-prone

This duplication makes the code harder to maintain and increases the risk of inconsistencies when making changes. The metadata display logic particularly needs to be unified to ensure consistent behavior across both variants.

The component should be refactored to:

  • Use a single TSX structure with conditional styling
  • Extract shared metadata display into a reusable component
  • Minimize special cases between variants
  • Ensure consistent behavior for shared functionality

Metadata

Metadata

Assignees

Labels

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.UI/UXUI/UX related or focused

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions