-
Notifications
You must be signed in to change notification settings - Fork 302
Feat/version default searchbox #4135
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
base: main
Are you sure you want to change the base?
Conversation
0521f4a
to
1f05568
Compare
src/components/graph/GraphCanvas.vue
Outdated
if (!settingStore.get('Comfy.InstalledVersion')) { | ||
const currentVersion = | ||
Object.keys(settingStore.settingValues).length > 0 | ||
? '0.0.1' | ||
: getCurrentVersion() | ||
await settingStore.set('Comfy.InstalledVersion', currentVersion) | ||
} |
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.
Might be better to just not write the value if they are not a new user, as opposed to writing 0.1.1
which is most likely inaccurate.
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.
Would it be better to set the field to an empty string (""), or simply omit the field entirely if it's not a new user?
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.
You're right. I’ve decided to assign an empty value to the key for existing users, instead of setting an ambiguous value.
…omfy-Org/ComfyUI_frontend into feat/version-default-searchbox
issue #4073
issue #3652
Summary
Implement versioned default settings system to allow changing default values for new users while preserving existing users' preferences.
What this PR does
1.Introduced Comfy.InstalledVersion to record each user's initial install version.

2.When a user first loads the app, if no InstalledVersion exists, write the current app version to settings; otherwise default to 0.0.1(to identify existing users. or should i just empty??????) for existing users to ensure backward compatibility.
3.Added defaultsByInstallVersion field to SettingParams to define versioned default values.
4.When reading default values:

Case 1 : If user's InstalledVersion >= version threshold, use the corresponding versioned default. (E.g. 1.21.3)
Case 2 : Otherwise, fallback to the original defaultValue to preserve existing users' preferences. (E.g. 1.22.3)


3.Updated version check logic to ensure new defaults only apply to new users while protecting legacy users from config changes.
4.Added helper logic to simulate versioning scenarios for testing by modifying getCurrentVersion().
Reproduction Logic
Start the app in multi-user mode and log in with a brand new user
For those who does not have Comfy.InstalledVersion yet. The system will automatically send a request to store the current version as the user's initial installed version.
You can simulate different versions by temporarily modifying the return value of getCurrentVersion() in /src/utils/versioning.ts.
For example, set it to 1.20.1 and then log in as a new user. You will see that Comfy.InstalledVersion is now recorded as 1.20.1.
In this scenario, the Link Release setting will default to CONTEXT_MENU. Otherwsie if did not modify to old version, it would use the corresponding versioned default.
After restoring getCurrentVersion() back to normal and restarting the app, the stored Comfy.InstalledVersion will remain 1.20.1 for that user — it won't be overwritten.
Even as the app version upgrades in the future, existing users will continue to use the default value CONTEXT_MENU, ensuring backward compatibility and preventing config changes for legacy users. This behavior fulfills the design goal: Store an installedVersion setting when a user first runs the application.
┆Issue is synchronized with this Notion page by Unito