feat: add behavior names and trace logging#2218
Draft
christianhg wants to merge 2 commits intomainfrom
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: c9481a8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Add optional name?: string to the Behavior type for debug tracing. Name all 116 behaviors across core, abstract, and plugin files. Core behaviors use their existing variable names (e.g., clearListOnEnter). Abstract behaviors use names derived from their purpose (e.g., deleteBackwardMergeBlocks).
Add debugEnabled.behaviors flag to guard string formatting. Log entry (event type, mode, candidate count), per-behavior guard results, and skipped remainder count. Indent nested raise/forward/execute calls. Enable with localStorage.debug = 'pte:behaviors' in browser or DEBUG=pte:behaviors in Node.
24e53c1 to
c9481a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two commits:
1. Add
namefield toBehaviortype and name all behaviorsAdd optional
name?: stringto theBehaviortype. Name all behaviors across core, abstract, plugin, toolbar, and playground files:clearListOnEnter,breakingAtTheEndOfTextBlock)deleteBackwardMergeBlocks,firefoxEnterCollapse)toolbar:decoratorShortcut:code,toolbar:mutuallyExclusiveAnnotation:link)pasteLinkOnSelection,typeahead:escape,typeahead:submitMatch)codeEditor:moveBlockUp)2. Add trace logging to
performEventAdd
debugEnabled.behaviorsflag todebug.tsto guard string formatting in the hot path. Add structured trace output to the behavior evaluation loop:Nested
raise/forward/executecalls indent automatically:Enable with
localStorage.debug = 'pte:behaviors'in browser orDEBUG=pte:behaviorsin Node.