Skip to content

fix(visimer/dom): stop hidden-mount lifeline collapse (PRD-8201) (#3743) - #35

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Aug 21, 2026
Merged

fix(visimer/dom): stop hidden-mount lifeline collapse (PRD-8201) (#3743)#35
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown

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

* 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
@inkeep-oss-sync
inkeep-oss-sync Bot merged commit d3e97f6 into main Aug 21, 2026
@inkeep-oss-sync
inkeep-oss-sync Bot deleted the copybara/sync branch August 21, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant