Skip to content

Conversation

@Boxuan-Matty-Lin
Copy link
Owner

This pull request introduces a major refactor and feature enhancement to the currency converter app, focusing on modularizing the codebase, improving user experience, and adding a new interactive historical chart feature for currency rates. The sidebar is now fully controlled by the parent component, and the main page manages all data fetching, error handling, and UI state. The historical chart is displayed responsively, either inline or in a modal, and is accessible via the currency sidebar. Several new reusable chart components have been added with improved accessibility and UI polish.

Key changes:

Feature: Historical Chart Integration & Modal Display

  • Added a new historical chart feature using the ChartWithInfo, HistoricalChart, and InfoCollapsible components, showing 2-week exchange rate trends for the selected currency. The chart appears inline on desktop and in a modal on mobile, with responsive design and accessibility improvements. (app/page.tsx, components/charts/ChartWithInfo.tsx, components/charts/HistoricalChart.tsx, components/charts/InfoCollapsible.tsx) [1] [2] [3] [4] [5]

Refactor: Sidebar and Data Flow

  • Refactored the CurrencySidebar to be a pure, controlled component, moving all data fetching, error handling, and selected state management to the parent (app/page.tsx). The sidebar now receives props for rates, amount, loading, error, and selected currency, as well as all relevant event handlers. (components/sidebar/CurrencySidebar.tsx, app/page.tsx) [1] [2] [3] [4] [5] [6]

Enhancement: Currency Card Accessibility & Interactivity

  • Improved CurrencyCard to support keyboard navigation, selection state, and ARIA attributes, making the currency selection accessible and visually distinct when selected. (components/sidebar/CurrencyCard.tsx) [1] [2] [3]

API & Type Improvements

  • Centralized currency codes and metadata as TARGET_CODES and CURRENCY_META, and exported types for better type safety and reusability across components. (components/sidebar/CurrencySidebar.tsx)

These changes significantly improve the modularity, accessibility, and user experience of the currency converter app, while laying the groundwork for further feature enhancements.

@Boxuan-Matty-Lin Boxuan-Matty-Lin added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 30, 2025
@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 60.46% 104 / 172
🔵 Statements 62.23% 117 / 188
🔵 Functions 61.11% 33 / 54
🔵 Branches 34.78% 64 / 184
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
components/sidebar/CurrencyCard.tsx 58.33% 70.37% 75% 63.63%
components/sidebar/CurrencySidebar.tsx 100% 81.81% 100% 100%
Generated in workflow #18 for commit 729c0a3 by the Vitest Coverage Report Action

@Boxuan-Matty-Lin Boxuan-Matty-Lin merged commit 829b114 into dev Oct 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants