Skip to content

✨ Add marketing definition support to search interface #2655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

guiyanakuang
Copy link
Member

close #2654

@guiyanakuang guiyanakuang added this to the CrossPaste 1.1.2 milestone Apr 25, 2025
@guiyanakuang guiyanakuang self-assigned this Apr 25, 2025
@guiyanakuang guiyanakuang requested a review from Copilot April 25, 2025 03:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds marketing definition support to the search interface and related view models while refactoring dependency injection and paste data handling to conditionally support both marketing and general paste types. Key changes include:

  • Updating DesktopCrossPasteModule to bind new marketing paste models when marketingMode is enabled.
  • Refactoring PasteSearchViewModel into an abstract class and adding dedicated implementations for marketing and general paste searches.
  • Introducing new classes for managing marketing paste data and updating paste item models to handle an optional basePath.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/desktopMain/kotlin/com/crosspaste/DesktopCrossPasteModule.kt Updated DI configuration to conditionally provide marketing paste view models.
app/src/commonMain/kotlin/com/crosspaste/ui/model/PasteSearchViewModel.kt Refactored to be abstract for supporting distinct search view models.
app/src/commonMain/kotlin/com/crosspaste/ui/model/MarketingPasteSearchViewModel.kt Added new view model for marketing paste search functionality.
app/src/commonMain/kotlin/com/crosspaste/ui/model/MarketingPasteDataViewModel.kt Modified to rely on a single dependency for marketing paste data.
app/src/commonMain/kotlin/com/crosspaste/ui/model/MarketingPasteData.kt Introduced new class for constructing marketing paste data.
app/src/commonMain/kotlin/com/crosspaste/ui/model/GeneralPasteSearchViewModel.kt Added general paste search view model using paste DAO integration.
app/src/commonMain/kotlin/com/crosspaste/paste/item/RtfPasteItem.kt Updated to support an optional basePath and added a TODO for image updates.
app/src/commonMain/kotlin/com/crosspaste/paste/item/PasteRtf.kt Added basePath property to the interface.
app/src/commonMain/kotlin/com/crosspaste/paste/item/PasteHtml.kt Added basePath property to the interface.
app/src/commonMain/kotlin/com/crosspaste/paste/item/HtmlPasteItem.kt Updated to support an optional basePath and added a TODO for image updates.
Comments suppressed due to low confidence (2)

app/src/commonMain/kotlin/com/crosspaste/paste/item/RtfPasteItem.kt:105

  • [nitpick] The clear() function only deletes the file when basePath is null; please verify that this behavior is correct when a custom basePath is provided.
if (basePath == null) {

app/src/commonMain/kotlin/com/crosspaste/paste/item/HtmlPasteItem.kt:105

  • [nitpick] The clear() function only deletes the file when basePath is null; confirm that this behavior is intended for HTML paste items when a custom basePath is used.
if (basePath == null) {

@guiyanakuang guiyanakuang merged commit 1593ed1 into main Apr 25, 2025
2 checks passed
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.

Add marketing definition support to search interface
1 participant