From 9deb69b71b4e0ce08308dbf7bf71043855735092 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 3 Oct 2025 00:55:11 -0400 Subject: [PATCH 1/5] Fix layout on donation button --- public/popup.css | 2 ++ src/popup/YourWorkComponent.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/popup.css b/public/popup.css index 86e5729b..296d6251 100644 --- a/public/popup.css +++ b/public/popup.css @@ -591,6 +591,8 @@ #sponsorTimesDonateContainer a { color: var(--sb-main-fg-color); text-decoration: none; + + padding-left: 5px; } /* diff --git a/src/popup/YourWorkComponent.tsx b/src/popup/YourWorkComponent.tsx index 568931ad..e1d1978d 100644 --- a/src/popup/YourWorkComponent.tsx +++ b/src/popup/YourWorkComponent.tsx @@ -191,7 +191,7 @@ function TimeSavedMessage({ viewCount, minutesSaved }: { viewCount: number; minu function DonateMessage(props: { onClose: () => void }): JSX.Element { return ( -
+
Heart icon { Config.config.donateClicked = Config.config.donateClicked + 1; From 068307f98a365acdc3346fa951a6a5ecce05b1d4 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 3 Oct 2025 02:27:21 -0400 Subject: [PATCH 2/5] Colour segment selector based on category colour --- src/components/SponsorTimeEditComponent.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index dac96d16..3b44a9d5 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -205,6 +205,8 @@ class SponsorTimeEditComponent extends React.Component @@ -215,7 +217,7 @@ class SponsorTimeEditComponent extends React.Component this.categorySelectionChange(event)}> {this.getCategoryOptions()} @@ -240,7 +242,7 @@ class SponsorTimeEditComponent extends React.Component this.actionTypeSelectionChange(e)}> {this.getActionTypeOptions(sponsorTime)} @@ -269,7 +271,7 @@ class SponsorTimeEditComponent extends React.Component this.setState({chapterNameSelectorOpen: false})}> Date: Fri, 3 Oct 2025 02:29:11 -0400 Subject: [PATCH 3/5] Colour time inputs as well --- src/components/SponsorTimeEditComponent.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 3b44a9d5..7994b20a 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -123,6 +123,8 @@ class SponsorTimeEditComponent extends React.Component e.stopPropagation()} onKeyUp={(e) => e.stopPropagation()} @@ -168,7 +170,7 @@ class SponsorTimeEditComponent extends React.Component e.stopPropagation()} onKeyUp={(e) => e.stopPropagation()} @@ -205,8 +207,6 @@ class SponsorTimeEditComponent extends React.Component From 025779126448b72ce27cee31d99d8d4d22ad7e87 Mon Sep 17 00:00:00 2001 From: felistachio Date: Sun, 5 Oct 2025 21:02:02 -0700 Subject: [PATCH 4/5] Add segment list default tab config --- public/_locales | 2 +- public/options/options.html | 11 +++++++++++ src/config.ts | 4 +++- src/popup/SegmentListComponent.tsx | 19 ++++++++++++++----- src/types.ts | 5 +++++ 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/public/_locales b/public/_locales index fcee4620..cf85b80e 160000 --- a/public/_locales +++ b/public/_locales @@ -1 +1 @@ -Subproject commit fcee4620b37c91603653df74891cb58fd0381ab7 +Subproject commit cf85b80e764c39285e60e0b8fd3217ae740a4fc0 diff --git a/public/options/options.html b/public/options/options.html index e5333f89..68c9f6fd 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -329,6 +329,17 @@
+ +
+ +
+ + + +
diff --git a/src/config.ts b/src/config.ts index 4261f66f..27eba2ec 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,6 @@ import * as CompileConfig from "../config.json"; import * as invidiousList from "../ci/invidiouslist.json"; -import { Category, CategorySelection, CategorySkipOption, NoticeVisibilityMode, PreviewBarOption, SponsorTime, VideoID, SponsorHideType } from "./types"; +import { Category, CategorySelection, CategorySkipOption, NoticeVisibilityMode, PreviewBarOption, SponsorTime, VideoID, SponsorHideType, SegmentListDefaultTab } from "./types"; import { Keybind, ProtoConfig, keybindEquals } from "../maze-utils/src/config"; import { HashedValue } from "../maze-utils/src/hash"; import { Permission, AdvancedSkipRuleSet } from "./utils/skipRule"; @@ -10,6 +10,7 @@ interface SBConfig { isVip: boolean; permissions: Record; defaultCategory: Category; + segmentListDefaultTab: SegmentListDefaultTab; renderSegmentsAsChapters: boolean; forceChannelCheck: boolean; minutesSaved: number; @@ -337,6 +338,7 @@ const syncDefaults = { isVip: false, permissions: {}, defaultCategory: "chooseACategory" as Category, + segmentListDefaultTab: SegmentListDefaultTab.Segments, renderSegmentsAsChapters: false, forceChannelCheck: false, minutesSaved: 0, diff --git a/src/popup/SegmentListComponent.tsx b/src/popup/SegmentListComponent.tsx index d56b7bae..1369475c 100644 --- a/src/popup/SegmentListComponent.tsx +++ b/src/popup/SegmentListComponent.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { ActionType, SegmentUUID, SponsorHideType, SponsorTime, VideoID } from "../types"; +import { ActionType, SegmentListDefaultTab, SegmentUUID, SponsorHideType, SponsorTime, VideoID } from "../types"; import Config from "../config"; import { waitFor } from "../../maze-utils/src"; import { shortCategoryName } from "../utils/categoryUtils"; @@ -61,12 +61,21 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => { }, [props.segments]); React.useEffect(() => { - if (hasSegments){ - setTab(SegmentListTab.Segments); + const setTabBasedOnConfig = () => { + const preferChapters = Config.config.segmentListDefaultTab === SegmentListDefaultTab.Chapters; + if (preferChapters) { + setTab(hasChapters ? SegmentListTab.Chapter : SegmentListTab.Segments); + } else { + setTab(hasSegments ? SegmentListTab.Segments : SegmentListTab.Chapter); + } + }; + + if (Config.isReady()) { + setTabBasedOnConfig(); } else { - setTab(SegmentListTab.Chapter); + waitFor(() => Config.isReady()).then(setTabBasedOnConfig); } - }, [props.videoID, hasSegments]); + }, [props.videoID, hasSegments, hasChapters]); const segmentsWithNesting = React.useMemo(() => { const result: SegmentWithNesting[] = []; diff --git a/src/types.ts b/src/types.ts index d8346f58..7438557d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -227,4 +227,9 @@ export enum NoticeVisibilityMode { MiniForAll = 2, FadedForAutoSkip = 3, FadedForAll = 4 +} + +export enum SegmentListDefaultTab { + Segments, + Chapters, } \ No newline at end of file From d0978bff799c07ed2da1f855566f0c14f3e4a3a6 Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 6 Oct 2025 13:15:37 -0400 Subject: [PATCH 5/5] update translations --- public/_locales | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/_locales b/public/_locales index cf85b80e..32c293e8 160000 --- a/public/_locales +++ b/public/_locales @@ -1 +1 @@ -Subproject commit cf85b80e764c39285e60e0b8fd3217ae740a4fc0 +Subproject commit 32c293e8617e9be661fc8b19912858340a1df4f1