diff --git a/commafeed-client/src/app/constants.ts b/commafeed-client/src/app/constants.ts index d81f69607..890b334b2 100644 --- a/commafeed-client/src/app/constants.ts +++ b/commafeed-client/src/app/constants.ts @@ -93,10 +93,14 @@ export const Constants = { const header = document.getElementById(Constants.dom.headerId)?.getBoundingClientRect() return div.getBoundingClientRect().top >= (header?.bottom ?? 0) }, - isBottomVisible: (div: HTMLElement) => div.getBoundingClientRect().bottom <= window.innerHeight, + isBottomVisible: (div: HTMLElement) => { + const footer = document.getElementById(Constants.dom.footerId)?.getBoundingClientRect() + return div.getBoundingClientRect().bottom <= (footer?.top ?? window.innerHeight) + }, }, dom: { headerId: "header", + footerId: "footer", entryId: (entry: Entry) => `entry-id-${entry.id}`, entryContextMenuId: (entry: Entry) => entry.id, }, diff --git a/commafeed-client/src/app/types.ts b/commafeed-client/src/app/types.ts index 9866e1aa8..b5ccbb38b 100644 --- a/commafeed-client/src/app/types.ts +++ b/commafeed-client/src/app/types.ts @@ -208,6 +208,7 @@ export interface Settings { alwaysScrollToEntry: boolean markAllAsReadConfirmation: boolean customContextMenu: boolean + mobileFooter: boolean sharingSettings: SharingSettings } diff --git a/commafeed-client/src/app/user/slice.ts b/commafeed-client/src/app/user/slice.ts index a30421c47..7a7b1899f 100644 --- a/commafeed-client/src/app/user/slice.ts +++ b/commafeed-client/src/app/user/slice.ts @@ -7,6 +7,7 @@ import { changeCustomContextMenu, changeLanguage, changeMarkAllAsReadConfirmation, + changeMobileFooter, changeReadingMode, changeReadingOrder, changeScrollMarks, @@ -76,6 +77,10 @@ export const userSlice = createSlice({ if (!state.settings) return state.settings.customContextMenu = action.meta.arg }) + builder.addCase(changeMobileFooter.pending, (state, action) => { + if (!state.settings) return + state.settings.mobileFooter = action.meta.arg + }) builder.addCase(changeSharingSetting.pending, (state, action) => { if (!state.settings) return state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value @@ -89,6 +94,7 @@ export const userSlice = createSlice({ changeAlwaysScrollToEntry.fulfilled, changeMarkAllAsReadConfirmation.fulfilled, changeCustomContextMenu.fulfilled, + changeMobileFooter.fulfilled, changeSharingSetting.fulfilled ), () => { diff --git a/commafeed-client/src/app/user/thunks.ts b/commafeed-client/src/app/user/thunks.ts index 2d493c68f..31247d737 100644 --- a/commafeed-client/src/app/user/thunks.ts +++ b/commafeed-client/src/app/user/thunks.ts @@ -56,6 +56,11 @@ export const changeCustomContextMenu = createAppAsyncThunk("settings/customConte if (!settings) return client.user.saveSettings({ ...settings, customContextMenu }) }) +export const changeMobileFooter = createAppAsyncThunk("settings/mobileFooter", (mobileFooter: boolean, thunkApi) => { + const { settings } = thunkApi.getState().user + if (!settings) return + client.user.saveSettings({ ...settings, mobileFooter }) +}) export const changeSharingSetting = createAppAsyncThunk( "settings/sharingSetting", ( diff --git a/commafeed-client/src/components/settings/DisplaySettings.tsx b/commafeed-client/src/components/settings/DisplaySettings.tsx index cf8959715..bf4e09938 100644 --- a/commafeed-client/src/components/settings/DisplaySettings.tsx +++ b/commafeed-client/src/components/settings/DisplaySettings.tsx @@ -8,6 +8,7 @@ import { changeCustomContextMenu, changeLanguage, changeMarkAllAsReadConfirmation, + changeMobileFooter, changeScrollMarks, changeScrollSpeed, changeSharingSetting, @@ -23,6 +24,7 @@ export function DisplaySettings() { const alwaysScrollToEntry = useAppSelector(state => state.user.settings?.alwaysScrollToEntry) const markAllAsReadConfirmation = useAppSelector(state => state.user.settings?.markAllAsReadConfirmation) const customContextMenu = useAppSelector(state => state.user.settings?.customContextMenu) + const mobileFooter = useAppSelector(state => state.user.settings?.mobileFooter) const sharingSettings = useAppSelector(state => state.user.settings?.sharingSettings) const dispatch = useAppDispatch() @@ -74,6 +76,12 @@ export function DisplaySettings() { onChange={async e => await dispatch(changeCustomContextMenu(e.currentTarget.checked))} /> + On mobile, show action buttons at the bottom of the screen} + checked={mobileFooter} + onChange={async e => await dispatch(changeMobileFooter(e.currentTarget.checked))} + /> + Sharing sites} labelPosition="center" /> diff --git a/commafeed-client/src/locales/ar/messages.po b/commafeed-client/src/locales/ar/messages.po index 26a6c3b29..df450e3f4 100644 --- a/commafeed-client/src/locales/ar/messages.po +++ b/commafeed-client/src/locales/ar/messages.po @@ -574,6 +574,10 @@ msgstr "لم يتم العثور على شيء" msgid "Oldest first" msgstr "الأقدم أولا" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "اوووه!" diff --git a/commafeed-client/src/locales/ca/messages.po b/commafeed-client/src/locales/ca/messages.po index 21481f932..20a443011 100644 --- a/commafeed-client/src/locales/ca/messages.po +++ b/commafeed-client/src/locales/ca/messages.po @@ -574,6 +574,10 @@ msgstr "No s'ha trobat res" msgid "Oldest first" msgstr "el més vell primer" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Vaja!" diff --git a/commafeed-client/src/locales/cs/messages.po b/commafeed-client/src/locales/cs/messages.po index 6231941f9..291a0dd40 100644 --- a/commafeed-client/src/locales/cs/messages.po +++ b/commafeed-client/src/locales/cs/messages.po @@ -574,6 +574,10 @@ msgstr "Nic nebylo nalezeno" msgid "Oldest first" msgstr "Nejdříve nejstarší" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Jejda!" diff --git a/commafeed-client/src/locales/cy/messages.po b/commafeed-client/src/locales/cy/messages.po index 567fcce1f..33c99bfad 100644 --- a/commafeed-client/src/locales/cy/messages.po +++ b/commafeed-client/src/locales/cy/messages.po @@ -574,6 +574,10 @@ msgstr "Dim wedi'i ddarganfod" msgid "Oldest first" msgstr "Hynaf yn gyntaf" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Wps!" diff --git a/commafeed-client/src/locales/da/messages.po b/commafeed-client/src/locales/da/messages.po index 1065c3a1d..dacede338 100644 --- a/commafeed-client/src/locales/da/messages.po +++ b/commafeed-client/src/locales/da/messages.po @@ -574,6 +574,10 @@ msgstr "Intet fundet" msgid "Oldest first" msgstr "Ældst først" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Hovsa!" diff --git a/commafeed-client/src/locales/de/messages.po b/commafeed-client/src/locales/de/messages.po index 3f9f63ba6..4b122546f 100644 --- a/commafeed-client/src/locales/de/messages.po +++ b/commafeed-client/src/locales/de/messages.po @@ -574,6 +574,10 @@ msgstr "Nichts gefunden" msgid "Oldest first" msgstr "Älteste zuerst" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Ups!" diff --git a/commafeed-client/src/locales/en/messages.po b/commafeed-client/src/locales/en/messages.po index e2c385f5b..c53b339f8 100644 --- a/commafeed-client/src/locales/en/messages.po +++ b/commafeed-client/src/locales/en/messages.po @@ -574,6 +574,10 @@ msgstr "Nothing found" msgid "Oldest first" msgstr "Oldest first" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "On mobile, show action buttons at the bottom of the screen" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Oops!" diff --git a/commafeed-client/src/locales/es/messages.po b/commafeed-client/src/locales/es/messages.po index 1ff0d201a..66054845a 100644 --- a/commafeed-client/src/locales/es/messages.po +++ b/commafeed-client/src/locales/es/messages.po @@ -574,6 +574,10 @@ msgstr "Nada encontrado" msgid "Oldest first" msgstr "más antigua primero" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "¡Ups!" diff --git a/commafeed-client/src/locales/fa/messages.po b/commafeed-client/src/locales/fa/messages.po index 23d69cc8d..57608421e 100644 --- a/commafeed-client/src/locales/fa/messages.po +++ b/commafeed-client/src/locales/fa/messages.po @@ -574,6 +574,10 @@ msgstr "چیزی پیدا نشد" msgid "Oldest first" msgstr "قدیمی ترین اول" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "اوه!" diff --git a/commafeed-client/src/locales/fi/messages.po b/commafeed-client/src/locales/fi/messages.po index 873e09218..95e20436c 100644 --- a/commafeed-client/src/locales/fi/messages.po +++ b/commafeed-client/src/locales/fi/messages.po @@ -574,6 +574,10 @@ msgstr "Mitään ei löytynyt" msgid "Oldest first" msgstr "Vanhin ensin" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Hups!" diff --git a/commafeed-client/src/locales/fr/messages.po b/commafeed-client/src/locales/fr/messages.po index 45c9b439d..ff040fcca 100644 --- a/commafeed-client/src/locales/fr/messages.po +++ b/commafeed-client/src/locales/fr/messages.po @@ -574,6 +574,10 @@ msgstr "Aucun résultat" msgid "Oldest first" msgstr "Du plus ancien au plus récent" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Oups !" diff --git a/commafeed-client/src/locales/gl/messages.po b/commafeed-client/src/locales/gl/messages.po index 890866997..0806f7a4d 100644 --- a/commafeed-client/src/locales/gl/messages.po +++ b/commafeed-client/src/locales/gl/messages.po @@ -574,6 +574,10 @@ msgstr "Non se atopou nada" msgid "Oldest first" msgstr "O máis vello primeiro" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Vaia!" diff --git a/commafeed-client/src/locales/hu/messages.po b/commafeed-client/src/locales/hu/messages.po index fcbd998e1..7d11a7a21 100644 --- a/commafeed-client/src/locales/hu/messages.po +++ b/commafeed-client/src/locales/hu/messages.po @@ -574,6 +574,10 @@ msgstr "Semmi sem található" msgid "Oldest first" msgstr "A legidősebb első" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Hoppá!" diff --git a/commafeed-client/src/locales/id/messages.po b/commafeed-client/src/locales/id/messages.po index b7710b9ee..a3fecf5d6 100644 --- a/commafeed-client/src/locales/id/messages.po +++ b/commafeed-client/src/locales/id/messages.po @@ -574,6 +574,10 @@ msgstr "Tidak ada yang ditemukan" msgid "Oldest first" msgstr "Tertua dulu" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Ups!" diff --git a/commafeed-client/src/locales/it/messages.po b/commafeed-client/src/locales/it/messages.po index f95c237d6..e3a8e0b48 100644 --- a/commafeed-client/src/locales/it/messages.po +++ b/commafeed-client/src/locales/it/messages.po @@ -574,6 +574,10 @@ msgstr "Non è stato trovato nulla" msgid "Oldest first" msgstr "Il più vecchio prima" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Ops!" diff --git a/commafeed-client/src/locales/ja/messages.po b/commafeed-client/src/locales/ja/messages.po index d665bf923..4a51f1b31 100644 --- a/commafeed-client/src/locales/ja/messages.po +++ b/commafeed-client/src/locales/ja/messages.po @@ -574,6 +574,10 @@ msgstr "何も見つかりませんでした" msgid "Oldest first" msgstr "古い順" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "おっと!" diff --git a/commafeed-client/src/locales/ko/messages.po b/commafeed-client/src/locales/ko/messages.po index 723c4ede5..f83d0f723 100644 --- a/commafeed-client/src/locales/ko/messages.po +++ b/commafeed-client/src/locales/ko/messages.po @@ -574,6 +574,10 @@ msgstr "아무것도 찾을 수 없습니다" msgid "Oldest first" msgstr "가장 오래된 것부터" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "앗!" diff --git a/commafeed-client/src/locales/ms/messages.po b/commafeed-client/src/locales/ms/messages.po index 4e06677fb..25527c21a 100644 --- a/commafeed-client/src/locales/ms/messages.po +++ b/commafeed-client/src/locales/ms/messages.po @@ -574,6 +574,10 @@ msgstr "Tiada apa-apa dijumpai" msgid "Oldest first" msgstr "Tertua dahulu" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Aduh!" diff --git a/commafeed-client/src/locales/nb/messages.po b/commafeed-client/src/locales/nb/messages.po index 92b5be0b8..9bb2ad136 100644 --- a/commafeed-client/src/locales/nb/messages.po +++ b/commafeed-client/src/locales/nb/messages.po @@ -574,6 +574,10 @@ msgstr "Ingenting funnet" msgid "Oldest first" msgstr "Eldste først" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Beklager!" diff --git a/commafeed-client/src/locales/nl/messages.po b/commafeed-client/src/locales/nl/messages.po index 1edafb8e8..b0f08ddf8 100644 --- a/commafeed-client/src/locales/nl/messages.po +++ b/commafeed-client/src/locales/nl/messages.po @@ -574,6 +574,10 @@ msgstr "Niets gevonden" msgid "Oldest first" msgstr "Oudste eerst" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Oeps!" diff --git a/commafeed-client/src/locales/nn/messages.po b/commafeed-client/src/locales/nn/messages.po index c2b1072e2..21d729649 100644 --- a/commafeed-client/src/locales/nn/messages.po +++ b/commafeed-client/src/locales/nn/messages.po @@ -574,6 +574,10 @@ msgstr "Ingenting funnet" msgid "Oldest first" msgstr "Eldste først" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Beklager!" diff --git a/commafeed-client/src/locales/pl/messages.po b/commafeed-client/src/locales/pl/messages.po index c53dc9b77..98f60a33d 100644 --- a/commafeed-client/src/locales/pl/messages.po +++ b/commafeed-client/src/locales/pl/messages.po @@ -574,6 +574,10 @@ msgstr "Nic nie znaleziono" msgid "Oldest first" msgstr "Najstarsze jako pierwsze" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Ups!" diff --git a/commafeed-client/src/locales/pt/messages.po b/commafeed-client/src/locales/pt/messages.po index ced15f03d..800dfb14a 100644 --- a/commafeed-client/src/locales/pt/messages.po +++ b/commafeed-client/src/locales/pt/messages.po @@ -574,6 +574,10 @@ msgstr "Nada encontrado" msgid "Oldest first" msgstr "Mais antigo primeiro" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Opa!" diff --git a/commafeed-client/src/locales/ru/messages.po b/commafeed-client/src/locales/ru/messages.po index 2ad89b790..71a63d3e0 100644 --- a/commafeed-client/src/locales/ru/messages.po +++ b/commafeed-client/src/locales/ru/messages.po @@ -574,6 +574,10 @@ msgstr "Ничего не найдено" msgid "Oldest first" msgstr "Сначала самые старые" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Ой!" diff --git a/commafeed-client/src/locales/sk/messages.po b/commafeed-client/src/locales/sk/messages.po index 78628f076..a51c7ef3e 100644 --- a/commafeed-client/src/locales/sk/messages.po +++ b/commafeed-client/src/locales/sk/messages.po @@ -574,6 +574,10 @@ msgstr "Nič sa nenašlo" msgid "Oldest first" msgstr "Najprv najstarší" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Ojoj!" diff --git a/commafeed-client/src/locales/sv/messages.po b/commafeed-client/src/locales/sv/messages.po index dacdaa076..b3bddc9de 100644 --- a/commafeed-client/src/locales/sv/messages.po +++ b/commafeed-client/src/locales/sv/messages.po @@ -574,6 +574,10 @@ msgstr "Inget hittades" msgid "Oldest first" msgstr "Äldst först" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Hoppsan!" diff --git a/commafeed-client/src/locales/tr/messages.po b/commafeed-client/src/locales/tr/messages.po index 68ba22f69..dac8d05b2 100644 --- a/commafeed-client/src/locales/tr/messages.po +++ b/commafeed-client/src/locales/tr/messages.po @@ -574,6 +574,10 @@ msgstr "Hiçbir şey bulunamadı" msgid "Oldest first" msgstr "Önce en eski" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "Hata!" diff --git a/commafeed-client/src/locales/zh/messages.po b/commafeed-client/src/locales/zh/messages.po index 152f858b3..efcbb4520 100644 --- a/commafeed-client/src/locales/zh/messages.po +++ b/commafeed-client/src/locales/zh/messages.po @@ -574,6 +574,10 @@ msgstr "没有找到" msgid "Oldest first" msgstr "最早的优先" +#: src/components/settings/DisplaySettings.tsx +msgid "On mobile, show action buttons at the bottom of the screen" +msgstr "" + #: src/pages/ErrorPage.tsx msgid "Oops!" msgstr "哎呀!" diff --git a/commafeed-client/src/pages/app/Layout.tsx b/commafeed-client/src/pages/app/Layout.tsx index 497597648..571e7797f 100644 --- a/commafeed-client/src/pages/app/Layout.tsx +++ b/commafeed-client/src/pages/app/Layout.tsx @@ -13,6 +13,8 @@ import { Logo } from "components/Logo" import { OnDesktop } from "components/responsive/OnDesktop" import { OnMobile } from "components/responsive/OnMobile" import { useAppLoading } from "hooks/useAppLoading" +import { useBrowserExtension } from "hooks/useBrowserExtension" +import { useMobile } from "hooks/useMobile" import { useWebSocket } from "hooks/useWebSocket" import { LoadingPage } from "pages/LoadingPage" import { type ReactNode, Suspense, useEffect } from "react" @@ -60,6 +62,8 @@ const useStyles = tss export default function Layout(props: LayoutProps) { const theme = useMantineTheme() + const mobile = useMobile() + const { isBrowserExtensionPopup } = useBrowserExtension() const [sidebarWidth, setSidebarWidth] = useLocalStorage("sidebar-width", 350) const sidebarPadding = theme.spacing.xs const { classes } = useStyles({ @@ -71,6 +75,8 @@ export default function Layout(props: LayoutProps) { const mobileMenuOpen = useAppSelector(state => state.tree.mobileMenuOpen) const webSocketConnected = useAppSelector(state => state.server.webSocketConnected) const treeReloadInterval = useAppSelector(state => state.server.serverInfos?.treeReloadInterval) + const mobileFooter = useAppSelector(state => state.user.settings?.mobileFooter) + const headerInFooter = mobile && !isBrowserExtensionPopup && mobileFooter const dispatch = useAppDispatch() useWebSocket() @@ -112,6 +118,39 @@ export default function Layout(props: LayoutProps) { ) + const header = ( + <> + + {mobileMenuOpen && ( + + {burger} + + + + {addButton} + + )} + {!mobileMenuOpen && ( + + {burger} + {props.header} + + )} + + + + + + + + {addButton} + + {props.header} + + + + ) + const swipeHandlers = useSwipeable({ onSwiping: e => { const threshold = document.documentElement.clientWidth / 6 @@ -125,7 +164,8 @@ export default function Layout(props: LayoutProps) { return ( - - - {mobileMenuOpen && ( - - {burger} - - - - {addButton} - - )} - {!mobileMenuOpen && ( - - {burger} - {props.header} - - )} - - - - - - - - {addButton} - - {props.header} - - - + {header} + {header} {props.sidebar} 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 124986d85..800bf4b04 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 @@ -69,6 +69,7 @@ public enum ViewMode { private boolean alwaysScrollToEntry; private boolean markAllAsReadConfirmation; private boolean customContextMenu; + private boolean mobileFooter; private boolean email; private boolean gmail; 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 5b2598259..c95cfc0b1 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 @@ -52,6 +52,9 @@ public class Settings implements Serializable { @Schema(description = "show commafeed's own context menu on right click", requiredMode = RequiredMode.REQUIRED) private boolean customContextMenu; + @Schema(description = "on mobile, show action buttons at the bottom of the screen", requiredMode = RequiredMode.REQUIRED) + private boolean mobileFooter; + @Schema(description = "sharing settings", requiredMode = RequiredMode.REQUIRED) 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 b53c556cb..cb4771289 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 @@ -111,6 +111,7 @@ public Response getUserSettings(@Parameter(hidden = true) @SecurityCheck User us s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry()); s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation()); s.setCustomContextMenu(settings.isCustomContextMenu()); + s.setMobileFooter(settings.isMobileFooter()); } else { s.setReadingMode(ReadingMode.unread.name()); s.setReadingOrder(ReadingOrder.desc.name()); @@ -131,6 +132,7 @@ public Response getUserSettings(@Parameter(hidden = true) @SecurityCheck User us s.setAlwaysScrollToEntry(false); s.setMarkAllAsReadConfirmation(true); s.setCustomContextMenu(true); + s.setMobileFooter(false); } return Response.ok(s).build(); } @@ -159,6 +161,7 @@ public Response saveUserSettings(@Parameter(hidden = true) @SecurityCheck User u s.setAlwaysScrollToEntry(settings.isAlwaysScrollToEntry()); s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation()); s.setCustomContextMenu(settings.isCustomContextMenu()); + s.setMobileFooter(settings.isMobileFooter()); s.setEmail(settings.getSharingSettings().isEmail()); s.setGmail(settings.getSharingSettings().isGmail()); diff --git a/commafeed-server/src/main/resources/changelogs/db.changelog-4.2.xml b/commafeed-server/src/main/resources/changelogs/db.changelog-4.2.xml index 837aa5133..a52f67d63 100644 --- a/commafeed-server/src/main/resources/changelogs/db.changelog-4.2.xml +++ b/commafeed-server/src/main/resources/changelogs/db.changelog-4.2.xml @@ -18,4 +18,12 @@ + + + + + + + +