fix(dia.ToolsView): keep a tool hidden right after addTools() hidden in async mode - #3521
Merged
MartinKanera merged 1 commit intoSep 30, 2026
Merged
Conversation
…in async mode The first update of a tools view called `blurTool()` to make tools visible again after they had been hidden by `focusTool()` and removed before `blurTool()` could run (clientIO#1410). In async mode (or a frozen paper) that update is deferred, so it also un-hid tools the user hid explicitly right after `addTools()` (clientIO#1445). Reset the explicit visibility synchronously in `ToolView.configure()` instead, and drop the `blurTool()` call from the first update. Fixes clientIO#1445 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues remain, and all approval assessments are positive.
Review effort: Lite
Findings: None
What changed in this PR
Fixes deferred rendering so tools hidden immediately after addTools() remain hidden.
Changes:
- Reset tool visibility synchronously during configuration.
- Remove the deferred visibility reset.
- Add regression tests for sync, async, frozen, and re-add scenarios.
- Document the patch release.
| File | Description |
|---|---|
packages/joint-core/test/jointjs/dia/linkTools.js |
Adds visibility regression coverage. |
packages/joint-core/src/dia/ToolView.mjs |
Resets explicit visibility during configuration. |
packages/joint-core/src/dia/ToolsView.mjs |
Removes deferred visibility reset. |
.changeset/quiet-tools-hide.md |
Documents the patch release. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MartinKanera
approved these changes
Sep 30, 2026
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.
Description
Calling
hide()on a tool right afteraddTools()has no effect when the tools view update is deferred — anasync: truepaper, or a frozen paper:Cause: the first
ToolsView.update()afterconfigure()calledblurTool(), which callsshow()on every tool that is not explicitly visible. That call was added in #1410 to make tools visible again when a tools view is re-added after being removed mid-focusTool()(e.g. an arrowhead drag interrupted byremoveTools()onlink:mouseleave, soblurTool()is never called). In sync mode the first update runs insideaddTools(), before the user'shide(); in async mode it runs afterwards and undoes it.Fix: move the reset to where it belongs —
ToolView.configure()now resets the explicit visibility synchronously, insideaddTools(), and theblurTool()call is dropped from the first update (the update loop already renders every visible tool).Fixes #1445
Tests
New tests in
test/jointjs/dia/linkTools.js(Visibility):hide()right afteraddTools()stays hidden: async paper, and frozen paper. Both failed before the fix (display: inline).focusTool()are visible again afterremoveTools()+addTools(): sync and deferred update. Both passed before the fix and still pass — the old scenario stays covered.karma:joint: 2117 passed.Note: a tool whose drag is interrupted keeps its
focusOpacity(set byfocus(), cleared only byblur()). That is pre-existing and not addressed here.🤖 Generated with Claude Code