Skip to content

Commit

Permalink
Added Hide Stories option + Fixed Options for recommended channels an…
Browse files Browse the repository at this point in the history
…d vieweres also watch (#1062)
  • Loading branch information
ChrisScr3ams authored Sep 30, 2024
1 parent 88450e2 commit d31019d
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG-nightly.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### 3.1.1.3100
### 3.1.1 4000

- Added option to settings to hide Stories from the sidebar
- Fixed settings to hide recommended channels and viewers also watch channels
- Fixed an issue where history navigation is accidentally triggered during IME composition

### 3.1.1.3000
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Improve your viewing experience on Twitch & YouTube with new features, emotes, vanity and performance.",
"private": true,
"version": "3.1.1",
"dev_version": "3.0",
"dev_version": "4.0",
"scripts": {
"start": "NODE_ENV=dev yarn build:dev && NODE_ENV=dev vite --mode dev",
"build:section:app": "vite build --config vite.config.mts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ export const config = [
],
defaultValue: 0,
}),
declareConfig("layout.hide_stories", "TOGGLE", {
path: ["Site Layout", "Sidebar"],
label: "Hide Stories",
hint: "If checked, Stories will be hidden from the side bar",
defaultValue: false,
}),
];
</script>

Expand Down Expand Up @@ -240,13 +246,65 @@ export const config = [
}
.seventv-hide-recommended-channels {
#side-nav > *:nth-child(1) > *:nth-child(1) > *:nth-child(3) {
div[class$="side-nav--collapsed"]
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(3)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(2)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(3) {
display: none !important;
}
div[class$="side-nav--expanded"]
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(3)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(2)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(4) {
display: none !important;
}
}
.seventv-hide-viewers-also-watch {
#side-nav > *:nth-child(1) > *:nth-child(1) > *:nth-child(4) {
div[class$="side-nav--collapsed"]
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(3)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(2)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(4) {
display: none !important;
}
div[class$="side-nav--expanded"]
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(3)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(2)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(1)
> *:nth-child(5) {
display: none !important;
}
}
Expand Down Expand Up @@ -316,5 +374,14 @@ export const config = [
display: none !important;
}
}
.seventv-hide-stories {
div[class$="storiesLeftNavSection--csO9S"] {
display: none !important;
}
button:has(div[class$="storiesLeftNavSectionCollapsedButton--txKvw"]) {
display: none !important;
}
}
/* stylelint-enable */
</style>
2 changes: 2 additions & 0 deletions src/site/twitch.tv/modules/hidden-elements/hiddenElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const hidePlayerExtensions = useConfig<boolean>("player.hide_player_extensions")
const hideChannelPointBalanceButton = useConfig<boolean>("layout.hide_channel_point_balance_button");
const hideOnscreenCelebrations = useConfig<boolean>("player.hide_onscreen_celebrations");
const hideWhispers = useConfig<number>("layout.hide_whispers");
const hideStories = useConfig<boolean>("layout.hide_stories");
export const hiddenElementSettings: Array<{ class: string; isHidden: Ref<boolean> }> = [
{ class: "seventv-hide-leaderboard", isHidden: hideLeaderboard },
{ class: "seventv-hide-buttons-below-chatbox", isHidden: hideButtonsBelowChatbox },
Expand All @@ -47,4 +48,5 @@ export const hiddenElementSettings: Array<{ class: string; isHidden: Ref<boolean
{ class: "seventv-hide-onscreen-celebrations", isHidden: hideOnscreenCelebrations },
{ class: "seventv-hide-whispers-fullscreen", isHidden: computed(() => hideWhispers.value === 1) },
{ class: "seventv-hide-whispers-all", isHidden: computed(() => hideWhispers.value === 2) },
{ class: "seventv-hide-stories", isHidden: hideStories },
];

0 comments on commit d31019d

Please sign in to comment.