diff --git a/.prettierignore b/.prettierignore index 1cbfba7df..5ef4cafc8 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,3 +7,5 @@ apps/external/postcss.config.cjs apps/mobile/android apps/mobile/ios +apps/mobile/native/example + diff --git a/LICENSE b/LICENSE index 9e04c9ed1..461bc15e2 100644 --- a/LICENSE +++ b/LICENSE @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} + Copyright (C) 2024-Present RSSNext This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - {project} Copyright (C) {year} {fullname} + Folo Copyright (C) 2024-Present RSSNext This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/README.md b/README.md index e5f2a3e9e..72c6d5293 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Feel free to try it using the following methods: | iOS | App Store | | macOS | Microsoft Store App Store | | Windows | Microsoft Store App Store | +| Android | Google Play | | Linux | App Store | You can also install using the following methods maintained by our community: diff --git a/apps/desktop/changelog/next.md b/apps/desktop/changelog/next.md index eb0db6436..30e1ec95e 100644 --- a/apps/desktop/changelog/next.md +++ b/apps/desktop/changelog/next.md @@ -2,6 +2,8 @@ ## Shiny new things +- **New Keyboard Shortcuts System**: Introduced a comprehensive command shortcut system supporting multiple categories including global operations, layout controls, timeline navigation, content rendering, subscription management, and entry actions. Access all available shortcuts and customize key bindings via `Settings` -> `Shortcuts`. + ## Improvements ## No longer broken diff --git a/apps/desktop/configs/vite.render.config.ts b/apps/desktop/configs/vite.render.config.ts index 4178ee333..4fa8bff20 100644 --- a/apps/desktop/configs/vite.render.config.ts +++ b/apps/desktop/configs/vite.render.config.ts @@ -51,6 +51,7 @@ export const viteRenderBaseConfig = { codeInspectorPlugin({ bundler: "vite", + hotKeys: ["altKey"], editor: "cursor", }), sentryVitePlugin({ diff --git a/apps/desktop/forge.config.cts b/apps/desktop/forge.config.cts index 567ff65af..076fb5dcd 100644 --- a/apps/desktop/forge.config.cts +++ b/apps/desktop/forge.config.cts @@ -107,6 +107,10 @@ const config: ForgeConfig = { name: "Folo", schemes: ["follow"], }, + { + name: "Folo", + schemes: ["folo"], + }, ], afterCopy: [ diff --git a/apps/desktop/layer/main/src/index.ts b/apps/desktop/layer/main/src/index.ts index adcdcd8b9..2fbb25cff 100644 --- a/apps/desktop/layer/main/src/index.ts +++ b/apps/desktop/layer/main/src/index.ts @@ -2,7 +2,7 @@ import "./side-effects" import { electronApp, optimizer } from "@electron-toolkit/utils" import { callWindowExpose } from "@follow/shared/bridge" -import { APP_PROTOCOL, DEV } from "@follow/shared/constants" +import { DEV, LEGACY_APP_PROTOCOL } from "@follow/shared/constants" import { env } from "@follow/shared/env.desktop" import { createBuildSafeHeaders } from "@follow/utils/headers" import { IMAGE_PROXY_URL } from "@follow/utils/img-proxy" @@ -101,7 +101,7 @@ function bootstrap() { }) // Set app user model id for windows - electronApp.setAppUserModelId(`re.${APP_PROTOCOL}`) + electronApp.setAppUserModelId(`re.${LEGACY_APP_PROTOCOL}`) session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => { details.requestHeaders = buildSafeHeaders({ @@ -117,6 +117,7 @@ function bootstrap() { updateProxy() registerUpdater() registerAppTray() + updateNotificationsToken() app.on("open-url", (_, url) => { if (mainWindow && !mainWindow.isDestroyed()) { diff --git a/apps/desktop/layer/main/src/init.ts b/apps/desktop/layer/main/src/init.ts index cba43e38f..817a37124 100644 --- a/apps/desktop/layer/main/src/init.ts +++ b/apps/desktop/layer/main/src/init.ts @@ -2,7 +2,7 @@ import path from "node:path" import { getRendererHandlers, registerIpcMain } from "@egoist/tipc/main" import { PushReceiver } from "@eneris/push-receiver" -import { APP_PROTOCOL, DEV } from "@follow/shared/constants" +import { APP_PROTOCOL, DEV, LEGACY_APP_PROTOCOL } from "@follow/shared/constants" import { env } from "@follow/shared/env.desktop" import type { MessagingData } from "@follow/shared/hono" import { app, nativeTheme, Notification, protocol, shell } from "electron" @@ -18,7 +18,7 @@ import { registerAppMenu } from "./menu" import type { RendererHandlers } from "./renderer-handlers" import { initializeSentry } from "./sentry" import { router } from "./tipc" -import { createMainWindow, getMainWindow } from "./window" +import { getMainWindowOrCreate } from "./window" if (process.argv.length === 3 && process.argv[2]!.startsWith("follow-dev:")) { process.env.NODE_ENV = "development" @@ -31,14 +31,16 @@ export function initializeAppStage0() { initializeSentry() } export const initializeAppStage1 = () => { - if (process.defaultApp) { - if (process.argv.length >= 2) { - app.setAsDefaultProtocolClient(APP_PROTOCOL, process.execPath, [ - path.resolve(process.argv[1]!), - ]) + const protocols = [LEGACY_APP_PROTOCOL, APP_PROTOCOL] + + for (const protocol of protocols) { + if (process.defaultApp) { + if (process.argv.length >= 2) { + app.setAsDefaultProtocolClient(protocol, process.execPath, [path.resolve(process.argv[1]!)]) + } + } else { + app.setAsDefaultProtocolClient(protocol) } - } else { - app.setAsDefaultProtocolClient(APP_PROTOCOL) } registerIpcMain(router) @@ -184,10 +186,7 @@ const registerPushNotifications = async () => { body: data.description, }) notification.on("click", () => { - let mainWindow = getMainWindow() - if (!mainWindow) { - mainWindow = createMainWindow() - } + const mainWindow = getMainWindowOrCreate() mainWindow.restore() mainWindow.focus() const handlers = getRendererHandlers(mainWindow.webContents) diff --git a/apps/desktop/layer/main/src/lib/user.ts b/apps/desktop/layer/main/src/lib/user.ts index 1432f2b91..0fb03370f 100644 --- a/apps/desktop/layer/main/src/lib/user.ts +++ b/apps/desktop/layer/main/src/lib/user.ts @@ -27,6 +27,7 @@ export const updateNotificationsToken = async (newCredentials?: Credentials) => channel: notificationChannel, }, }) + logger.info("updateNotificationsToken success: ", credentials.fcm.token) } catch (error) { logger.error("updateNotificationsToken error: ", error) } diff --git a/apps/desktop/layer/main/src/menu.ts b/apps/desktop/layer/main/src/menu.ts index 2ebced65d..2f654b70f 100644 --- a/apps/desktop/layer/main/src/menu.ts +++ b/apps/desktop/layer/main/src/menu.ts @@ -135,18 +135,7 @@ export const registerAppMenu = () => { { role: "zoomIn", label: t("menu.zoomIn") }, { role: "zoomOut", label: t("menu.zoomOut") }, { type: "separator" }, - { - type: "normal", - label: t("menu.zenMode"), - accelerator: "Ctrl+Shift+Z", - click: () => { - const mainWindow = getMainWindow() - if (!mainWindow) return - const caller = callWindowExpose(mainWindow) - caller.zenMode() - }, - }, { role: "togglefullscreen", label: t("menu.toggleFullScreen") }, ], }, diff --git a/apps/desktop/layer/main/src/tipc/setting.ts b/apps/desktop/layer/main/src/tipc/setting.ts index c6dd2dc06..c7754d13c 100644 --- a/apps/desktop/layer/main/src/tipc/setting.ts +++ b/apps/desktop/layer/main/src/tipc/setting.ts @@ -51,4 +51,7 @@ export const settingRoute = { updateProxy() return result }), + getMessagingToken: t.procedure.action(async () => { + return store.get("notifications-credentials") + }), } diff --git a/apps/desktop/layer/main/src/window.ts b/apps/desktop/layer/main/src/window.ts index 3a9597e66..0cb76a7b2 100644 --- a/apps/desktop/layer/main/src/window.ts +++ b/apps/desktop/layer/main/src/window.ts @@ -2,9 +2,9 @@ import path from "node:path" import { fileURLToPath } from "node:url" import { is } from "@electron-toolkit/utils" -import { APP_PROTOCOL } from "@follow/shared" +import { LEGACY_APP_PROTOCOL } from "@follow/shared" import { callWindowExpose, WindowState } from "@follow/shared/bridge" -import { DEV } from "@follow/shared/constants" +import { APP_PROTOCOL, DEV } from "@follow/shared/constants" import type { BrowserWindowConstructorOptions } from "electron" import { app, BrowserWindow, screen, shell } from "electron" import type { Event } from "electron/main" @@ -112,7 +112,16 @@ export function createWindow( const handleExternalProtocol = async (e: Event, url: string, window: BrowserWindow) => { const { protocol } = new URL(url) - const ignoreProtocols = ["http", "https", APP_PROTOCOL, "file", "code", "cursor", "app"] + const ignoreProtocols = [ + "http", + "https", + LEGACY_APP_PROTOCOL, + APP_PROTOCOL, + "file", + "code", + "cursor", + "app", + ] if (ignoreProtocols.includes(protocol.slice(0, -1))) { return } diff --git a/apps/desktop/layer/renderer/global.d.ts b/apps/desktop/layer/renderer/global.d.ts index 7051cdaef..571d94de2 100644 --- a/apps/desktop/layer/renderer/global.d.ts +++ b/apps/desktop/layer/renderer/global.d.ts @@ -6,6 +6,7 @@ declare global { api?: { canWindowBlur: boolean } platform: NodeJS.Platform } + export const APP_NAME = "Folo" } declare module "virtual:pwa-register/react" { diff --git a/apps/desktop/layer/renderer/index.html b/apps/desktop/layer/renderer/index.html index 65aaebabf..b3a951265 100644 --- a/apps/desktop/layer/renderer/index.html +++ b/apps/desktop/layer/renderer/index.html @@ -62,8 +62,7 @@ setTheme() // Can not get window.electron so check userAgent const isElectron = navigator.userAgent.includes("Electron") - const isRN = window.__RN__ - document.documentElement.dataset.buildType = isRN ? "rn" : isElectron ? "electron" : "web" + document.documentElement.dataset.buildType = isElectron ? "electron" : "web"