Skip to content

Dependency injection: a rewired link's old route leaves, emphasized, with its card - #81

Merged
agorischek merged 3 commits into
mainfrom
agorischek/di-rewired-emphasis
Nov 20, 2026
Merged

agorischek merged 3 commits into
mainfrom
agorischek/di-rewired-emphasis

Conversation

@agorischek

@agorischek agorischek commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes a dependency-injection animation bug: when a removed card leaves, one edge into it could be drawn grey and solid instead of red and dashed.

Cause. A rewired relationship keeps one ID but points somewhere new (here OrdersController's dependency moves from IOrderService to IOrderQueries). Its old route was scheduled in the relationship's own step, but it can't outlive the card it points to. When that card leaves in an earlier step, the route faded out with it while its emphasis was still 0: neutral grey and solid, beside the card's other removed edges.

Fix. A link part drawn by only one revision now follows the step that takes it away or brings it in:

  • a leaving part takes the earliest of its own step and its leaving cards' steps;
  • an arriving part takes the latest of its own step and its arriving cards' steps.

Its window and its emphasis both use that step (transition.linkStepRow).

Before and after, the same frame (progress 0.375, dark):

Before: OrdersController's edge into the removed card is grey and solid
After: both edges into the removed card are red and dashed

A unit test in dependency-injection/test/model.test.mjs covers it.

…with the card it pointed to

A rewired relationship (one ID, a new target) drew its old route in its own step but never outlived its card, so
where the card left in an earlier step the route faded out with it unemphasized: grey and solid beside the card's
removed edges. A link part one revision alone draws now follows the step that takes it away or brings it: the
first of its own and its leaving cards' steps, or the last of its own and its arriving cards'. Its window and its
emphasis both follow that step (linkStepRow).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The route’s fade is applied twice, making it less opaque than its card during transitions; the opacity calculation needs correction and a regression assertion for matching opacity.

1 open issue
What changed in this PR

This PR aligns dependency-injection link timing and emphasis with the cards they connect to, addressing rewired routes that appeared grey and solid while their cards were removed.

Changes:

  • Assigns revision-specific link routes to the earliest removal or latest arrival step.
  • Uses the selected link step for renderer emphasis.
  • Adds a regression test for a rewired dependency whose old target leaves first.
File Description
packages/​renderers/​dependency-injection/​test/​model.test.mjs Tests rewired-route scheduling, removal status, and fading.
packages/​renderers/​dependency-injection/​src/​transition.ts Coordinates link windows with endpoint steps and exposes linkStepRow.
packages/​renderers/​dependency-injection/​src/​renderer.tsx Applies emphasis using each drawn link’s selected step.

Review effort: Balanced

agorischek and others added 2 commits November 20, 2026 10:35
A link's opacity multiplied its own presence by its cards', so a route on its card's step faded twice (0.25 where the
card is 0.5). It takes the least of them instead.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@agorischek
agorischek merged commit 2e84d51 into main Nov 20, 2026
94 of 96 checks passed
@agorischek
agorischek deleted the agorischek/di-rewired-emphasis branch November 20, 2026 20:02
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.

2 participants