Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Make default sketch canvas ID autoincrement#7836

Open
limzykenneth wants to merge 1 commit intoprocessing:dev-2.0from
limzykenneth:sketch-id
Open

Make default sketch canvas ID autoincrement#7836
limzykenneth wants to merge 1 commit intoprocessing:dev-2.0from
limzykenneth:sketch-id

Conversation

Copy link
Member

limzykenneth commented May 21, 2025

Resolves #7834

Changes:
There are two parts to this PR, the first is to not assign an ID to the canvas element if it already has an ID thereby preserving the user intended one.

The second part makes the default ID (assigned when the canvas don't already have an ID) to have an autoincrementing number. This is done so that if there are multiple sketches created by the user, they will not all be assigned the same ID which is technically not good practice (ID should be unique). However, I'm not sure if this is the right approach because I'm also thinking whether we should assign default ID's to sketch canvas at all.

We already add a class to the canvas so they can be collectively selected if needed while the ID along with the autoincrementing aspect makes the numbering potentially unstable and so may not be entirely reliable as a selector. The ID is not used internally and externally it probably shouldn't be relied on to be a specific value since the ID is something that the user can change. So another potential solution is to remove the sketch ID assignment entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant