Skip to content

Commit

Permalink
feat: silence action (#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban authored Oct 9, 2024
1 parent 1292fd4 commit dd0364d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/renderer/src/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export type ActionsInput = {
translation?: string
summary?: boolean
readability?: boolean
silence?: boolean
rewriteRules?: {
from: string
to: string
Expand Down
14 changes: 14 additions & 0 deletions apps/renderer/src/modules/settings/action-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,20 @@ export function ActionCard({
</div>
<Divider />

<div className="flex w-full items-center justify-between">
<span className="w-0 shrink grow truncate">
{t("actions.action_card.silence")}
</span>
<Switch
checked={data.result.silence}
onCheckedChange={(checked) => {
data.result.silence = checked
onChange(data)
}}
/>
</div>
<Divider />

<SettingCollapsible
title={t("actions.action_card.rewrite_rules")}
open={!!data.result.rewriteRules}
Expand Down
1 change: 1 addition & 0 deletions locales/settings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"actions.action_card.operation_options.matches_regex": "matches regex",
"actions.action_card.operator": "Operator",
"actions.action_card.rewrite_rules": "Rewrite Rules",
"actions.action_card.silence": "Silence",
"actions.action_card.then_do": "Then do…",
"actions.action_card.to": "To",
"actions.action_card.translate_into": "Translate into",
Expand Down
17 changes: 17 additions & 0 deletions packages/shared/src/hono.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ declare const actions: drizzle_orm_pg_core.PgTableWithColumns<{
translation?: z.infer<typeof languageSchema>;
summary?: boolean;
readability?: boolean;
silence?: boolean;
rewriteRules?: {
from: string;
to: string;
Expand Down Expand Up @@ -259,6 +260,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{
translation: z.ZodOptional<z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]>>;
summary: z.ZodOptional<z.ZodBoolean>;
readability: z.ZodOptional<z.ZodBoolean>;
silence: z.ZodOptional<z.ZodBoolean>;
rewriteRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
from: z.ZodString;
to: z.ZodString;
Expand Down Expand Up @@ -287,6 +289,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -301,6 +304,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -318,6 +322,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -340,6 +345,7 @@ declare const actionsItemOpenAPISchema: z.ZodObject<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand Down Expand Up @@ -384,6 +390,7 @@ declare const actionsOpenAPISchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
translation: z.ZodOptional<z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]>>;
summary: z.ZodOptional<z.ZodBoolean>;
readability: z.ZodOptional<z.ZodBoolean>;
silence: z.ZodOptional<z.ZodBoolean>;
rewriteRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
from: z.ZodString;
to: z.ZodString;
Expand Down Expand Up @@ -412,6 +419,7 @@ declare const actionsOpenAPISchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -426,6 +434,7 @@ declare const actionsOpenAPISchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -443,6 +452,7 @@ declare const actionsOpenAPISchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -465,6 +475,7 @@ declare const actionsOpenAPISchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -490,6 +501,7 @@ declare const actionsOpenAPISchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand All @@ -515,6 +527,7 @@ declare const actionsOpenAPISchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand Down Expand Up @@ -5440,6 +5453,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand Down Expand Up @@ -5672,6 +5686,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand Down Expand Up @@ -6165,6 +6180,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand Down Expand Up @@ -6196,6 +6212,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, {
summary?: boolean | undefined;
translation?: "en" | "ja" | "zh-CN" | "zh-TW" | undefined;
readability?: boolean | undefined;
silence?: boolean | undefined;
rewriteRules?: {
from: string;
to: string;
Expand Down

0 comments on commit dd0364d

Please sign in to comment.