Skip to content

AI Features Re-implementation Plan (Based on PR #780) #799

@Anxcye

Description

@Anxcye

AI Features Re-implementation Plan (Based on PR #780)

Background

PR #780 by @gwaanl contains a massive amount of AI feature improvements (147 files, +22,499/-1,388 lines). After careful review, I've decided not to merge this PR directly due to:

  1. Very large scope - difficult to review and test thoroughly
  2. Design philosophy differences - some changes don't align with the project's existing architecture (e.g., AI-only translation)
  3. Risk of instability - too many changes at once could introduce bugs

However, the features are valuable and well-implemented. This issue tracks the plan to re-implement these features incrementally with proper testing and architectural alignment.

Credits

All features listed below are based on the excellent work by @gwaanl in PR #780. During re-implementation, I will:

  • Reference the original implementation
  • Maintain code quality and project consistency
  • Credit @gwaanl in commit messages

Core Features to Re-implement

Phase 1: AI Provider Infrastructure (Priority: High)

  • AI Provider Center

    • Provider metadata storage system
    • Provider Center UI (CRUD operations)
    • Support for OpenAI-compatible, Claude, Gemini, DeepSeek
    • API key management
    • Multi API key rotation (round-robin)
    • API key auto-save with failure stats and cooldown
  • Model Management

    • Fetch and cache models for each provider
    • In-chat model quick switch
    • Manual model entry support

Phase 2: Enhanced AI Chat Experience (Priority: High)

  • Thinking Mode

    • Thinking level UI (off/auto/minimal/low/medium/high)
    • OpenAI Responses provider support
    • Gemini thinking wrapper
    • Claude thinking integration
    • Collapsible Answer/Thinking/Tools sections
  • Conversation Management

    • Conversation tree persistence (conversationV2)
    • Branchable chat history
    • Per-turn assistant variant switcher
    • Edit user message + regenerate from any turn
    • Rollback branches via variant switcher
  • Chat UI Improvements

    • Keep streaming while minimizing sheet
    • Persistent bottom sheet in reading page
    • Swipe-to-minimize functionality
    • Move chat streaming into provider (survive minimize/close)

Phase 3: Translation Enhancements (Priority: Medium)

Note: Keep multi-service translation UI, but enhance AI translation as an option

  • Inline Full-Text Translation

    • AI-specific prompt for full-text translation
    • Block-level translation units
    • Viewport queue + HUD progress indicator
    • Batch JSON translation
    • Translation cache and concurrency control
  • Translation Quality & Reliability

    • Auto-retry failed blocks
    • Stricter success detection
    • Failure reason tracking
    • Manual retry support
    • Prioritize current viewport translations
  • Translation UI

    • AppBar translation toggle
    • 3-mode toggle icons (off/original/translated)
    • Translation status in reading settings
    • Structural translation for links (preserve ``)
  • AI Translation Options (NOT AI-only)

    • AI provider override for translation
    • AI model override for translation
    • Keep existing multi-service support

Phase 4: Developer & Debug Features (Priority: Low)

  • Developer Options

    • AI diagnostic logs toggle
    • Vibration test page
    • Better developer settings organization
  • Sync & Backup

    • Include multi-provider encrypted API keys in v4 backup
    • Sync translate preferences

Implementation Strategy

  1. One feature at a time - each PR focuses on a single feature or small feature set
  2. Thorough testing - test each feature before moving to the next
  3. Architecture alignment - ensure new code follows project conventions
  4. Incremental rollout - users can benefit from features as they're completed
  5. Proper documentation - update docs and changelog for each feature

Timeline Estimate

  • Phase 1: 2-3 weeks
  • Phase 2: 3-4 weeks
  • Phase 3: 2-3 weeks
  • Phase 4: 1 week

Total: ~2-3 months (part-time development)

Related

Notes

This is a living document. Feature list and priorities may change based on:

  • User feedback
  • Technical challenges discovered during implementation
  • New feature requests

Discussion welcome! If you have suggestions on prioritization or implementation approach, please comment below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions