-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Improve plus user onboarding #1160
Improve plus user onboarding #1160
Conversation
@@ -265,6 +265,7 @@ export default class ChatModelManager { | |||
|
|||
async setChatModel(model: CustomModel): Promise<void> { | |||
const modelKey = getModelKeyFromModel(model); | |||
setModelKey(modelKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@logancyang Attention! This change is critical. Otherwise, there is a race condition that can lead to infinite loop. This setter must be called before the async getModelConfig call.
@@ -63,6 +64,7 @@ export default class CopilotPlugin extends Plugin { | |||
// Initialize BrevilabsClient | |||
this.brevilabsClient = BrevilabsClient.getInstance(); | |||
this.brevilabsClient.setPluginVersion(this.manifest.version); | |||
await checkIsPlusUser(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function checks plus status on load
9282763
to
b2942ff
Compare
df614a1
to
a4cd109
Compare
a4cd109
to
e61d958
Compare
This is a great insight! It makes me wonder whether auto switch embedding model is a good idea. I think two changes are needed:
|
@zeroliu tried again and saw an issue: when a valid license key becomes invalid, the chat model still get updated to gpt-4o even though the default model value was not switched. And if I click reset to default settings, the license key still exists. Is that intentional? |
src/plusUtils.ts
Outdated
updatePlusUserSettings(true); | ||
// Do not show the welcome modal if the user is already a plus user before | ||
// 2024/02/04 (isPlusUser === undefined) | ||
if (isPlusUser === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be isPlusUser !== true
? Right now this welcome modal is not showing up for new users (undefined).
This is fixed now.
This is related to my last debounce and uncontrolled settings change. It's also fixed now.
isPlusUser set to undefined was intentional to hide the welcome dialog for the existing paid users. I overlooked the impact on users who clicks resetSettings. For new users, this should be fine because the onload event will set the value to false first. I changed the default value to false now and it will show to existing paid users once they upgrade. I think about it again and think it's an acceptable experience. |
@logancyang added another round of iteration with the following changes:
|
No description provided.