diff --git a/src/app.css b/src/app.css index 442c801c..e2a6f9de 100644 --- a/src/app.css +++ b/src/app.css @@ -421,12 +421,6 @@ html.dark .x-friend-item > .detail > .extra, color: var(--color-neutral-300); } -.lucide { - width: 16px; - height: 16px; - stroke-width: 1.5px; -} - #x-app { background: var(--el-bg-color-page); color: var(--el-text-color-primary); diff --git a/src/styles/globals.css b/src/styles/globals.css index 4a684d7e..92ac86b5 100644 --- a/src/styles/globals.css +++ b/src/styles/globals.css @@ -121,3 +121,9 @@ @apply bg-background text-foreground; } } + +.lucide { + width: 16px; + height: 16px; + stroke-width: 1.5px; +} diff --git a/src/views/Feed/columns.jsx b/src/views/Feed/columns.jsx index 0f935c66..9b06894c 100644 --- a/src/views/Feed/columns.jsx +++ b/src/views/Feed/columns.jsx @@ -369,6 +369,17 @@ export const columns = [ } ]; +/** + * Function that format the differences between two strings with HTML tags + * markerStartTag and markerEndTag are optional, if emitted, the differences will be highlighted with yellow and underlined. + * @param {*} s1 + * @param {*} s2 + * @param {*} markerStartTag + * @param {*} markerEndTag + * @returns An array that contains both the string 1 and string 2, which the differences are formatted with HTML tags + */ + +//function getWordDifferences function formatDifference( oldString, newString, @@ -437,6 +448,7 @@ function formatDifference( const match = findLongestMatch(oldStart, oldEnd, newStart, newEnd); if (match.size > 0) { + // Handle differences before the match if (oldStart < match.oldStart || newStart < match.newStart) { result.push( ...buildDiff( @@ -448,12 +460,14 @@ function formatDifference( ); } + // Add the matched words result.push( oldWords .slice(match.oldStart, match.oldStart + match.size) .join(' ') ); + // Handle differences after the match if ( match.oldStart + match.size < oldEnd || match.newStart + match.size < newEnd @@ -483,10 +497,13 @@ function formatDifference( return r; } + // Add deletions if (oldStart < oldEnd) result.push( ...build(oldWords, oldStart, oldEnd, markerDeletion) ); + + // Add insertions if (newStart < newEnd) result.push( ...build(newWords, newStart, newEnd, markerAddition) diff --git a/src/views/GameLog/GameLog.vue b/src/views/GameLog/GameLog.vue index db048df5..a8b5a803 100644 --- a/src/views/GameLog/GameLog.vue +++ b/src/views/GameLog/GameLog.vue @@ -1,217 +1,85 @@