[improvement] Add comma key to kbd shortcuts menu #3535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From this issue: #3531
Add a description for the comma key in shortcuts modal of the ? menu in the bottom right
Change Type
sdk
— Changes the tldraw SDKdotcom
— Changes the tldraw.com web appdocs
— Changes to the documentation, examples, or templates.vs code
— Changes to the vscode plugininternal
— Does not affect user-facing stuffbugfix
— Bug fixfeature
— New featureimprovement
— Improving existing featureschore
— Updating dependencies, other boring stuffgalaxy brain
— Architectural changestests
— Changes to any test codetools
— Changes to infrastructure, CI, internal scripts, debugging tools, etc.dunno
— I don't knowOne more thing
I got a problem when I use the
kbd(str: string)
function, since the input parameter is,
but the internal logic has something like thisstr.split(',')[0]
, which will happen to ignore,
I just modify it by hard code for this case, I know it is not elegant enough.
export function kbd(str: string) { ++if (str === ',') return [','] return str .split(',')[0] .split('') .map((sub) => { const subStr = sub.replace(/\$/g, cmdKey).replace(/\?/g, altKey).replace(/!/g, '⇧') return subStr[0].toUpperCase() + subStr.slice(1) }) }
Hence, I think out another solution: maybe we could have a new convention for kdb to demonstrate a split, using space key instead of comma key.
I will be pleasure for further improvement about this, feel free to correct me :)