Skip to content

Feat better text detection#29

Open
nathanredblur wants to merge 9 commits intoonderceylan:mainfrom
nathanredblur:feat-better-text-detection
Open

Feat better text detection#29
nathanredblur wants to merge 9 commits intoonderceylan:mainfrom
nathanredblur:feat-better-text-detection

Conversation

@nathanredblur
Copy link

No description provided.

* Introduced API configuration options in the settings, allowing users to connect to an external AI proofreading service.
* Implemented functionality to test API connection and fetch available models.
* Updated storage management to handle API configuration and model source selection.
* Enhanced the background service to support API-based proofreading requests.
* Added UI elements for API configuration in the options page.
* Added support for Gemini and OpenAI-compatible APIs in the configuration options.
* Enhanced the API configuration UI to include new options for selecting API types.
* Implemented functionality to handle API-specific connection testing and model fetching.
* Updated the proofreading logic to accommodate different API response formats and correction handling.
* Refactored utility functions for improved code organization and reusability.
* Updated model readiness logic to check the model source before ensuring the proofreader model is ready.
* Refactored the isModelReady function to include model source in its checks.
* Improved consistency in handling model readiness across different modules (main, options, sidepanel).
* Added retrieval of model source from storage to update the model source cache during badge listener registration.
* Modified the API request structure to include the system prompt in the user message for improved context during proofreading.
* Removed the ContentHighlighter component and its associated logic from the proofreading manager.
* Introduced ContentEditableTargetHandler to manage highlighting and interaction for content-editable elements.
* Updated the proofreading manager to utilize the new handler for attaching, highlighting, and managing corrections.
* Adjusted tests and popover manager to reflect the removal of ContentHighlighter and ensure compatibility with the new handler.
* Added a new utility module for handling contenteditable text extraction and offset resolution.
* Replaced direct text content access with the new utility functions across multiple components, enhancing consistency in text handling.
* Updated the proofreading manager, contenteditable target handler, and options setup to utilize the new extraction logic for improved accuracy in text processing.
…traction tests

* Added new tests for clipboard utility functions, including mock implementations for better isolation.
* Introduced a new test suite for contenteditable text extraction and offset resolution, covering various scenarios for accurate text handling.
* Implemented mock classes to simulate DOM elements and improve test reliability.
… functionality

* Introduced debouncing for the onNeedProofread callback in the ContentEditableTargetHandler to optimize performance during rapid input events.
* Updated the ProofreadingManager to handle element registration and auto-proofreading checks more effectively.
* Added comprehensive tests for the ContentEditableTargetHandler to ensure correct behavior during input handling and proofread triggering.
* Refactored existing logic to improve clarity and maintainability in both the proofreading manager and contenteditable handler.
…nd state management

* Updated the ProofreadingManager to replace highlight clearing with selection clearing and introduced a new method for soft invalidation of elements.
* Enhanced the ContentEditableTargetHandler to trigger rendering updates when issues are present during input handling.
* Added a new utility module for computing incremental text selections and shifting corrections based on text changes.
* Introduced comprehensive tests for the new text-diff utilities to ensure accurate detection of text changes and correction adjustments.
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