Skip to content

Commit 8efb108

Browse files
authored
fix: Diff strings considering spaces (#6271)
1 parent 81e4058 commit 8efb108

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

frontend/web/components/diff/DiffString.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const sanitiseDiffString = (value: FlagsmithValue) => {
1919
return `${value}`
2020
}
2121
const DiffString: FC<DiffType> = ({
22-
compareMethod = DiffMethod.WORDS,
22+
compareMethod = DiffMethod.WORDS_WITH_SPACE,
2323
newValue,
2424
oldValue,
2525
}) => {

frontend/web/components/diff/DiffVariations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const DiffVariations: FC<DiffVariationsType> = ({ diffs, projectFlag }) => {
4646
>
4747
<DiffString
4848
data-test={`version-variation-${i}-weight`}
49-
compareMethod={DiffMethod.WORDS}
49+
compareMethod={DiffMethod.WORDS_WITH_SPACE}
5050
oldValue={`${diff.oldWeight || 0}%`}
5151
newValue={`${diff.newWeight || 0}%`}
5252
/>

frontend/web/styles/3rdParty/_react-diff.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
background-color: $success-alfa-16 !important;
7474
}
7575
.react-diff-hf3w1f-word-removed {
76-
background-color: $danger-alfa-8 !important;
76+
background-color: $danger-alfa-16 !important;
7777
}
7878
.react-diff-1u4zuq6-word-added {
79-
background-color: $success-alfa-8 !important;
79+
background-color: $success-alfa-16 !important;
8080
}
8181
.react-diff-1n5o7vh-diff-container pre {
8282
font-family: $font-family-monospace;

0 commit comments

Comments
 (0)