Skip to content
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

fix!(connection): Correctly handle multiple highlighted RenderedConnections #6416

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

cpcallen
Copy link
Contributor

@cpcallen cpcallen commented Sep 9, 2022

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Issue reported in forum.

Proposed Changes

Modify RenderedConnection.prototype.highlight and .unhighlight to store the highlight path on this rather than as a static property on Connection (which is where it had been stored since this functionality was originally created, apaprently prior to RenderedConnection and Connection being split).

Behaviour Before Change

Calling .unhighlight on a RenderedConnection instance unhighlighted the most recently-highlighted connection, not necessarily this one.

Behaviour After Change

Calling .unhighlight on a RenderedConnection unhighlights this connection, if it was highlighted (and does nothing if not).

Reason for Changes

To make it possible to highlight more than one connection at a time—and, critically, to then be able to unhighlight any/all of them later.

Test Coverage

Passes npm test.

Manual testing: I have done a basic check in the playground to verify that connection highlighting appears to be working as expected, but being alert to any issues about this in manual testing would be great.

Documentation

The documentation already documented the new behaviour.

BREAKING CHANGE:

This change will break any third-party code which incorrectly relied on .unhighlight unconditionally removing the most recently-created highlight.

Modify RenderedConnection.prototype.highlight and .unhighlight to
store the highlight path on this rather than as a static property
on Connection (which is where it had been stored since this
functionality was originally created, previously to RenderedConnection
and Connection being split).
@cpcallen cpcallen added component: connection breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug labels Sep 9, 2022
@cpcallen cpcallen requested a review from a team as a code owner September 9, 2022 16:51
@conventional-commit-lint-gcf
Copy link

conventional-commit-lint-gcf bot commented Sep 9, 2022

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@cpcallen cpcallen merged commit 5d3ba79 into google:develop Sep 9, 2022
@cpcallen cpcallen deleted the connection-multi-highlight branch September 9, 2022 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Used to mark a PR or issue that changes our public APIs. component: connection PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants