diff --git a/locales/settings/en.json b/locales/settings/en.json index 04f69a274..afb4d62eb 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -10,6 +10,7 @@ "actions.action_card.all": "All", "actions.action_card.block_rules": "Block Rules", "actions.action_card.custom_filters": "Custom filters", + "actions.action_card.enable_readability": "Enable readability", "actions.action_card.entry_options.all": "All", "actions.action_card.entry_options.author": "Author", "actions.action_card.entry_options.content": "Content", diff --git a/src/hono.ts b/src/hono.ts index aeb295f7a..bb2b2db91 100644 --- a/src/hono.ts +++ b/src/hono.ts @@ -59,6 +59,7 @@ declare const actions: drizzle_orm_pg_core.PgTableWithColumns<{ result: { translation?: z.infer summary?: boolean + readability?: boolean rewriteRules?: { from: string to: string @@ -115,6 +116,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< { translation: z.ZodOptional> summary: z.ZodOptional + readability: z.ZodOptional rewriteRules: z.ZodOptional< z.ZodArray< z.ZodObject< @@ -168,6 +170,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -185,6 +188,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -213,6 +217,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -238,6 +243,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -652,6 +658,7 @@ declare const actionsOpenAPISchema: z.ZodObject< { translation: z.ZodOptional> summary: z.ZodOptional + readability: z.ZodOptional rewriteRules: z.ZodOptional< z.ZodArray< z.ZodObject< @@ -719,6 +726,7 @@ declare const actionsOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -743,6 +751,7 @@ declare const actionsOpenAPISchema: z.ZodObject< { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -778,6 +787,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -810,6 +820,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -854,6 +865,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -885,6 +897,7 @@ declare const actionsOpenAPISchema: z.ZodObject< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -5117,6 +5130,7 @@ declare const _routes: hono_hono_base.HonoBase< | { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -5571,6 +5585,7 @@ declare const _routes: hono_hono_base.HonoBase< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string @@ -5615,6 +5630,7 @@ declare const _routes: hono_hono_base.HonoBase< result: { summary?: boolean | undefined translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined + readability?: boolean | undefined rewriteRules?: | { from: string diff --git a/src/renderer/src/modules/entry-content/index.tsx b/src/renderer/src/modules/entry-content/index.tsx index f79c45be9..2a99b2e1b 100644 --- a/src/renderer/src/modules/entry-content/index.tsx +++ b/src/renderer/src/modules/entry-content/index.tsx @@ -1,6 +1,7 @@ import { repository } from "@pkg" import { ReadabilityStatus, + setReadabilityStatus, useEntryInReadabilityStatus, useEntryIsInReadability, useEntryReadabilityContent, @@ -266,6 +267,10 @@ export const EntryContentRender: Component<{ entryId: string }> = ({ entryId, cl + {entry.settings?.readability && ( + + )} + {!content && (
{isPending ? ( @@ -398,6 +403,9 @@ const ReadabilityAutoToggle = ({ url, id }: { url: string; id: string }) => { useEffect(() => { if (!onceRef.current) { onceRef.current = true + setReadabilityStatus({ + [id]: ReadabilityStatus.INITIAL, + }) toggle() } }, [toggle]) diff --git a/src/renderer/src/modules/settings/action-card.tsx b/src/renderer/src/modules/settings/action-card.tsx index 684691329..857ef6a65 100644 --- a/src/renderer/src/modules/settings/action-card.tsx +++ b/src/renderer/src/modules/settings/action-card.tsx @@ -43,6 +43,7 @@ type ActionsInput = { result: { translation?: string summary?: boolean + readability?: boolean rewriteRules?: { from: string to: string @@ -446,7 +447,20 @@ export function ActionCard({
+ +
+ + {t("actions.action_card.enable_readability")} + + { + data.result.readability = checked + onChange(data) + }} + /> +