Skip to content

Add compare functionality to model cards#15

Open
small-tou wants to merge 3 commits intomainfrom
compare-feature
Open

Add compare functionality to model cards#15
small-tou wants to merge 3 commits intomainfrom
compare-feature

Conversation

@small-tou
Copy link
Copy Markdown
Owner

@small-tou small-tou commented May 30, 2024

Related to #12

This pull request introduces the ability to add and remove models from a comparison list directly from the model cards, along with displaying the comparison list on the page and persisting it across sessions using localStorage.

  • ModelCard Component Enhancements: Adds "Add to Compare" and "Remove from Compare" buttons to each model card. Implements conditional rendering to toggle between these buttons based on whether the model is currently in the compare list.
  • Page State Management: Updates the main page component to include state management for the compare list, adding and removing models from the list, and rendering a new section to display models currently in the compare list. It also ensures that the compare list is stored in and retrieved from localStorage, allowing the list to persist across page refreshes.
  • Price Calculation Update: Ensures that the models' token prices are calculated as part of the overall logic, including those models added to the compare list.
  • Utility Functions: Adds utility functions in src/lib/utils.ts for managing the compare list in localStorage, including adding, removing, and checking for the presence of models in the list.

For more details, open the Copilot Workspace session.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
llm-price ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 9:11am

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