Repository navigation
feat: implement destroy() in adapters and plugins #207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gohabereg
wants to merge
9
commits into
feat/editor-destroy-lifecycle
Choose a base branch
from
feat/editor-destroy-plugins
base: feat/editor-destroy-lifecycle
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,625
−220
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
47c1220
feat: implement destroy() in adapters and plugins
gohabereg b44dea1
test(editorjs): e2e coverage for editor destroy
gohabereg f74f818
test(editorjs): drop the #174 expected-failure markers
gohabereg d5986e6
feat(ui): destroy inline tool instances with their popover
gohabereg 76535c7
chore(openspec): archive editor-destroy
gohabereg 5091abb
fix: release the remaining listeners through AbortController
gohabereg 114fdab
docs(openspec): align editor-destroy specs with the implementation
gohabereg 5b260d7
fix(ui): bump @editorjs/ui-kit to 2.0.1 to release the hint tooltip
gohabereg d989429
docs: fix the plugin lifecycle diagram failing to render
gohabereg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
File renamed without changes.
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
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
2 changes: 1 addition & 1 deletion
2
...editor-destroy/specs/architecture/spec.md → ...editor-destroy/specs/architecture/spec.md
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../changes/editor-destroy/specs/sdk/spec.md → ...26-10-16-editor-destroy/specs/sdk/spec.md
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
32 changes: 32 additions & 0 deletions
32
openspec/changes/archive/2026-10-16-editor-destroy/specs/ui/spec.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| ## MODIFIED Requirements | ||
|
|
||
| ### Requirement: UI plugin listener lifetime | ||
| Each UI plugin SHALL unsubscribe its own EventBus and DOM listeners when destroyed, detach its owned holder, and dispose its owned popover. Destroying one instance SHALL leave other consumers on the shared EventBus active. Teardown SHALL be safe to repeat. | ||
|
|
||
| #### Scenario: Events after teardown | ||
| - **GIVEN** a UI plugin has been destroyed | ||
| - **WHEN** the shared EventBus emits a previously subscribed event or a retained DOM element receives an event | ||
| - **THEN** that instance no longer renders, moves elements, or dispatches UI actions | ||
| - **AND** unrelated listeners and a replacement plugin still receive their events | ||
|
|
||
| #### Scenario: Pending inline toolbar configuration | ||
| - **GIVEN** inline tool configuration is still resolving when the toolbar is destroyed | ||
| - **WHEN** the configuration finishes resolving | ||
| - **THEN** no popover is created, shown, or positioned by the destroyed toolbar | ||
|
|
||
| #### Scenario: Opening a destroyed toolbox | ||
| - **GIVEN** `ToolboxUI` has been destroyed | ||
| - **WHEN** its `open()` is called | ||
| - **THEN** no popover is shown and no `ToolboxOpenedUIEvent` is dispatched | ||
|
|
||
| #### Scenario: Repeated teardown | ||
| - **GIVEN** a UI plugin has been destroyed | ||
| - **WHEN** `destroy()` is called again | ||
| - **THEN** it returns without releasing anything a second time | ||
|
|
||
| #### Scenario: Inline tool instances are released with their popover | ||
| - **GIVEN** the inline toolbar created inline tool instances to build its popover | ||
| - **WHEN** the popover is rebuilt for a new selection, the toolbar is hidden, a render is superseded before it finishes, or the toolbar is destroyed | ||
| - **THEN** each instance created for that popover has its optional `destroy()` called once, and the instances behind the popover still shown are not destroyed | ||
|
|
||
| Validated by `src/lifecycle.spec.ts` using real DOM/EventBus listeners and a substituted popover boundary. Vendor-owned global listener internals are outside this requirement's verification scope. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file could not be rendered