Skip to content
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

[WIP] Add AI Chat Entry Point #5415

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

Conversation

nshuba
Copy link
Collaborator

@nshuba nshuba commented Dec 19, 2024

Task/Issue URL:

Description

Steps to test this PR

Feature 1

  • [ ]
  • [ ]

UI changes

Before After
!(Upload before screenshot) (Upload after screenshot)

@nshuba nshuba force-pushed the nastia/feature/ai_chat_entry branch 2 times, most recently from 9ba9628 to eaca222 Compare December 21, 2024 17:37
@nshuba nshuba force-pushed the nastia/feature/ai_chat_entry branch from eaca222 to faa5cbc Compare December 21, 2024 17:42
@nshuba nshuba changed the title [WIP] Testing [WIP] Add AI Chat Entry Point Dec 25, 2024
moshi.adapter(DuckChatSettingJson::class.java)
}

override fun isEnabled(): Boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make it suspend and directly assign dispatchers.io()

Suggested change
override fun isEnabled(): Boolean {
override suspend fun isEnabled(): Boolean = withContext(dispatchers.io()) = {

}
}

override fun showInBrowserMenu(): Boolean {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make it suspend and assign dispatchers.io()

.stateIn(appCoroutineScope, SharingStarted.Eagerly, true)

override suspend fun setShowInBrowserMenu(showDuckChat: Boolean) {
store.edit { prefs -> prefs[DUCK_CHAT_SHOW_IN_MENU] = showDuckChat }
Copy link
Collaborator

Choose a reason for hiding this comment

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

In what thread is the block inside store.edit{} executed?

@joshliebe joshliebe self-assigned this Jan 6, 2025
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.

3 participants