Skip to content

Conversation

@NicholusMuwonge
Copy link
Contributor

Summary

  • Implements the Asset History tab (Tab 2) in the Reports screen
  • Select any asset to view its complete movement history as a visual timeline
  • Includes CSV export functionality and date range filtering
  • Searchable asset dropdown with integrated search

Features

  • Asset Selector: Searchable dropdown showing all assets with name + identifier format
  • Summary Card: Shows locations visited, time tracked, and current location
  • Movement Timeline: Visual timeline grouped by date with duration progress bars
  • CSV Export: Download asset history as CSV file
  • Date Range Filter: Filter timeline by date range

Technical Details

New Components

  • AssetHistoryTab.tsx - Main tab container
  • AssetSelector.tsx - Searchable dropdown for asset selection
  • AssetSummaryCard.tsx - Asset stats summary card
  • DateRangeInputs.tsx - From/To date pickers
  • ExportCsvButton.tsx - CSV export trigger

New Hooks

  • useAssetHistoryTab.ts - Main tab state management
  • useExportCsv.ts - CSV export logic

New Utilities

  • exportCsv.ts - CSV generation and download

Test plan

  • Navigate to Reports → Asset History tab
  • Open asset dropdown and verify searchable functionality
  • Select an asset and verify summary card appears with stats
  • Verify timeline displays with date groupings and duration bars
  • Change date range and verify timeline updates
  • Click Export CSV and verify file downloads
  • Test on mobile viewport for responsive layout

🤖 Generated with Claude Code

NicholusMuwonge and others added 4 commits January 30, 2026 13:31
- Asset-centric view: select asset → see all locations visited
- Searchable asset dropdown with From/To date pickers
- Summary stats: locations visited, time tracked, current location
- Reuses existing MovementTimeline component
- CSV export functionality

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add AssetHistoryTab component with asset selector, date range inputs, and timeline
- Add AssetSelector with searchable dropdown for asset selection
- Add AssetSummaryCard showing locations visited, time tracked, current location
- Add DateRangeInputs with From/To native date pickers
- Add ExportCsvButton with loading state for CSV export
- Add useAssetHistoryTab hook managing all tab state and data fetching
- Add useExportCsv hook for CSV generation and download
- Add exportCsv utility functions for CSV generation
- Rename tab from "Movement History" to "Asset History" per mockup
- Replace placeholder with full AssetHistoryTab implementation

Closes TRA-323

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rewrite AssetSelector as searchable dropdown with integrated search
- Fix tab isolation (search/filters only show on Current Locations tab)
- Fix default tab to Current Locations instead of Stale Assets
- Fix empty state styling to fill width properly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

🚀 Preview Deployment Update

✅ This PR has been successfully merged into the preview branch.

The preview environment will update shortly at: https://app.preview.trakrf.id

@railway-app railway-app bot temporarily deployed to trakrf / production January 30, 2026 15:46 Inactive
- Create useAssetSelector hook for dropdown state and handlers
- Update useExportCsv hook to take props and return computed state
- Make AssetSelector and ExportCsvButton pure presentational components
- No useEffect, no helper functions in TSX files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

🚀 Preview Deployment Update

✅ This PR has been successfully merged into the preview branch.

The preview environment will update shortly at: https://app.preview.trakrf.id

@railway-app railway-app bot temporarily deployed to trakrf / production January 30, 2026 20:44 Inactive
Change from ISO format (2026-01-30T10:30:00Z) to readable format
(Jan 30, 2026 10:30 AM) in exported CSV files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

🚀 Preview Deployment Update

✅ This PR has been successfully merged into the preview branch.

The preview environment will update shortly at: https://app.preview.trakrf.id

@railway-app railway-app bot temporarily deployed to trakrf / production January 30, 2026 20:55 Inactive
@NicholusMuwonge NicholusMuwonge merged commit 118bd17 into main Jan 30, 2026
6 checks passed
@NicholusMuwonge NicholusMuwonge deleted the feature/TRA-323-movement-history-tab branch January 30, 2026 21:08
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.

1 participant