From 46186d8d23cefdadc7c3699882fda9eb06264f2d Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Thu, 6 Mar 2025 17:07:11 +0100 Subject: [PATCH] Styled some stuff --- src/views/conflicts-resolution/mobile-app.tsx | 14 +++++++- .../unified-diff-view.tsx | 35 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/views/conflicts-resolution/mobile-app.tsx b/src/views/conflicts-resolution/mobile-app.tsx index d5e68b9..a613eb4 100644 --- a/src/views/conflicts-resolution/mobile-app.tsx +++ b/src/views/conflicts-resolution/mobile-app.tsx @@ -39,14 +39,26 @@ const MobileApp = ({ key={file.filePath} style={{ width: "100%", + paddingTop: "var(--size-4-4)", + paddingBottom: "var(--size-4-4)", + borderBottom: "1px solid var(--background-modifier-border)", }} > +
+ {file.filePath} +
onConflictResolved(index)} /> -
); }; diff --git a/src/views/conflicts-resolution/unified-diff-view.tsx b/src/views/conflicts-resolution/unified-diff-view.tsx index 6af98d6..0104e31 100644 --- a/src/views/conflicts-resolution/unified-diff-view.tsx +++ b/src/views/conflicts-resolution/unified-diff-view.tsx @@ -240,16 +240,31 @@ const UnifiedDiffView: React.FC = ({ diffChunks, ); + const [hasConflicts, setHasConflicts] = React.useState(diffChunks.length > 0); + const extensions = React.useMemo(() => { const conflictRangesField = createRangesStateField(lineRanges); return [ conflictRangesField, createDecorationsExtension(conflictRangesField), + EditorView.updateListener.of((update) => { + if (update.docChanged) { + const conflictRanges = update.state.field(conflictRangesField); + const allConflictsSolved = conflictRanges.some( + (range) => range.source === "old" || range.source === "new", + ); + + if (!allConflictsSolved) { + setHasConflicts(allConflictsSolved); + } + } + }), EditorView.editable.of(true), EditorView.theme({ "&": { backgroundColor: "var(--background-primary)", color: "var(--text-normal)", + border: "1px solid var(--background-modifier-border)", }, ".cm-content": { padding: 0, @@ -279,6 +294,26 @@ const UnifiedDiffView: React.FC = ({ basicSetup={false} extensions={extensions} /> +
+ +
); };