Skip to content

Commit 344a017

Browse files
committed
feat(article): add ArticleRenderWidget for HTML and markdown content rendering
refactor: move effect cleanup in EmbedWebView for better readability style: normalize indentation in hooks and config files fix: update daemon feed update to pass app handle chore: update dependencies and add new build target docs: update README sponsor links perf: optimize Markdown component styling and typography
1 parent 265e206 commit 344a017

File tree

20 files changed

+400
-198
lines changed

20 files changed

+400
-198
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ debug = true
4747
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
4848

4949
[patch.crates-io]
50-
# tauri = { git = "https://github.com/Legend-Master/tauri.git", branch = "run-set-theme-on-main-thread" }
50+
# tauri = { git = "https://github.com/Legend-Master/tauri.git", branch = "dev" }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
**Saga Reader** is completely free and open-source, meaning all data is securely stored on your own computer and is not controlled by third-party service providers. Additionally, you can manage your subscription keywords based on your interests and preferences without being disturbed by advertisements and commercialized content.
3232

33-
❤️ Like **Saga Reader**? Star it 🌟 or [Sponsor the Developer](https://github.com/sponsors/sopaco)! ❤️
33+
❤️ Like **Saga Reader**? Star it 🌟 or [Sponsor Me](https://github.com/sponsors/sopaco)! ❤️
3434

3535
⏬ Download it now from the [official website](https://aiqino.netlify.app?s=github_download)! Compatible with Windows, Mac, and Linux systems, it runs very smoothly on old computers.
3636

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
🆓 **麒睿智库** 完全免费和开源,这意味着所有数据都安全地存储在您自己的计算机上,不受第三方服务提供商的控制。此外,您可以根据自己的兴趣和偏好管理订阅关键词,而不会受到广告和商业化内容的打扰。
3030

31-
❤️ 喜欢 **麒睿智库**? 点亮小星星 🌟 或 [赞助开发者](https://github.com/sponsors/sopaco)! ❤️
31+
❤️ 喜欢 **麒睿智库**? 点亮小星星 🌟 或 [赞助](https://github.com/sponsors/sopaco)! ❤️
3232

3333
⏬ 现在就从[官方网站](https://aiqino.netlify.app?s=github_download)下载!兼容 Windows、Mac 和 Linux 系统,在老电脑上也非常流畅。
3434

app/package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"build": "bunx --bun vite build",
1010
"build:desktop": "tauri build",
1111
"build:desktop-macos-universal": "tauri build --target universal-apple-darwin",
12+
"build:desktop-macos-aarch64": "tauri build --target aarch64-apple-darwin",
1213
"build:desktop-win64": "tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc",
1314
"build:desktop-winaarch64": "tauri build --target universal-apple-darwin",
1415
"build:desktop-linux": "tauri build --target x86_64-unknown-linux-gnu",
@@ -19,43 +20,43 @@
1920
},
2021
"license": "MIT",
2122
"dependencies": {
22-
"@humanspeak/svelte-markdown": "^0.8.7",
23-
"@sentry/sveltekit": "^9.24.0",
23+
"@sentry/sveltekit": "^9.28.1",
2424
"@tauri-apps/api": "^2.5.0",
2525
"@tauri-apps/plugin-autostart": "^2.3.0",
2626
"@tauri-apps/plugin-clipboard-manager": "^2.2.2",
2727
"@tauri-apps/plugin-dialog": "^2.2.1",
2828
"@tauri-apps/plugin-os": "^2.2.1",
2929
"@tauri-apps/plugin-shell": "^2.2.1",
30+
"@humanspeak/svelte-markdown": "^0.8.7",
3031
"lucide-svelte": "^0.511.0",
3132
"svelte-i18n": "^4.0.1"
3233
},
3334
"devDependencies": {
3435
"@skeletonlabs/skeleton": "^3.1.3",
35-
"@skeletonlabs/skeleton-svelte": "^1.2.3",
36+
"@skeletonlabs/skeleton-svelte": "1.2.3",
3637
"@sveltejs/adapter-static": "^3.0.8",
37-
"@sveltejs/kit": "^2.21.2",
38+
"@sveltejs/kit": "^2.21.4",
3839
"@sveltejs/vite-plugin-svelte": "^5.1.0",
3940
"@tailwindcss/forms": "^0.5.10",
40-
"@tailwindcss/vite": "^4.0.0",
41+
"@tailwindcss/vite": "^4.1.8",
4142
"@tauri-apps/cli": "^2.5.0",
4243
"@types/eslint": "^9.6.1",
4344
"@types/node": "^22.10.3",
4445
"autoprefixer": "^10.4.21",
45-
"eslint": "^9.23.0",
46-
"eslint-config-prettier": "^10.1.1",
47-
"eslint-plugin-svelte": "^3.3.3",
48-
"globals": "^16.0.0",
46+
"caniuse-lite": "^1.0.30001721",
47+
"eslint": "^9.28.0",
48+
"eslint-config-prettier": "^10.1.5",
49+
"eslint-plugin-svelte": "^3.9.1",
50+
"globals": "^16.2.0",
4951
"prettier": "^3.5.3",
50-
"prettier-plugin-svelte": "^3.3.3",
51-
"prettier-plugin-tailwindcss": "^0.6.11",
52-
"svelte": "^5.33.14",
52+
"prettier-plugin-svelte": "^3.4.0",
53+
"prettier-plugin-tailwindcss": "^0.6.12",
54+
"svelte": "^5.33.19",
5355
"svelte-check": "^4.2.1",
5456
"tailwindcss": "^4.1.8",
5557
"typescript": "^5.8.3",
5658
"typescript-eslint": "^8.33.1",
57-
"vite": "^6.2.5",
58-
"caniuse-lite": "^1.0.30001721"
59+
"vite": "^6.3.5"
5960
},
6061
"trustedDependencies": [
6162
"@parcel/watcher",

app/src-tauri/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ tauri-plugin-shell = "2.2.1"
2222
tauri-plugin-clipboard-manager = "2.2.2"
2323
tauri-plugin-os = "2.2.1"
2424
tauri-plugin-dialog = "2.2.1"
25-
tauri-runtime-wry = "2.6.0"
2625

2726
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
2827
tauri-plugin-autostart = "2.3.0"
@@ -52,4 +51,3 @@ lto = 'thin'
5251
opt-level = 3
5352
panic = "abort"
5453
strip = "none"
55-

app/src-tauri/src/daemon/feeds_update.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ use std::{sync::Arc, time::Duration};
33
use feed_api_rs::features::api::FeaturesAPI;
44
use fslock::LockFile;
55
use spdlog::{error, info, warn};
6-
use tauri::{async_runtime, EventLoopMessage};
6+
use tauri::{async_runtime, AppHandle, EventLoopMessage, Runtime};
77
use tauri_plugin_feed_api::state::HybridRuntimeState;
88
use tokio::time;
99

1010
use crate::daemon::locks::{get_lock_path, LOCK_FEEDS_SCHEDULE_UPDATE};
1111

12-
pub(crate) fn launch_feeds_schedule_update(state: Arc<HybridRuntimeState>) -> anyhow::Result<()> {
12+
pub(crate) fn launch_feeds_schedule_update<R: Runtime>(
13+
app_handle: &AppHandle<R>,
14+
state: Arc<HybridRuntimeState>,
15+
) -> anyhow::Result<()> {
1316
// 防止重复运行更新实例
1417
let lock_path = get_lock_path(LOCK_FEEDS_SCHEDULE_UPDATE);
1518
let mut updater_lock = LockFile::open(&lock_path)?;
@@ -19,16 +22,19 @@ pub(crate) fn launch_feeds_schedule_update(state: Arc<HybridRuntimeState>) -> an
1922
);
2023
return Ok(());
2124
}
22-
25+
let ah = app_handle.clone();
2326
async_runtime::spawn(async move {
24-
schedule_loop(state)
27+
schedule_loop(ah, state)
2528
.await
2629
.expect("schedule_loop occurs error");
2730
});
2831
Ok(())
2932
}
3033

31-
async fn schedule_loop(state: Arc<HybridRuntimeState>) -> anyhow::Result<()> {
34+
async fn schedule_loop<R: Runtime>(
35+
app_handle: AppHandle<R>,
36+
state: Arc<HybridRuntimeState>,
37+
) -> anyhow::Result<()> {
3238
let features = &state.features_api;
3339
let app_config = &features.context.read().await.app_config;
3440
// 在所有权转移前读取需要的配置
@@ -37,19 +43,17 @@ async fn schedule_loop(state: Arc<HybridRuntimeState>) -> anyhow::Result<()> {
3743
false => 60 * 60 * 3,
3844
};
3945
let mut interval = time::interval(Duration::from_secs(update_interval));
46+
let mut cold_start_delay = time::interval(Duration::from_secs(120));
4047

4148
// 定时任务
4249
loop {
50+
cold_start_delay.tick().await;
4351
info!("scheduled feeds update begin");
4452
let feeds_packages = features.get_feeds_packages().await;
4553
for feed_package in feeds_packages {
4654
for feed in feed_package.feeds {
4755
match features
48-
.update_feed_contents::<tauri_runtime_wry::Wry<EventLoopMessage>>(
49-
&feed_package.id,
50-
&feed.id,
51-
None,
52-
)
56+
.update_feed_contents(&feed_package.id, &feed.id, Some(app_handle.clone()))
5357
.await
5458
{
5559
Ok(_) => (),

app/src-tauri/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::sync::Arc;
99

1010
use constrant::WINDOW_MAIN_LABEL;
1111
use daemon::{args::DAEMON_FEEDS_SCHEDULE_UPDATE, feeds_update::launch_feeds_schedule_update};
12-
use tauri::{Manager, RunEvent, State};
12+
use tauri::{Manager, State};
1313
use tauri_plugin_autostart::MacosLauncher;
1414
use tauri_plugin_feed_api::state::HybridRuntimeState;
1515
use tray::open_main_window;
@@ -46,17 +46,17 @@ pub fn run() {
4646
_ => {}
4747
})
4848
.setup(|app| {
49+
let handle = app.handle();
4950
#[cfg(all(desktop))]
5051
{
51-
let handle = app.handle();
5252
tray::create_tray(handle)?;
5353
}
5454

5555
let is_daemon = env::is_daemon();
5656
if is_daemon {
5757
let state: State<'_, Arc<HybridRuntimeState>> = app.state();
5858
let state_clone = Arc::clone(&state);
59-
launch_feeds_schedule_update(state_clone).unwrap();
59+
launch_feeds_schedule_update(handle, state_clone).unwrap();
6060
} else {
6161
if let Some(window) = app.get_window(WINDOW_MAIN_LABEL) {
6262
window.show().unwrap();

app/src/hooks.client.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
1+
import { handleErrorWithSentry, replayIntegration } from '@sentry/sveltekit';
22
import * as Sentry from '@sentry/sveltekit';
33

44
Sentry.init({
5-
dsn: 'https://[email protected]/4507827211862016',
6-
tracesSampleRate: 1.0,
5+
dsn: 'https://[email protected]/4507827211862016',
6+
tracesSampleRate: 1.0,
77

8-
// This sets the sample rate to be 10%. You may want this to be 100% while
9-
// in development and sample at a lower rate in production
10-
replaysSessionSampleRate: 0.1,
8+
// This sets the sample rate to be 10%. You may want this to be 100% while
9+
// in development and sample at a lower rate in production
10+
replaysSessionSampleRate: 0.1,
1111

12-
// If the entire session is not sampled, use the below sample rate to sample
13-
// sessions when an error occurs.
14-
replaysOnErrorSampleRate: 1.0,
15-
16-
// If you don't want to use Session Replay, just remove the line below:
17-
integrations: [replayIntegration()],
12+
// If the entire session is not sampled, use the below sample rate to sample
13+
// sessions when an error occurs.
14+
replaysOnErrorSampleRate: 1.0,
15+
16+
// If you don't want to use Session Replay, just remove the line below:
17+
integrations: [replayIntegration()]
1818
});
1919

2020
// If you have a custom error handler, pass it to `handleErrorWithSentry`

app/src/hooks.server.ts

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
import type { Handle } from "@sveltejs/kit";
2-
import { sequence } from "@sveltejs/kit/hooks";
3-
import { handleErrorWithSentry, sentryHandle } from "@sentry/sveltekit";
4-
import * as Sentry from "@sentry/sveltekit";
5-
import { locale } from "svelte-i18n";
1+
import type { Handle } from '@sveltejs/kit';
2+
import { sequence } from '@sveltejs/kit/hooks';
3+
import { handleErrorWithSentry, sentryHandle } from '@sentry/sveltekit';
4+
import * as Sentry from '@sentry/sveltekit';
5+
import { locale } from 'svelte-i18n';
66

77
Sentry.init({
8-
dsn: "https://[email protected]/4507827211862016",
9-
tracesSampleRate: 1.0,
8+
dsn: 'https://[email protected]/4507827211862016',
9+
tracesSampleRate: 1.0
1010

11-
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
12-
// spotlight: import.meta.env.DEV,
11+
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
12+
// spotlight: import.meta.env.DEV,
1313
});
1414

1515
// If you have custom handlers, make sure to place them after `sentryHandle()` in the `sequence` function.
16-
export const handle: Handle = sequence(
17-
sentryHandle(),
18-
async ({ event, resolve }) => {
19-
const lang = event.request.headers.get("accept-language")?.split(",")[0];
20-
if (lang) {
21-
locale.set(lang);
22-
}
23-
return resolve(event);
24-
},
25-
);
16+
export const handle: Handle = sequence(sentryHandle(), async ({ event, resolve }) => {
17+
const lang = event.request.headers.get('accept-language')?.split(',')[0];
18+
if (lang) {
19+
locale.set(lang);
20+
}
21+
return resolve(event);
22+
});
2623

2724
// If you have a custom error handler, pass it to `handleErrorWithSentry`
2825
export const handleError = handleErrorWithSentry();

app/src/lib/themes/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { setTheme as setAppTheme } from '@tauri-apps/api/app';
2+
// function setAppTheme() {}
23

34
type ThemePresets = 'light' | 'dark';
45
const LITE_STORAGE_KEY_THEME = 'ls_user_theme';

0 commit comments

Comments
 (0)