Skip to content

Conversation

@sAVItar02
Copy link

📝 Contract History Feature

Overview

This feature introduces a Contract History system that allows users to view, manage, and re-generate their previously created contracts.
It enhances the user experience by adding persistence and organization tools within the chatbot interface.


✨ Features

  • View Contract History: Users can see all previously generated contracts with metadata (name, date, type).
  • Favorites: Mark and unmark contracts as favorites for quick access.
  • Re-Generation: Re-generate contracts directly from history.
  • Persistent Storage: Contract data is saved using Local Storage to persist across browser sessions.
  • Error Handling: Graceful fallback and handling for local storage operations.
  • Type Safety: Added TypeScript interfaces for strong typing and better maintainability.

🧩 Technical Details

Files Added

  • src/pages/NotFoundPage — UI component displayed when a user visits a non-existent route.
  • src/hooks/useHistory.ts — Custom React hook for handling contract storage, state, read, and delete.
  • src/hooks/useFavorites.ts — Holds all the favoriting state and functions.
  • src/hooks/useMessages.ts — Moved all the messaging logic from the chatbot page to this hook.
  • src/components/Sidebar.tsx — UI Sidebar Component and all its logic.
  • src/components/ChatItem.tsx — UI Component that's displayed as a chat item on the sidebar.
  • src/assets/compass.png — Compass Image for the NotFoundPage.

Files Modified

  • src/services/Chatbot.tsx — Integrated contract history functionality.
  • src/components/ui/chatbot.css — Modified templates and chat page styles.
  • src/services/deepseekService.ts — Used the variable in env file instead of hardcoded ones
  • scr/components/TemplateSelector.tsx — Moved the templates into a modal and the Button into the sidebar

Technologies Used

  • React
  • TypeScript
  • Local Storage
  • State Management

@vercel
Copy link

vercel bot commented Oct 24, 2025

@sAVItar02 is attempting to deploy a commit to the ResilientDB's projects Team on Vercel.

A member of the Team first needs to authorize it.

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