fix(visimer/dom): stop hidden-mount lifeline collapse (PRD-8201) (#3743) - #35
Merged
Conversation
* fix(visimer/dom): skip lifeline correlation when the svg is hidden, retry when visible (PRD-8201) * fix(visimer/dom): scope hidden-mount guard + re-correlate without rebinding (PRD-8201) - correlate.ts: zero-bbox guard now only skips the lifeline block; message and note correlation (both index-based) still stamp data-mw-entity so clicks resolve to the right event even under hidden mount. - view.ts armVisibilityRetry: on visibility, re-runs correlateSequence instead of bindSvg. bindSvg registers 7 pointer/click listeners as fresh arrow closures, so re-invoking it double-fires each gesture (suppressed clicks stopped being suppressed; single taps opened the label editor). - correlate-hidden-mount.test: assert messages and notes still stamp under zero bbox. * docs(visimer/dom): visibilityRetryObserver re-correlates, does not rebind (PRD-8201) Field JSDoc still said 'retries bindSvg' from the first-round shape; implementation is now a re-correlate only. Update the doc to match so a maintainer reading the field declaration doesn't reintroduce the double-registration bug the second commit fixed. * fix(visimer/dom): consolidate hidden-mount predicate + tighten test (PRD-8201) - armVisibilityRetry now keys off seqCorrelation.lifelines.size instead of re-probing the bbox with inverted polarity, so the two predicates can't drift apart. - IO callback re-checks svg width before burning its one-shot; a zero-width mid-transition notification no longer locks in a degraded state. - Tighten the positive-case test to pin which lifeline each participant matched (line1 for alice, line2 for bob), not just that they differ. - Comment: 'display:none' is the case IO actually covers; drop the 'detached from document' half where IO behavior diverges across engines. * test(visimer/dom): cover armVisibilityRetry with a stub IntersectionObserver (PRD-8201) Pin the four contract points on the recovery half of the fix: - observer arms when correlation returned an empty lifelines map (hidden mount) - observer stays un-armed when correlation already produced lifelines - observer stays un-armed when there is no sequence graph - callback with intersectionRatio > 0 but still-zero bbox does not consume the one-shot, so a delayed reveal can still recover Uses Object.create(MermaidCanvasView.prototype) to bypass the constructor's editor / mermaid mount pipeline — armVisibilityRetry only touches three fields plus correlateSequence. * chore(visimer/dom): drop unused vi import from visibility-retry test (PRD-8201) GitOrigin-RevId: 503570d1a7e1bd3a84b757e7c6455a15579f0976
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.
Copybara-translated 1 Inkeep OSS change. Rebase-merge this PR so the prepared commit lands directly on public main.
Linear: this mirror replays a change that already merged upstream, so it must not drive ticket status.
skip PRD-8201