Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings toggles for top and side subscription panels #361

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Grayjay.ClientServer/Settings/GrayjaySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public class SubscriptionsSettings
[SettingsField("Fetch on tab open", SettingsField.TOGGLE, "Fetch new results when the tab is opened (if no results are present)", 9)]
public bool FetchOnTabOpen { get; set; } = true;

[SettingsField("Show top channels bar", SettingsField.TOGGLE, "Show top bar with subscribed channels", 10)]
public bool ShowSubsTopBar { get; set; } = true;

[SettingsField("Show sidebar channels list", SettingsField.TOGGLE, "Show sidebar list with subscribed channels", 11)]
public bool ShowSubsLeftList { get; set; } = true;

/*
[SettingsField("Background Update", SettingsField.DROPDOWN, "Experimental background update for subscriptions cache", 10, "background_update")]
[SettingsDropdownOptions("")]
Expand All @@ -98,21 +104,21 @@ public int GetSubscriptionsBackgroundIntervalMinutes()
}
*/

[SettingsField("Subscription concurrency", SettingsField.DROPDOWN, "Specify how many threads are used to fetch channels", 11)]
[SettingsField("Subscription concurrency", SettingsField.DROPDOWN, "Specify how many threads are used to fetch channels", 12)]
[SettingsDropdownOptions("2", "4", "8", "12", "16", "20", "30")]
public int SubscriptionConcurrency { get; set; } = 6;
public int GetSubscriptionConcurrency()
{
return ThreadIndexToCount(SubscriptionConcurrency) * 2;
}

[SettingsField("Show Watch Metrics", SettingsField.TOGGLE, "Shows the watch time and views of each creator in the creators tab", 12)]
[SettingsField("Show Watch Metrics", SettingsField.TOGGLE, "Shows the watch time and views of each creator in the creators tab", 13)]
public bool ShowWatchMetrics { get; set; } = false;

[SettingsField("Track Playtime Locally", SettingsField.TOGGLE, "Locally track playtime of subscriptions, used for subscriptions.", 13)]
[SettingsField("Track Playtime Locally", SettingsField.TOGGLE, "Locally track playtime of subscriptions, used for subscriptions.", 14)]
public bool AllowPlaytimeTracking { get; set; } = true;

[SettingsField("Always Reload From Cache", SettingsField.TOGGLE, "This is not recommended, but possible workaround for subscription issues", 14)]
[SettingsField("Always Reload From Cache", SettingsField.TOGGLE, "This is not recommended, but possible workaround for subscription issues", 15)]
public bool AlwaysReloadFromCache { get; set; } = false;
}

Expand Down
2 changes: 1 addition & 1 deletion Grayjay.Desktop.Web/src/components/menus/SideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const SideBar: Component<SideBarProps> = (props: SideBarProps) => {
}} icon={iconLink} name="Developer" selected={location.pathname === "/Developer/Index"} />
</Show>
</div>
<Show when={!collapsed() && subscriptions$()?.length} fallback={<div style="flex-grow:1"></div>}>
<Show when={!collapsed() && subscriptions$()?.length && StateGlobal.settings$().object.subscriptions?.showSubsLeftList} fallback={<div style="flex-grow:1"></div>}>
<div class={styles.buttonListFill}>
<div classList={{[styles.expandHeader]: true, [styles.expanded]: expand$()}} onClick={()=>setExpand(!expand$())}>
Subscriptions
Expand Down
5 changes: 4 additions & 1 deletion Grayjay.Desktop.Web/src/pages/Subscriptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,10 @@ const SubscriptionsPage: Component = () => {
ref={setReloadButtonRef}
onClick={()=>{ setShowReloadMenu(true) }} />
} />
<Show when={subs$() && subs$()!.length > 0}>

<Show when={subs$() && subs$()!.length > 0}>
<div style="flex-shrink: 0; position: relative;">
<Show when={StateGlobal.settings$().object.subscriptions?.showSubsTopBar}>
<div class={styles.subBar}>
<For each={subs$()}>{(sub, i) =>
<div class={styles.channel} onClick={()=>toggleCreator(sub.channel.url)} classList={{[styles.active]: selectedCreators$().indexOf(sub.channel.url) >= 0}}>
Expand All @@ -292,6 +294,7 @@ const SubscriptionsPage: Component = () => {
</div>
}</For>
</div>
</Show>
<Show when={!hasSubGroups$() && StateGlobal.settings$().object.subscriptions?.showSubscriptionGroups}>
<div class={styles.subgroupBanner}>
<div class={styles.bannerText}>
Expand Down