diff --git a/commafeed-client/src/app/slices/entries.ts b/commafeed-client/src/app/slices/entries.ts index 3e6e6f44..b94c4284 100644 --- a/commafeed-client/src/app/slices/entries.ts +++ b/commafeed-client/src/app/slices/entries.ts @@ -45,18 +45,27 @@ const initialState: EntriesState = { const getEndpoint = (sourceType: EntrySourceType) => sourceType === "category" || sourceType === "tag" ? client.category.getEntries : client.feed.getEntries -export const loadEntries = createAsyncThunk( - "entries/load", - async (arg, thunkApi) => { - if (arg.clearSearch) thunkApi.dispatch(setSearch("")) - - const state = thunkApi.getState() - const endpoint = getEndpoint(arg.source.type) - const result = await endpoint(buildGetEntriesPaginatedRequest(state, arg.source, 0)) - return result.data +export const loadEntries = createAsyncThunk< + Entries, + { source: EntrySource; clearSearch: boolean }, + { + state: RootState } -) -export const loadMoreEntries = createAsyncThunk("entries/loadMore", async (_, thunkApi) => { +>("entries/load", async (arg, thunkApi) => { + if (arg.clearSearch) thunkApi.dispatch(setSearch("")) + + const state = thunkApi.getState() + const endpoint = getEndpoint(arg.source.type) + const result = await endpoint(buildGetEntriesPaginatedRequest(state, arg.source, 0)) + return result.data +}) +export const loadMoreEntries = createAsyncThunk< + Entries, + void, + { + state: RootState + } +>("entries/loadMore", async (_, thunkApi) => { const state = thunkApi.getState() const { source } = state.entries const offset = @@ -74,7 +83,13 @@ const buildGetEntriesPaginatedRequest = (state: RootState, source: EntrySource, tag: source.type === "tag" ? source.id : undefined, keywords: state.entries.search, }) -export const reloadEntries = createAsyncThunk("entries/reload", async (arg, thunkApi) => { +export const reloadEntries = createAsyncThunk< + void, + void, + { + state: RootState + } +>("entries/reload", async (arg, thunkApi) => { const state = thunkApi.getState() thunkApi.dispatch(loadEntries({ source: state.entries.source, clearSearch: false })) }) @@ -123,15 +138,18 @@ export const markEntriesUpToEntry = createAsyncThunk( - "entries/entry/markAll", - async (arg, thunkApi) => { - const endpoint = arg.sourceType === "category" ? client.category.markEntries : client.feed.markEntries - await endpoint(arg.req) - thunkApi.dispatch(reloadEntries()) - thunkApi.dispatch(reloadTree()) +export const markAllEntries = createAsyncThunk< + void, + { sourceType: EntrySourceType; req: MarkRequest }, + { + state: RootState } -) +>("entries/entry/markAll", async (arg, thunkApi) => { + const endpoint = arg.sourceType === "category" ? client.category.markEntries : client.feed.markEntries + await endpoint(arg.req) + thunkApi.dispatch(reloadEntries()) + thunkApi.dispatch(reloadTree()) +}) export const starEntry = createAsyncThunk("entries/entry/star", (arg: { entry: Entry; starred: boolean }) => { client.entry.star({ id: arg.entry.id, @@ -175,19 +193,17 @@ export const selectEntry = createAsyncThunk< if (arg.scrollToEntry) { const entryElement = document.getElementById(Constants.dom.entryId(entry)) if (entryElement) { - const scrollSpeed = state.user.settings?.scrollSpeed - thunkApi.dispatch(entriesSlice.actions.setScrollingToEntry(true)) - scrollToEntry(entryElement, scrollSpeed, () => thunkApi.dispatch(entriesSlice.actions.setScrollingToEntry(false))) + const alwaysScrollToEntry = state.user.settings?.alwaysScrollToEntry + const entryEntirelyVisible = Constants.layout.isTopVisible(entryElement) && Constants.layout.isBottomVisible(entryElement) + if (alwaysScrollToEntry || !entryEntirelyVisible) { + const scrollSpeed = state.user.settings?.scrollSpeed + thunkApi.dispatch(entriesSlice.actions.setScrollingToEntry(true)) + scrollToEntry(entryElement, scrollSpeed, () => thunkApi.dispatch(entriesSlice.actions.setScrollingToEntry(false))) + } } } }) const scrollToEntry = (entryElement: HTMLElement, scrollSpeed: number | undefined, onScrollEnded: () => void) => { - // the entry is entirely visible, no need to scroll - if (Constants.layout.isTopVisible(entryElement) && Constants.layout.isBottomVisible(entryElement)) { - onScrollEnded() - return - } - const scrollArea = document.getElementById(Constants.dom.mainScrollAreaId) if (scrollArea) { scrollToWithCallback({ @@ -248,7 +264,13 @@ export const selectNextEntry = createAsyncThunk< ) } }) -export const tagEntry = createAsyncThunk("entries/entry/tag", async (arg, thunkApi) => { +export const tagEntry = createAsyncThunk< + void, + TagRequest, + { + state: RootState + } +>("entries/entry/tag", async (arg, thunkApi) => { await client.entry.tag(arg) thunkApi.dispatch(reloadTags()) }) diff --git a/commafeed-client/src/app/slices/user.ts b/commafeed-client/src/app/slices/user.ts index 8eb27e54..87f96a40 100644 --- a/commafeed-client/src/app/slices/user.ts +++ b/commafeed-client/src/app/slices/user.ts @@ -80,6 +80,17 @@ export const changeScrollMarks = createAsyncThunk< if (!settings) return client.user.saveSettings({ ...settings, scrollMarks }) }) +export const changeAlwaysScrollToEntry = createAsyncThunk< + void, + boolean, + { + state: RootState + } +>("settings/alwaysScrollToEntry", (alwaysScrollToEntry, thunkApi) => { + const { settings } = thunkApi.getState().user + if (!settings) return + client.user.saveSettings({ ...settings, alwaysScrollToEntry }) +}) export const changeSharingSetting = createAsyncThunk< void, { site: keyof SharingSettings; value: boolean }, @@ -136,6 +147,10 @@ export const userSlice = createSlice({ if (!state.settings) return state.settings.scrollMarks = action.meta.arg }) + builder.addCase(changeAlwaysScrollToEntry.pending, (state, action) => { + if (!state.settings) return + state.settings.alwaysScrollToEntry = action.meta.arg + }) builder.addCase(changeSharingSetting.pending, (state, action) => { if (!state.settings) return state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value @@ -146,6 +161,7 @@ export const userSlice = createSlice({ changeScrollSpeed.fulfilled, changeShowRead.fulfilled, changeScrollMarks.fulfilled, + changeAlwaysScrollToEntry.fulfilled, changeSharingSetting.fulfilled ), () => { diff --git a/commafeed-client/src/app/types.ts b/commafeed-client/src/app/types.ts index 4b3533e6..aa9e1c18 100644 --- a/commafeed-client/src/app/types.ts +++ b/commafeed-client/src/app/types.ts @@ -233,6 +233,7 @@ export interface Settings { customCss?: string customJs?: string scrollSpeed: number + alwaysScrollToEntry: boolean sharingSettings: SharingSettings } diff --git a/commafeed-client/src/components/settings/DisplaySettings.tsx b/commafeed-client/src/components/settings/DisplaySettings.tsx index 095105a3..52efef47 100644 --- a/commafeed-client/src/components/settings/DisplaySettings.tsx +++ b/commafeed-client/src/components/settings/DisplaySettings.tsx @@ -1,7 +1,14 @@ import { Trans } from "@lingui/macro" import { Divider, Select, SimpleGrid, Stack, Switch } from "@mantine/core" import { Constants } from "app/constants" -import { changeLanguage, changeScrollMarks, changeScrollSpeed, changeSharingSetting, changeShowRead } from "app/slices/user" +import { + changeAlwaysScrollToEntry, + changeLanguage, + changeScrollMarks, + changeScrollSpeed, + changeSharingSetting, + changeShowRead, +} from "app/slices/user" import { useAppDispatch, useAppSelector } from "app/store" import { SharingSettings } from "app/types" import { locales } from "i18n" @@ -11,6 +18,7 @@ export function DisplaySettings() { const scrollSpeed = useAppSelector(state => state.user.settings?.scrollSpeed) const showRead = useAppSelector(state => state.user.settings?.showRead) const scrollMarks = useAppSelector(state => state.user.settings?.scrollMarks) + const alwaysScrollToEntry = useAppSelector(state => state.user.settings?.alwaysScrollToEntry) const sharingSettings = useAppSelector(state => state.user.settings?.sharingSettings) const dispatch = useAppDispatch() @@ -32,6 +40,12 @@ export function DisplaySettings() { onChange={e => dispatch(changeScrollSpeed(e.currentTarget.checked))} /> + Always scroll selected entry to the top of the page, even if it fits entirely on screen} + checked={alwaysScrollToEntry} + onChange={e => dispatch(changeAlwaysScrollToEntry(e.currentTarget.checked))} + /> + Show feeds and categories with no unread entries} checked={showRead} diff --git a/commafeed-client/src/locales/ar/messages.po b/commafeed-client/src/locales/ar/messages.po index d188ccc4..c832ff72 100644 --- a/commafeed-client/src/locales/ar/messages.po +++ b/commafeed-client/src/locales/ar/messages.po @@ -71,6 +71,10 @@ msgstr "إداري" msgid "All" msgstr "الكل" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "تم إرسال بريد إلكتروني إذا تم تسجيل هذا العنوان. " diff --git a/commafeed-client/src/locales/ca/messages.po b/commafeed-client/src/locales/ca/messages.po index a021b9e1..7f8d2aa6 100644 --- a/commafeed-client/src/locales/ca/messages.po +++ b/commafeed-client/src/locales/ca/messages.po @@ -71,6 +71,10 @@ msgstr "Administrador" msgid "All" msgstr "Tot" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "S'ha enviat un correu electrònic si aquesta adreça estava registrada. " diff --git a/commafeed-client/src/locales/cs/messages.po b/commafeed-client/src/locales/cs/messages.po index 33a2cace..5cff3298 100644 --- a/commafeed-client/src/locales/cs/messages.po +++ b/commafeed-client/src/locales/cs/messages.po @@ -71,6 +71,10 @@ msgstr "Správce" msgid "All" msgstr "Všechny" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Pokud byla tato adresa zaregistrována, byl odeslán e-mail. " diff --git a/commafeed-client/src/locales/cy/messages.po b/commafeed-client/src/locales/cy/messages.po index 83962392..bf0ab344 100644 --- a/commafeed-client/src/locales/cy/messages.po +++ b/commafeed-client/src/locales/cy/messages.po @@ -71,6 +71,10 @@ msgstr "Gweinyddol" msgid "All" msgstr "Pawb" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Mae e-bost wedi'i anfon os oedd y cyfeiriad hwn wedi'i gofrestru. " diff --git a/commafeed-client/src/locales/da/messages.po b/commafeed-client/src/locales/da/messages.po index 46da472e..d25314bf 100644 --- a/commafeed-client/src/locales/da/messages.po +++ b/commafeed-client/src/locales/da/messages.po @@ -71,6 +71,10 @@ msgstr "" msgid "All" msgstr "Alle" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Der er sendt en e-mail, hvis denne adresse var registreret. " diff --git a/commafeed-client/src/locales/de/messages.po b/commafeed-client/src/locales/de/messages.po index 2e5e99b3..020fa5f2 100644 --- a/commafeed-client/src/locales/de/messages.po +++ b/commafeed-client/src/locales/de/messages.po @@ -71,6 +71,10 @@ msgstr "Verwaltung" msgid "All" msgstr "Alle" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Eine E-Mail wurde gesendet, wenn diese Adresse registriert wurde. " diff --git a/commafeed-client/src/locales/en/messages.po b/commafeed-client/src/locales/en/messages.po index 98bb1ea1..6d926269 100644 --- a/commafeed-client/src/locales/en/messages.po +++ b/commafeed-client/src/locales/en/messages.po @@ -71,6 +71,10 @@ msgstr "Admin" msgid "All" msgstr "All" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "Always scroll selected entry to the top of the page, even if it fits entirely on screen" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "An email has been sent if this address was registered. Check your inbox." diff --git a/commafeed-client/src/locales/es/messages.po b/commafeed-client/src/locales/es/messages.po index efac177a..cf628ee5 100644 --- a/commafeed-client/src/locales/es/messages.po +++ b/commafeed-client/src/locales/es/messages.po @@ -71,6 +71,10 @@ msgstr "Administrador" msgid "All" msgstr "Todo" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Se ha enviado un correo electrónico si se registró esta dirección. " diff --git a/commafeed-client/src/locales/fa/messages.po b/commafeed-client/src/locales/fa/messages.po index 23c27b4c..c740bc70 100644 --- a/commafeed-client/src/locales/fa/messages.po +++ b/commafeed-client/src/locales/fa/messages.po @@ -71,6 +71,10 @@ msgstr "مدیر" msgid "All" msgstr "همه" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "اگر این آدرس ثبت شده باشد ایمیل ارسال شده است. " diff --git a/commafeed-client/src/locales/fi/messages.po b/commafeed-client/src/locales/fi/messages.po index 8bfedd49..95004745 100644 --- a/commafeed-client/src/locales/fi/messages.po +++ b/commafeed-client/src/locales/fi/messages.po @@ -71,6 +71,10 @@ msgstr "Järjestelmänvalvoja" msgid "All" msgstr "Kaikki" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Sähköposti on lähetetty, jos tämä osoite on rekisteröity. " diff --git a/commafeed-client/src/locales/fr/messages.po b/commafeed-client/src/locales/fr/messages.po index 887d4d71..dc4bcb21 100644 --- a/commafeed-client/src/locales/fr/messages.po +++ b/commafeed-client/src/locales/fr/messages.po @@ -71,6 +71,10 @@ msgstr "Administrateur" msgid "All" msgstr "Tout" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Un e-mail a été envoyé si cette adresse est enregistrée. Vérifiez votre boîte de réception." diff --git a/commafeed-client/src/locales/gl/messages.po b/commafeed-client/src/locales/gl/messages.po index 180db636..54751c04 100644 --- a/commafeed-client/src/locales/gl/messages.po +++ b/commafeed-client/src/locales/gl/messages.po @@ -71,6 +71,10 @@ msgstr "Administración" msgid "All" msgstr "Todos" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Enviouse un correo electrónico se este enderezo estaba rexistrado. " diff --git a/commafeed-client/src/locales/hu/messages.po b/commafeed-client/src/locales/hu/messages.po index 45c6defb..bcadb5eb 100644 --- a/commafeed-client/src/locales/hu/messages.po +++ b/commafeed-client/src/locales/hu/messages.po @@ -71,6 +71,10 @@ msgstr "" msgid "All" msgstr "Mind" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "E-mailt küldtünk, ha ez a cím regisztrálva volt. " diff --git a/commafeed-client/src/locales/id/messages.po b/commafeed-client/src/locales/id/messages.po index ddf0e027..f10556dc 100644 --- a/commafeed-client/src/locales/id/messages.po +++ b/commafeed-client/src/locales/id/messages.po @@ -71,6 +71,10 @@ msgstr "" msgid "All" msgstr "Semua" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Email telah dikirim jika alamat ini terdaftar. " diff --git a/commafeed-client/src/locales/it/messages.po b/commafeed-client/src/locales/it/messages.po index 14608899..a00cb7c7 100644 --- a/commafeed-client/src/locales/it/messages.po +++ b/commafeed-client/src/locales/it/messages.po @@ -71,6 +71,10 @@ msgstr "Ammin" msgid "All" msgstr "Tutto" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "È stata inviata un'e-mail se questo indirizzo è stato registrato. " diff --git a/commafeed-client/src/locales/ja/messages.po b/commafeed-client/src/locales/ja/messages.po index 0979635e..1116b80b 100644 --- a/commafeed-client/src/locales/ja/messages.po +++ b/commafeed-client/src/locales/ja/messages.po @@ -71,6 +71,10 @@ msgstr "管理人" msgid "All" msgstr "全員" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "このアドレスが登録されていれば、メールが送信されました。" diff --git a/commafeed-client/src/locales/ko/messages.po b/commafeed-client/src/locales/ko/messages.po index eb899482..1af49e36 100644 --- a/commafeed-client/src/locales/ko/messages.po +++ b/commafeed-client/src/locales/ko/messages.po @@ -71,6 +71,10 @@ msgstr "관리자" msgid "All" msgstr "전체" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "이 주소가 등록된 경우 이메일이 전송되었습니다. " diff --git a/commafeed-client/src/locales/ms/messages.po b/commafeed-client/src/locales/ms/messages.po index 47e659ed..44d2b794 100644 --- a/commafeed-client/src/locales/ms/messages.po +++ b/commafeed-client/src/locales/ms/messages.po @@ -71,6 +71,10 @@ msgstr "Pentadbir" msgid "All" msgstr "Semua" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "E-mel telah dihantar jika alamat ini didaftarkan. " diff --git a/commafeed-client/src/locales/nb/messages.po b/commafeed-client/src/locales/nb/messages.po index 1b9e2624..0e350b9c 100644 --- a/commafeed-client/src/locales/nb/messages.po +++ b/commafeed-client/src/locales/nb/messages.po @@ -71,6 +71,10 @@ msgstr "" msgid "All" msgstr "Alle" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "En e-post er sendt hvis denne adressen var registrert. " diff --git a/commafeed-client/src/locales/nl/messages.po b/commafeed-client/src/locales/nl/messages.po index f1915f88..39309f9b 100644 --- a/commafeed-client/src/locales/nl/messages.po +++ b/commafeed-client/src/locales/nl/messages.po @@ -71,6 +71,10 @@ msgstr "Beheerder" msgid "All" msgstr "Alles" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Er is een e-mail verzonden als dit adres is geregistreerd. " diff --git a/commafeed-client/src/locales/nn/messages.po b/commafeed-client/src/locales/nn/messages.po index fe927740..4dbefe92 100644 --- a/commafeed-client/src/locales/nn/messages.po +++ b/commafeed-client/src/locales/nn/messages.po @@ -71,6 +71,10 @@ msgstr "" msgid "All" msgstr "Alle" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "En e-post er sendt hvis denne adressen var registrert. " diff --git a/commafeed-client/src/locales/pl/messages.po b/commafeed-client/src/locales/pl/messages.po index 2a788f3a..3025c141 100644 --- a/commafeed-client/src/locales/pl/messages.po +++ b/commafeed-client/src/locales/pl/messages.po @@ -71,6 +71,10 @@ msgstr "Administracja" msgid "All" msgstr "Wszystkie" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "E-mail został wysłany, jeśli ten adres został zarejestrowany. " diff --git a/commafeed-client/src/locales/pt/messages.po b/commafeed-client/src/locales/pt/messages.po index 3caa5d23..88791ed2 100644 --- a/commafeed-client/src/locales/pt/messages.po +++ b/commafeed-client/src/locales/pt/messages.po @@ -71,6 +71,10 @@ msgstr "Administrador" msgid "All" msgstr "Todos" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Um email foi enviado se este endereço foi registrado. " diff --git a/commafeed-client/src/locales/ru/messages.po b/commafeed-client/src/locales/ru/messages.po index ade6de8d..4f5862c2 100644 --- a/commafeed-client/src/locales/ru/messages.po +++ b/commafeed-client/src/locales/ru/messages.po @@ -71,6 +71,10 @@ msgstr "Админ" msgid "All" msgstr "Все" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Электронное письмо было отправлено, если этот адрес был зарегистрирован. " diff --git a/commafeed-client/src/locales/sk/messages.po b/commafeed-client/src/locales/sk/messages.po index 6eb8f770..c28e4736 100644 --- a/commafeed-client/src/locales/sk/messages.po +++ b/commafeed-client/src/locales/sk/messages.po @@ -71,6 +71,10 @@ msgstr "Správca" msgid "All" msgstr "Všetky" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "E-mail bol odoslaný, ak bola táto adresa zaregistrovaná. " diff --git a/commafeed-client/src/locales/sv/messages.po b/commafeed-client/src/locales/sv/messages.po index a2f417d0..3c8cd1fc 100644 --- a/commafeed-client/src/locales/sv/messages.po +++ b/commafeed-client/src/locales/sv/messages.po @@ -71,6 +71,10 @@ msgstr "" msgid "All" msgstr "Alla" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Ett e-postmeddelande har skickats om denna adress var registrerad. " diff --git a/commafeed-client/src/locales/tr/messages.po b/commafeed-client/src/locales/tr/messages.po index 9edeaa85..88f803c1 100644 --- a/commafeed-client/src/locales/tr/messages.po +++ b/commafeed-client/src/locales/tr/messages.po @@ -71,6 +71,10 @@ msgstr "Yönetici" msgid "All" msgstr "Tümü" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "Bu adres kayıtlıysa bir e-posta gönderildi. " diff --git a/commafeed-client/src/locales/zh/messages.po b/commafeed-client/src/locales/zh/messages.po index b7610e9a..a1146513 100644 --- a/commafeed-client/src/locales/zh/messages.po +++ b/commafeed-client/src/locales/zh/messages.po @@ -71,6 +71,10 @@ msgstr "管理员" msgid "All" msgstr "全部" +#: src/components/settings/DisplaySettings.tsx +msgid "Always scroll selected entry to the top of the page, even if it fits entirely on screen" +msgstr "" + #: src/pages/auth/PasswordRecoveryPage.tsx msgid "An email has been sent if this address was registered. Check your inbox." msgstr "如果此地址已注册,则已发送电子邮件。" diff --git a/commafeed-server/src/main/java/com/commafeed/backend/model/UserSettings.java b/commafeed-server/src/main/java/com/commafeed/backend/model/UserSettings.java index c531d390..9d22bb96 100644 --- a/commafeed-server/src/main/java/com/commafeed/backend/model/UserSettings.java +++ b/commafeed-server/src/main/java/com/commafeed/backend/model/UserSettings.java @@ -65,6 +65,8 @@ public class UserSettings extends AbstractModel { @Column(name = "scroll_speed") private int scrollSpeed; + private boolean alwaysScrollToEntry; + private boolean email; private boolean gmail; private boolean facebook; diff --git a/commafeed-server/src/main/java/com/commafeed/frontend/model/Settings.java b/commafeed-server/src/main/java/com/commafeed/frontend/model/Settings.java index e96ba183..c3823a7b 100644 --- a/commafeed-server/src/main/java/com/commafeed/frontend/model/Settings.java +++ b/commafeed-server/src/main/java/com/commafeed/frontend/model/Settings.java @@ -35,6 +35,9 @@ public class Settings implements Serializable { @ApiModelProperty(value = "user's preferred scroll speed when navigating between entries", required = true) private int scrollSpeed; + @ApiModelProperty(value = "always scroll selected entry to the top of the page, even if it fits entirely on screen", required = true) + private boolean alwaysScrollToEntry; + @ApiModelProperty(value = "sharing settings", required = true) private SharingSettings sharingSettings = new SharingSettings(); diff --git a/commafeed-server/src/main/java/com/commafeed/frontend/resource/UserREST.java b/commafeed-server/src/main/java/com/commafeed/frontend/resource/UserREST.java index 493d62cc..2531fa6e 100644 --- a/commafeed-server/src/main/java/com/commafeed/frontend/resource/UserREST.java +++ b/commafeed-server/src/main/java/com/commafeed/frontend/resource/UserREST.java @@ -103,6 +103,7 @@ public class UserREST { s.setCustomJs(settings.getCustomJs()); s.setLanguage(settings.getLanguage()); s.setScrollSpeed(settings.getScrollSpeed()); + s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry()); } else { s.setReadingMode(ReadingMode.unread.name()); s.setReadingOrder(ReadingOrder.desc.name()); @@ -120,6 +121,7 @@ public class UserREST { s.setScrollMarks(true); s.setLanguage("en"); s.setScrollSpeed(400); + s.setAlwaysScrollToEntry(false); } return Response.ok(s).build(); } @@ -145,6 +147,7 @@ public class UserREST { s.setCustomJs(settings.getCustomJs()); s.setLanguage(settings.getLanguage()); s.setScrollSpeed(settings.getScrollSpeed()); + s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry()); s.setEmail(settings.getSharingSettings().isEmail()); s.setGmail(settings.getSharingSettings().isGmail()); diff --git a/commafeed-server/src/main/resources/changelogs/db.changelog-3.8.xml b/commafeed-server/src/main/resources/changelogs/db.changelog-3.8.xml new file mode 100644 index 00000000..2eaeaa95 --- /dev/null +++ b/commafeed-server/src/main/resources/changelogs/db.changelog-3.8.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/commafeed-server/src/main/resources/migrations.xml b/commafeed-server/src/main/resources/migrations.xml index 9952015f..dbcf0800 100644 --- a/commafeed-server/src/main/resources/migrations.xml +++ b/commafeed-server/src/main/resources/migrations.xml @@ -20,5 +20,6 @@ + \ No newline at end of file