Back to App

Philingo English Reader

An AI-powered English reading application with vocabulary learning and TTS features

0xleizhang/philingo

支持项目发展

如果这个项目对你有帮助,欢迎通过爱发电支持开发者继续改进和维护

打赏支持

Core Features

  • AI-powered English reading interface
  • Text-to-Speech (TTS) functionality with audio caching
  • Vocabulary word highlighting and annotation
  • Multiple interaction modes (read, listen, pronounce, and write)
  • Auto-play and repeat modes for enhanced learning
  • Writing mode with fill-in-the-blank exercises
  • Word mastery tracking and progress analytics
  • Audio recording with Voice Activity Detection (VAD)
  • Local storage persistence for user data
  • Intelligent annotation caching for performance
  • Automated about page generation from changelog

Development Timeline

feature

1.0.0

-

Implemented comprehensive API status handling with real-time feedback system

API Status Bar

Added visual feedback system for API operations

  • Implemented thin status bar below header for real-time API status
  • Status bar shows animated pulse (brand color) during API loading
  • Status bar turns red with detailed error messages on API failures
  • Error messages auto-dismiss after 5 seconds
  • Displays operation context (e.g., "Looking up word definition", "Generating audio", "Analyzing pronunciation")
  • Minimal, non-intrusive design that doesn't disrupt user workflow

App Component State Management

Enhanced state management for API operations

  • Added apiStatus state to track loading, errors, and current operation
  • Implemented handleApiStart callback to notify API request initiation
  • Implemented handleApiSuccess callback to clear loading state
  • Implemented handleApiError callback with automatic error dismissal
  • Passes status callbacks to Reader component for centralized status management

Reader Component Integration

Integrated API status callbacks throughout Reader component

  • Added onApiStart, onApiSuccess, onApiError props to ReaderProps interface
  • Word definition lookup (fetchWordAnnotation) now reports status
  • TTS audio generation (fetchTTSAudio) now reports status
  • Pronunciation analysis (analyzePronunciation) now reports status
  • Enhanced error handling with user-friendly error messages
  • All API errors now provide specific error context to users

Error Messaging

Improved error communication to users

  • Replaced generic error handling with specific error messages
  • Error messages extracted from Error objects when available
  • Fallback to descriptive default messages for each operation type
  • Errors displayed prominently but non-blockingly in status bar

User Experience

Enhanced feedback and transparency

  • Users now always know when API operations are in progress
  • Clear indication of what operation is being performed
  • Immediate error feedback with actionable information
  • Reduced confusion when API calls fail or take time
feature

0.9.1

-

Enhanced Word component interaction and improved text formatting

Word Component Click Behavior

Improved click interaction in read mode for better UX

  • In read mode, clicking annotated words now plays pronunciation directly
  • Clicking unannotated words still looks up definition as before
  • Removed separate volume button for more compact UI
  • Only IPA transcription badge remains for cleaner appearance
  • Changed cursor to pointer when hovering over annotated words
  • Simplified handlePlay function by removing unnecessary state management

Audio Playback

Streamlined pronunciation playback logic

  • Removed isPlaying state and related loading indicators
  • Cleaner click-to-play experience
  • Removed Volume2 icon import (no longer needed)

Text Formatting

Improved Format button behavior

  • Format button now creates one sentence per line without empty lines
  • Added regex to remove any accidental empty lines
  • More compact and readable text layout
  • Updated comment to reflect "no empty lines" behavior

Code Quality

Minor improvements and cleanup

  • Reorganized imports for better readability
  • Simplified cursor class logic in read mode
  • Removed unnecessary state management code
feature

0.9.2

-

Added multi-provider support with OpenAI integration

Provider System Architecture

Implemented flexible multi-provider architecture

  • Added LLMProvider type supporting 'gemini' and 'openai'
  • Created unified llmService.ts interface layer
  • Provider selection automatically routes to appropriate service
  • All API functions now accept provider parameter
  • Maintains separate caches for each provider

OpenAI Service Integration

Full OpenAI API integration with feature parity

  • Implemented fetchTTSAudio using OpenAI TTS-1 model with "alloy" voice
  • Implemented fetchWordAnnotation using GPT-4o-mini for definitions and IPA
  • Implemented analyzePronunciation using Whisper-1 for transcription + GPT-4o-mini for analysis
  • Complete localStorage caching system with separate cache space
  • Cache keys prefixed with 'vocabflow_openai_' to avoid conflicts
  • Supports up to 20 TTS entries and 500 annotation entries

API Key Modal Enhancement

Updated modal to support provider selection

  • Added provider selection buttons (Gemini / OpenAI)
  • Dynamic UI that adapts to selected provider
  • Provider-specific help text and API key acquisition links
  • Placeholder text changes based on provider
  • Saves both API key and provider preference to localStorage

App Component Updates

Enhanced state management for provider support

  • Added provider state management
  • Loads provider preference from localStorage on mount
  • Passes provider to all child components
  • Updated warning messages to be provider-agnostic

Reader Component Integration

Updated Reader to support multiple providers

  • Accepts provider prop in ReaderProps
  • All API calls (TTS, annotation, pronunciation) pass provider parameter
  • Cache clearing considers current provider
  • Seamless switching between providers

Dependencies

Added OpenAI SDK

  • Added openai@^6.13.0 package
  • Configured with dangerouslyAllowBrowser for client-side usage
  • [object Object]

Documentation

Created comprehensive provider support documentation

  • Added PROVIDER_SUPPORT.md with detailed implementation guide
  • Documented model mappings (Gemini vs OpenAI)
  • Explained caching mechanism differences
  • Included security considerations and cost notes
  • Provided usage instructions for both providers

Technical Improvements

Code quality and maintainability enhancements

  • Abstracted provider-specific logic into separate services
  • Consistent error handling across providers
  • Type-safe provider parameter throughout the application
  • Clean separation of concerns between UI and service layers
feature

0.9.0

-

Added text history tracking, AI text generation, and enhanced explore page

Text History System

Implemented independent history tracking for practice texts

  • Added new localStorage key 'philingo_text_history' separate from current text storage
  • Automatically saves pasted texts to history when user starts reading
  • History entries include full text, timestamp, and preview
  • Prevents duplicate entries by updating timestamp for existing texts
  • Maintains up to 50 most recent history entries
  • History excludes default placeholder text

Explore Page - History Section

Added history display and management features

  • Created "Your History" section showing all saved practice texts
  • Each history card displays date, preview, and word count
  • Added expandable "Show full text" feature for history items
  • Implemented individual delete button for each history entry
  • Added "Clear History" button to remove all entries
  • History section auto-hides when empty
  • Click "Practice" button to reload any historical text

Explore Page - AI Text Generation

Added AI-powered custom text generation feature

  • New "Generate Text" button with gradient purple design
  • Modal interface for text generation with prompt input
  • [object Object]
  • Uses Gemini 2.0 Flash API for text generation
  • Generated texts automatically saved to history
  • Auto-redirect to main app after successful generation
  • Validates API key before generation
  • Error handling with user-friendly messages
  • Loading state with animated spinner

Navigation Enhancement

Improved navigation between main app and explore page

  • Logo and title now link to explore page
  • Added hover effect on logo link
  • Better visual feedback for clickable elements

Content Updates

Enhanced default text and about page content

  • Replaced default text with SEO-optimized project introduction
  • Added comprehensive feature descriptions for better discoverability
  • Included key learning benefits and usage instructions
  • Added "The Story Behind Philingo" section to about page
  • Story honors English teacher Phil and explains project inspiration
  • Describes evolution from personal tool to full platform
  • Reorganized about page with support section at top
refactor

0.8.0

-

Standardized interaction mode names for consistency

Type Definitions

Unified mode naming convention to use verb forms

  • Renamed 'reading' to 'read' for consistency
  • Renamed 'test' to 'pronounce' for clarity
  • Renamed 'writing' to 'write' for consistency
  • All modes now use verb infinitive form (read, listen, pronounce, write)

Reader Component

Updated all mode references and UI labels

  • Updated mode button labels to match new names
  • Updated mode tooltips and hints
  • Improved mode-related comments

Word Component

Updated mode checks for pronunciation practice

  • Updated mode comparisons to use new names
  • Improved code comments for clarity
feature

0.7.0

-

Enhanced UI with motivational quote and improved annotation caching

App Component

Added motivational quote to main interface

  • Integrated motivational quote to enhance user engagement
  • Improved overall user interface experience

API Key Modal

Enhanced API key configuration interface

  • Improved modal design and functionality
  • Better user experience for API key management

Writing Mode

Refined writing mode UI and interactions

  • Enhanced layout and component structure
  • Improved user feedback and interaction design

Gemini Service

Significantly improved annotation caching mechanism

  • Implemented robust annotation caching system
  • Added cache management and optimization
  • Enhanced performance for vocabulary annotations
  • Reduced API calls through intelligent caching

Word Mastery Service

Enhanced word mastery tracking

  • Improved mastery level calculation
  • Better data persistence and management
feature

0.6.0

-

Implemented writing mode with word mastery tracking

Writing Mode Component

Created new writing mode for vocabulary practice

  • Implemented interactive fill-in-the-blank exercises
  • Added word mastery tracking system
  • Created engaging writing practice interface
  • Integrated with vocabulary learning workflow

Reader Component

Enhanced reader with writing mode integration

  • Added mode switching between reading and writing
  • Improved component structure for mode handling
  • Enhanced user interaction flow

Feedback Panel

Enhanced feedback panel functionality

  • Improved feedback display and interaction
  • Better integration with learning modes

Word Mastery Service

Implemented comprehensive word mastery tracking system

  • Created mastery level calculation algorithm
  • Added progress tracking and persistence
  • Implemented word selection for practice
  • Enhanced learning analytics

Type Definitions

Extended type definitions for writing mode

  • Added new types for writing mode functionality
  • Improved type safety across components
feature

0.5.0

-

Added about page generator and audio recording with VAD

About Page Generator

Implemented automated about page generation

  • Created script to generate HTML about page from YAML changelog
  • Automated documentation generation process
  • Enhanced project documentation

Audio Recording Service

Implemented audio recording with Voice Activity Detection

  • Created audio recording service with VAD technology
  • Implemented automatic silence detection
  • Added recording session management
  • Enhanced audio input handling

Reader Component

Significant enhancements to reader functionality

  • Improved reading interface and interactions
  • Enhanced component structure
  • Better user experience

Feedback Panel

Enhanced feedback panel with new features

  • Improved feedback collection and display
  • Better user interaction design

Gemini Service

Major service improvements and optimizations

  • Enhanced API integration
  • Improved service reliability
  • Better error handling

Dependencies

Added new project dependencies

  • Added required packages for new features
  • Updated dependency configurations
feature

0.4.0

-

Enhanced playback features and audio caching

Reader Component

Added auto-play and repeat modes for better listening experience

  • Implemented auto-play functionality for continuous playback
  • Added repeat mode for vocabulary reinforcement
  • Updated interaction modes to 'reading' and 'listen'

Word Component

Enhanced interaction modes and hover functionality

  • Updated interaction modes to 'reading' and 'listen'
  • Added hover functionality specifically for listen mode
  • Improved user interaction feedback

Gemini Service

Implemented TTS audio caching and format conversion

  • Added TTS audio caching mechanism for performance optimization
  • Implemented PCM to WAV conversion for improved audio playback
  • Enhanced audio quality and playback reliability

Development Configuration

Added local settings configuration

  • Added local settings configuration for development environment
  • Improved developer experience
refactor

0.3.0

-

Code structure refactoring

Code Architecture

Refactored code structure for improved readability and maintainability

  • Reorganized component structure
  • Improved code modularity
  • Enhanced maintainability
  • Better separation of concerns
feature

0.2.0

-

Data persistence implementation

Application State

Persist input text to localStorage for data retention

  • Added localStorage integration
  • Implemented automatic text saving
  • Enhanced user experience with data persistence
  • Prevented data loss on page refresh
feature

0.1.0

-

Initial Philingo English Reader project

Core Features

Initialize Philingo English Reader project

  • Created React + TypeScript + Vite application
  • Implemented basic reading interface
  • Integrated Gemini API for AI capabilities
  • Set up TTS (Text-to-Speech) service
  • Created vocabulary word components
  • Implemented annotation badge system
  • Added API key configuration modal
  • Set up reader component with text rendering
initial

0.0.1

-

Initial repository setup

Repository

Initial commit

  • Created GitHub repository
  • Set up initial project structure

Development Highlights

Progressive feature enhancement
Focus on user experience and performance
Code quality and maintainability improvements
Audio caching for optimized performance
Data persistence for better UX
Comprehensive word mastery tracking system
Advanced annotation caching mechanism
Voice Activity Detection for audio recording

Built with ❤️ by Lei Zhang

Last updated: -