feat: activate direct editing for new activities and events#2408
feat: activate direct editing for new activities and events#2408
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the “activate direct editing on create” behavior so that newly created BPMN activities and events immediately open the label editor, aligning modeling behavior with #748.
Changes:
- Broaden direct-edit activation on create/auto-place from specific element types (Task, TextAnnotation, etc.) to all
bpmn:Activityandbpmn:Eventelements (while keeping existing behavior for TextAnnotation and Participant). - Extend label-editing creation tests to cover additional activity and event types, and explicitly verify that gateways do not trigger direct editing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/features/label-editing/LabelEditingProvider.js | Expands the element-type whitelist for direct editing activation to include all activities and events. |
| test/spec/features/label-editing/LabelEditingProviderSpec.js | Adds/adjusts tests to verify direct editing activation for more activities/events and non-activation for gateways. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| expect(directEditing.isActive()).to.be.true; | ||
| }); | ||
|
|
||
| it('on subProcess creation', function() { |
There was a problem hiding this comment.
Test description uses inconsistent capitalization: "subProcess" should match the BPMN type name ("SubProcess") like the other test cases (e.g., "StartEvent", "EndEvent"). This improves readability and keeps test names consistent.
| it('on subProcess creation', function() { | |
| it('on SubProcess creation', function() { |
| expect(directEditing.isActive()).to.be.true; | ||
| }); | ||
|
|
||
| it('on adHocSubProcess creation', function() { |
There was a problem hiding this comment.
Test description uses inconsistent capitalization: "adHocSubProcess" should match the BPMN type name ("AdHocSubProcess") like the other test cases. Keeping test titles consistent makes failures easier to scan.
| it('on adHocSubProcess creation', function() { | |
| it('on AdHocSubProcess creation', function() { |
Match BPMN type names (SubProcess, AdHocSubProcess) in test titles for consistency with other tests (StartEvent, EndEvent). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Proposed Changes
closes #748
Immediately open the name editor after creating any new activity (not just tasks) or any new event.
Activate-Direct-Editing.mov
Checklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool