From 6af586303f62a2584d84dbfb2c961a14b1ce9910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Fri, 14 Aug 2026 12:16:29 +0200 Subject: [PATCH] Move the diff settings into the settings modal Grouped with the code font in a section of their own, replacing the per-view popover in the commit, changes and review views. --- src/components/DiffOptionsButton.svelte | 184 ------------------------ src/components/ReviewPage.svelte | 2 - src/components/SegmentedSwitch.svelte | 49 +++++++ src/modals/Settings.svelte | 114 +++++++++++++-- src/views/repo/Patch.svelte | 8 +- src/views/repo/RepoCommit.svelte | 2 - 6 files changed, 158 insertions(+), 201 deletions(-) delete mode 100644 src/components/DiffOptionsButton.svelte create mode 100644 src/components/SegmentedSwitch.svelte diff --git a/src/components/DiffOptionsButton.svelte b/src/components/DiffOptionsButton.svelte deleted file mode 100644 index fb05fd82a..000000000 --- a/src/components/DiffOptionsButton.svelte +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - -{#snippet boolSwitch(checked: boolean, onchange: (value: boolean) => void)} -
- - -
-{/snippet} - - - {#snippet toggle(onclick)} - - {/snippet} - - {#snippet popover()} -
-
- Diff style -
- {#each diffStyleOptions as option, index} - - {/each} -
-
-
- Word wrap - {@render boolSwitch( - diffOptions.wordWrap, - value => (diffOptions.wordWrap = value), - )} -
-
- Indicator style -
- {#each indicatorOptions as option, index} - - {/each} -
-
-
- Word diff -
- {#each wordDiffOptions as option, index} - - {/each} -
-
-
- {/snippet} -
diff --git a/src/components/ReviewPage.svelte b/src/components/ReviewPage.svelte index 513d54913..a18467db7 100644 --- a/src/components/ReviewPage.svelte +++ b/src/components/ReviewPage.svelte @@ -54,7 +54,6 @@ import { announce } from "@app/components/AnnounceSwitch.svelte"; import Button from "@app/components/Button.svelte"; - import DiffOptionsButton from "@app/components/DiffOptionsButton.svelte"; import Discussion from "@app/components/Discussion.svelte"; import DropdownList from "@app/components/DropdownList.svelte"; import DropdownListItem from "@app/components/DropdownListItem.svelte"; @@ -1131,7 +1130,6 @@ onclick={() => setAllFilesCollapsed(filesExpanded)}> - {/snippet} diff --git a/src/components/SegmentedSwitch.svelte b/src/components/SegmentedSwitch.svelte new file mode 100644 index 000000000..496cf5c09 --- /dev/null +++ b/src/components/SegmentedSwitch.svelte @@ -0,0 +1,49 @@ + + + + +
+ {#each options as option, index (option.value)} + + {/each} +
diff --git a/src/modals/Settings.svelte b/src/modals/Settings.svelte index 05e9c3cb6..09c79498a 100644 --- a/src/modals/Settings.svelte +++ b/src/modals/Settings.svelte @@ -1,4 +1,8 @@