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
14
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,673
−270
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9597d3a
feat: implement destroy() in adapters and plugins
gohabereg 0dd4459
test(editorjs): e2e coverage for editor destroy
gohabereg 0ac06b5
test(editorjs): drop the #174 expected-failure markers
gohabereg 0f4c3f3
feat(ui): destroy inline tool instances with their popover
gohabereg 5e757a9
chore(openspec): archive editor-destroy
gohabereg 1fcdae5
fix: release the remaining listeners through AbortController
gohabereg cd4a0d9
docs(openspec): align editor-destroy specs with the implementation
gohabereg b6c295e
fix(ui): bump @editorjs/ui-kit to 2.0.1 to release the hint tooltip
gohabereg fd562f2
docs: fix the plugin lifecycle diagram failing to render
gohabereg 7f60c79
fix: stop the adapter and inline toolbar destroying shared inline tools
gohabereg 0ea282b
fix(dom-adapters): stop the selection watcher holding a destroyed input
gohabereg 31e4248
docs(openspec): fold the interrupted tool preparation into the core spec
gohabereg 3445ecc
docs: initialize() rejects with an AbortError when destroyed mid-way
gohabereg 74e86a3
docs: the inline tool facade owns its shared instance
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.
File renamed without changes.
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 not destroyed with their popover | ||
| - **GIVEN** the inline toolbar builds its popover from inline tool instances, which their facades share with every other consumer | ||
| - **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** no inline tool instance's `destroy()` is called by the toolbar; each tool's facade destroys its instance once, on editor teardown | ||
|
|
||
| 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.
Uh oh!
There was an error while loading. Please reload this page.