mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
0fb39bdffe
Refactors the Redux state for the Changes panel so that rules have a `selectors` array instead of just a single `selector` string. The `selectors` array represents the **history** of selector text the rule has over time, not the actual list of multiple selectors it has (multiple selectors are collapsed into a single comma-separated string regardless of how many they are). When the server logs changes, the rule's selector text is checked against the history of previously logged selectors. If the incoming selector is different than the _first_ item in the tracked rule's `selectors` array, it means the selector was renamed so it is pushed onto the array (added to the history). If it's the same, the whole array can be reduced to the original value because it means that either: - the selector didn't change between operations (ex: after declaration changes) - the selector reverted back to its original name. This `selectors` array is used in the React component in Part 2 of this series to render any necessary diff view of the selector. The old approach (whole rule removal + whole rule addition) is replaced by this refactor. The introduction of the StyleRyleActor actor id from the server as the rule id on the client in Bug 1525238 means that the selector change can no longer behave like two distinct rules. The actorID/rule id are preserved after selector renames. This necessary for the some export options to work consistently (like Copy Rule with changes applied). Differential Revision: https://phabricator.services.mozilla.com/D19828 --HG-- extra : moz-landing-system : lando |
||
---|---|---|
.. | ||
actors | ||
performance | ||
socket | ||
startup | ||
tests | ||
main.js | ||
moz.build |