Differentiate between stylus input and pen tool - #1239
Conversation
|
Hi, this change would also break the settings file format. Maybe we also need migrations or some kind of that? |
|
Maybe something similar to the NoteData migrations just in app/lib/settings/data.dart importSettings(...) using regex for the lastVersion property? |
|
yeah but i wouldn't do regex and instead search for the exact property names. Increment the file version and then add a migration like with notedata. in this if branch i would just make a map replacements with old value and new value and replace it then |
|
I don't see a file version property for the settings file |
|
see settings.dart, its not really implemented currently |
CodeDoctorDE
left a comment
There was a problem hiding this comment.
This only migrates imported settings files. Existing SharedPreferences still contain pen_only_input, show_pen_only_toggle and an input_configuration using the old pen/Pen keys. fromPrefs() reads those directly with the new names, so upgrading users will lose their pen-only preference and custom stylus mappings/shortcuts. We either need to migrate the persisted preferences on startup or keep the old storage/JSON keys for compatibility. Maybe we can also use _migrateSettings there?
For _migrateSettings:
The serialized field is fileVersion, but the migration checks file_version, so the exported version is never actually detected. Also the v0→v1 migration should rename the top-level penOnlyInput and showPenOnlyToggle fields in addition to the inputConfiguration fields; otherwise importing an old settings backup silently resets those values.
|
You're probably right. It's a bit overkill to migrate the file formats which the normal user won't ever see. For consistency I'll leave the /app/ alone (some things would be called pen and some stylus) and only do localization + docs. |
#1203 , I hope that I've gotten all of them