Skip to content

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

yiqun12
Copy link

@yiqun12 yiqun12 commented Jun 11, 2025

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.
image

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:
image

Case 1 : If user's InstalledVersion >= version threshold, use the corresponding versioned default. (E.g. 1.21.3)

image

Case 2 : Otherwise, fallback to the original defaultValue to preserve existing users' preferences. (E.g. 1.22.3)
image
image

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.

image
image
image

┆Issue is synchronized with this Notion page by Unito

@yiqun12 yiqun12 force-pushed the feat/version-default-searchbox branch from 0521f4a to 1f05568 Compare June 11, 2025 16:46
@yiqun12 yiqun12 marked this pull request as ready for review June 11, 2025 16:49
@yiqun12 yiqun12 requested review from a team as code owners June 11, 2025 16:49
Comment on lines 304 to 310
if (!settingStore.get('Comfy.InstalledVersion')) {
const currentVersion =
Object.keys(settingStore.settingValues).length > 0
? '0.0.1'
: getCurrentVersion()
await settingStore.set('Comfy.InstalledVersion', currentVersion)
}
Copy link
Contributor

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.

Copy link
Author

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?

Copy link
Author

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.

@yiqun12 yiqun12 marked this pull request as draft June 12, 2025 05:53
@yiqun12 yiqun12 marked this pull request as ready for review June 13, 2025 18:05
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.

2 participants