add setting for showing unread count in tab/favicon (#1518)

This commit is contained in:
Athou
2024-08-25 18:05:34 +02:00
parent bb6578bdd0
commit 764c1a6430
38 changed files with 427 additions and 9 deletions

View File

@@ -71,7 +71,7 @@ function Providers(props: { children: React.ReactNode }) {
) )
} }
// swagger-ui is very large, load only on-demand // api documentation page is very large, load only on-demand
const ApiDocumentationPage = React.lazy(async () => await import("pages/app/ApiDocumentationPage")) const ApiDocumentationPage = React.lazy(async () => await import("pages/app/ApiDocumentationPage"))
function AppRoutes() { function AppRoutes() {
@@ -142,16 +142,18 @@ function GoogleAnalyticsHandler() {
return null return null
} }
function FaviconHandler() { function UnreadCountTitleHandler({ unreadCount, enabled }: { unreadCount: number; enabled?: boolean }) {
const root = useAppSelector(state => state.tree.rootCategory) return <Helmet title={enabled && unreadCount > 0 ? `(${unreadCount}) CommaFeed` : "CommaFeed"} />
}
function UnreadCountFaviconHandler({ unreadCount, enabled }: { unreadCount: number; enabled?: boolean }) {
useEffect(() => { useEffect(() => {
const unreadCount = categoryUnreadCount(root) if (enabled && unreadCount > 0) {
if (unreadCount === 0) {
Tinycon.reset()
} else {
Tinycon.setBubble(unreadCount) Tinycon.setBubble(unreadCount)
} else {
Tinycon.reset()
} }
}, [root]) }, [unreadCount, enabled])
return null return null
} }
@@ -179,8 +181,13 @@ function CustomCode() {
export function App() { export function App() {
useI18n() useI18n()
const root = useAppSelector(state => state.tree.rootCategory)
const unreadCountTitle = useAppSelector(state => state.user.settings?.unreadCountTitle)
const unreadCountFavicon = useAppSelector(state => state.user.settings?.unreadCountFavicon)
const dispatch = useAppDispatch() const dispatch = useAppDispatch()
const unreadCount = categoryUnreadCount(root)
useEffect(() => { useEffect(() => {
dispatch(reloadServerInfos()) dispatch(reloadServerInfos())
}, [dispatch]) }, [dispatch])
@@ -188,7 +195,8 @@ export function App() {
return ( return (
<Providers> <Providers>
<> <>
<FaviconHandler /> <UnreadCountTitleHandler unreadCount={unreadCount} enabled={unreadCountTitle} />
<UnreadCountFaviconHandler unreadCount={unreadCount} enabled={unreadCountFavicon} />
<BrowserExtensionBadgeUnreadCountHandler /> <BrowserExtensionBadgeUnreadCountHandler />
<HashRouter> <HashRouter>
<GoogleAnalyticsHandler /> <GoogleAnalyticsHandler />

View File

@@ -248,6 +248,8 @@ export interface Settings {
markAllAsReadConfirmation: boolean markAllAsReadConfirmation: boolean
customContextMenu: boolean customContextMenu: boolean
mobileFooter: boolean mobileFooter: boolean
unreadCountTitle: boolean
unreadCountFavicon: boolean
sharingSettings: SharingSettings sharingSettings: SharingSettings
} }

View File

@@ -16,6 +16,8 @@ import {
changeSharingSetting, changeSharingSetting,
changeShowRead, changeShowRead,
changeStarIconDisplayMode, changeStarIconDisplayMode,
changeUnreadCountFavicon,
changeUnreadCountTitle,
reloadProfile, reloadProfile,
reloadSettings, reloadSettings,
reloadTags, reloadTags,
@@ -91,6 +93,14 @@ export const userSlice = createSlice({
if (!state.settings) return if (!state.settings) return
state.settings.mobileFooter = action.meta.arg state.settings.mobileFooter = action.meta.arg
}) })
builder.addCase(changeUnreadCountTitle.pending, (state, action) => {
if (!state.settings) return
state.settings.unreadCountTitle = action.meta.arg
})
builder.addCase(changeUnreadCountFavicon.pending, (state, action) => {
if (!state.settings) return
state.settings.unreadCountFavicon = action.meta.arg
})
builder.addCase(changeSharingSetting.pending, (state, action) => { builder.addCase(changeSharingSetting.pending, (state, action) => {
if (!state.settings) return if (!state.settings) return
state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value
@@ -107,6 +117,8 @@ export const userSlice = createSlice({
changeMarkAllAsReadConfirmation.fulfilled, changeMarkAllAsReadConfirmation.fulfilled,
changeCustomContextMenu.fulfilled, changeCustomContextMenu.fulfilled,
changeMobileFooter.fulfilled, changeMobileFooter.fulfilled,
changeUnreadCountTitle.fulfilled,
changeUnreadCountFavicon.fulfilled,
changeSharingSetting.fulfilled changeSharingSetting.fulfilled
), ),
() => { () => {

View File

@@ -77,6 +77,16 @@ export const changeMobileFooter = createAppAsyncThunk("settings/mobileFooter", (
if (!settings) return if (!settings) return
client.user.saveSettings({ ...settings, mobileFooter }) client.user.saveSettings({ ...settings, mobileFooter })
}) })
export const changeUnreadCountTitle = createAppAsyncThunk("settings/unreadCountTitle", (unreadCountTitle: boolean, thunkApi) => {
const { settings } = thunkApi.getState().user
if (!settings) return
client.user.saveSettings({ ...settings, unreadCountTitle })
})
export const changeUnreadCountFavicon = createAppAsyncThunk("settings/unreadCountFavicon", (unreadCountFavicon: boolean, thunkApi) => {
const { settings } = thunkApi.getState().user
if (!settings) return
client.user.saveSettings({ ...settings, unreadCountFavicon })
})
export const changeSharingSetting = createAppAsyncThunk( export const changeSharingSetting = createAppAsyncThunk(
"settings/sharingSetting", "settings/sharingSetting",
( (

View File

@@ -17,6 +17,8 @@ import {
changeSharingSetting, changeSharingSetting,
changeShowRead, changeShowRead,
changeStarIconDisplayMode, changeStarIconDisplayMode,
changeUnreadCountFavicon,
changeUnreadCountTitle,
} from "app/user/thunks" } from "app/user/thunks"
import { locales } from "i18n" import { locales } from "i18n"
import type { ReactNode } from "react" import type { ReactNode } from "react"
@@ -32,6 +34,8 @@ export function DisplaySettings() {
const markAllAsReadConfirmation = useAppSelector(state => state.user.settings?.markAllAsReadConfirmation) const markAllAsReadConfirmation = useAppSelector(state => state.user.settings?.markAllAsReadConfirmation)
const customContextMenu = useAppSelector(state => state.user.settings?.customContextMenu) const customContextMenu = useAppSelector(state => state.user.settings?.customContextMenu)
const mobileFooter = useAppSelector(state => state.user.settings?.mobileFooter) const mobileFooter = useAppSelector(state => state.user.settings?.mobileFooter)
const unreadCountTitle = useAppSelector(state => state.user.settings?.unreadCountTitle)
const unreadCountFavicon = useAppSelector(state => state.user.settings?.unreadCountFavicon)
const sharingSettings = useAppSelector(state => state.user.settings?.sharingSettings) const sharingSettings = useAppSelector(state => state.user.settings?.sharingSettings)
const dispatch = useAppDispatch() const dispatch = useAppDispatch()
const { _ } = useLingui() const { _ } = useLingui()
@@ -91,6 +95,20 @@ export function DisplaySettings() {
onChange={async e => await dispatch(changeMobileFooter(e.currentTarget.checked))} onChange={async e => await dispatch(changeMobileFooter(e.currentTarget.checked))}
/> />
<Divider label={<Trans>Browser tab</Trans>} labelPosition="center" />
<Switch
label={<Trans>Show unread count in tab title</Trans>}
checked={unreadCountTitle}
onChange={async e => await dispatch(changeUnreadCountTitle(e.currentTarget.checked))}
/>
<Switch
label={<Trans>Show unread count in tab favicon</Trans>}
checked={unreadCountFavicon}
onChange={async e => await dispatch(changeUnreadCountFavicon(e.currentTarget.checked))}
/>
<Divider label={<Trans>Entry headers</Trans>} labelPosition="center" /> <Divider label={<Trans>Entry headers</Trans>} labelPosition="center" />
<Select <Select

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr "Extensió del navegador necessària per a Chrome"
msgid "Browser extention" msgid "Browser extention"
msgstr "Extensió del navegador" msgstr "Extensió del navegador"
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr "Mostra el menú natiu (escriptori)"
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr "Browser-Erweiterung für Chrome benötigt"
msgid "Browser extention" msgid "Browser extention"
msgstr "Browser-Erweiterung" msgstr "Browser-Erweiterung"
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr "Natives Menü anzeigen (Desktop)"
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr "Browser extension required for Chrome"
msgid "Browser extention" msgid "Browser extention"
msgstr "Browser extention" msgstr "Browser extention"
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr "Browser tab"
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr "Show native menu (desktop)"
msgid "Show star icon" msgid "Show star icon"
msgstr "Show star icon" msgstr "Show star icon"
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr "Show unread count in tab favicon"
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr "Show unread count in tab title"
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr "L'extension navigateur est nécessaire sur Chrome"
msgid "Browser extention" msgid "Browser extention"
msgstr "Extension navigateur" msgstr "Extension navigateur"
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr "Afficher les options du navigateur (ordinateur)"
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr "Для браузера Chrome требуется расширение"
msgid "Browser extention" msgid "Browser extention"
msgstr "Расширение для браузера" msgstr "Расширение для браузера"
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr "Показать родное меню (ПК)"
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr ""
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr ""
msgid "Browser extention" msgid "Browser extention"
msgstr "Tarayıcı eklentisi" msgstr "Tarayıcı eklentisi"
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr "Orijinal tarayıcı menüsünü göster (masaüstü)"
msgid "Show star icon" msgid "Show star icon"
msgstr "" msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -140,6 +140,10 @@ msgstr "浏览器扩展"
msgid "Browser extention" msgid "Browser extention"
msgstr "浏览器扩展" msgstr "浏览器扩展"
#: src/components/settings/DisplaySettings.tsx
msgid "Browser tab"
msgstr ""
#: src/components/admin/UserEdit.tsx #: src/components/admin/UserEdit.tsx
#: src/components/content/add/AddCategory.tsx #: src/components/content/add/AddCategory.tsx
#: src/components/content/add/ImportOpml.tsx #: src/components/content/add/ImportOpml.tsx
@@ -826,6 +830,14 @@ msgstr "显示原生菜单(桌面端)"
msgid "Show star icon" msgid "Show star icon"
msgstr "显示星标图标" msgstr "显示星标图标"
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab favicon"
msgstr ""
#: src/components/settings/DisplaySettings.tsx
msgid "Show unread count in tab title"
msgstr ""
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/auth/RegistrationPage.tsx #: src/pages/auth/RegistrationPage.tsx
#: src/pages/WelcomePage.tsx #: src/pages/WelcomePage.tsx

View File

@@ -89,6 +89,8 @@ public class UserSettings extends AbstractModel {
private boolean markAllAsReadConfirmation; private boolean markAllAsReadConfirmation;
private boolean customContextMenu; private boolean customContextMenu;
private boolean mobileFooter; private boolean mobileFooter;
private boolean unreadCountTitle;
private boolean unreadCountFavicon;
private boolean email; private boolean email;
private boolean gmail; private boolean gmail;

View File

@@ -70,6 +70,12 @@ public class Settings implements Serializable {
@Schema(description = "on mobile, show action buttons at the bottom of the screen", requiredMode = RequiredMode.REQUIRED) @Schema(description = "on mobile, show action buttons at the bottom of the screen", requiredMode = RequiredMode.REQUIRED)
private boolean mobileFooter; private boolean mobileFooter;
@Schema(description = "show unread count in the title", requiredMode = RequiredMode.REQUIRED)
private boolean unreadCountTitle;
@Schema(description = "show unread count in the favicon", requiredMode = RequiredMode.REQUIRED)
private boolean unreadCountFavicon;
@Schema(description = "sharing settings", requiredMode = RequiredMode.REQUIRED) @Schema(description = "sharing settings", requiredMode = RequiredMode.REQUIRED)
private SharingSettings sharingSettings = new SharingSettings(); private SharingSettings sharingSettings = new SharingSettings();

View File

@@ -119,6 +119,8 @@ public class UserREST {
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation()); s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
s.setCustomContextMenu(settings.isCustomContextMenu()); s.setCustomContextMenu(settings.isCustomContextMenu());
s.setMobileFooter(settings.isMobileFooter()); s.setMobileFooter(settings.isMobileFooter());
s.setUnreadCountTitle(settings.isUnreadCountTitle());
s.setUnreadCountFavicon(settings.isUnreadCountFavicon());
} else { } else {
s.setReadingMode(ReadingMode.unread.name()); s.setReadingMode(ReadingMode.unread.name());
s.setReadingOrder(ReadingOrder.desc.name()); s.setReadingOrder(ReadingOrder.desc.name());
@@ -142,6 +144,8 @@ public class UserREST {
s.setMarkAllAsReadConfirmation(true); s.setMarkAllAsReadConfirmation(true);
s.setCustomContextMenu(true); s.setCustomContextMenu(true);
s.setMobileFooter(false); s.setMobileFooter(false);
s.setUnreadCountTitle(false);
s.setUnreadCountFavicon(true);
} }
return Response.ok(s).build(); return Response.ok(s).build();
} }
@@ -173,6 +177,8 @@ public class UserREST {
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation()); s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
s.setCustomContextMenu(settings.isCustomContextMenu()); s.setCustomContextMenu(settings.isCustomContextMenu());
s.setMobileFooter(settings.isMobileFooter()); s.setMobileFooter(settings.isMobileFooter());
s.setUnreadCountTitle(settings.isUnreadCountTitle());
s.setUnreadCountFavicon(settings.isUnreadCountFavicon());
s.setEmail(settings.getSharingSettings().isEmail()); s.setEmail(settings.getSharingSettings().isEmail());
s.setGmail(settings.getSharingSettings().isGmail()); s.setGmail(settings.getSharingSettings().isGmail());

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet id="add-unread-count-settings" author="athou">
<addColumn tableName="USERSETTINGS">
<column name="unreadCountTitle" type="BOOLEAN" value="false">
<constraints nullable="false" />
</column>
<column name="unreadCountFavicon" type="BOOLEAN" value="true">
<constraints nullable="false" />
</column>
</addColumn>
</changeSet>
</databaseChangeLog>

View File

@@ -31,5 +31,6 @@
<include file="changelogs/db.changelog-4.2.xml" /> <include file="changelogs/db.changelog-4.2.xml" />
<include file="changelogs/db.changelog-4.3.xml" /> <include file="changelogs/db.changelog-4.3.xml" />
<include file="changelogs/db.changelog-4.4.xml" /> <include file="changelogs/db.changelog-4.4.xml" />
<include file="changelogs/db.changelog-5.1.xml" />
</databaseChangeLog> </databaseChangeLog>