Skip to content

Differentiate between stylus input and pen tool - #1239

Closed
Nezznee wants to merge 4 commits into
LinwoodDev:developfrom
Nezznee:stylus
Closed

Differentiate between stylus input and pen tool#1239
Nezznee wants to merge 4 commits into
LinwoodDev:developfrom
Nezznee:stylus

Conversation

@Nezznee

@Nezznee Nezznee commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

#1203 , I hope that I've gotten all of them

@CodeDoctorDE

Copy link
Copy Markdown
Member

Hi, this change would also break the settings file format. Maybe we also need migrations or some kind of that?

@Nezznee

Nezznee commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Maybe something similar to the NoteData migrations just in app/lib/settings/data.dart importSettings(...) using regex for the lastVersion property?

@CodeDoctorDE

Copy link
Copy Markdown
Member

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

@Nezznee

Nezznee commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

I don't see a file version property for the settings file

@CodeDoctorDE

Copy link
Copy Markdown
Member

see settings.dart, its not really implemented currently

@CodeDoctorDE
CodeDoctorDE requested a balanced review from Copilot August 26, 2026 12:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CodeDoctorDE CodeDoctorDE left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@github-project-automation github-project-automation Bot moved this to 🚧 In Progress in Butterfly Aug 26, 2026
@Nezznee

Nezznee commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

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.

@Nezznee Nezznee closed this Aug 27, 2026
@github-project-automation github-project-automation Bot moved this from 🚧 In Progress to ✅ Done in Butterfly Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants