Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add setting to hide built-in masks #2256

Merged
merged 2 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions app/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,12 @@ export function Settings() {
}
></input>
</ListItem>
</List>

<List>
<ListItem
title={Locale.Settings.Mask.Title}
subTitle={Locale.Settings.Mask.SubTitle}
title={Locale.Settings.Mask.Splash.Title}
subTitle={Locale.Settings.Mask.Splash.SubTitle}
>
<input
type="checkbox"
Expand All @@ -559,6 +561,22 @@ export function Settings() {
}
></input>
</ListItem>

<ListItem
title={Locale.Settings.Mask.Builtin.Title}
subTitle={Locale.Settings.Mask.Builtin.SubTitle}
>
<input
type="checkbox"
checked={!config.dontAddBuiltinMasks}
onChange={(e) =>
updateConfig(
(config) =>
(config.dontAddBuiltinMasks = !e.currentTarget.checked),
)
}
></input>
</ListItem>
</List>

<List>
Expand Down
10 changes: 8 additions & 2 deletions app/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,14 @@ const ar: PartialLocaleType = {
SubTitle: "معاينة Markdown في فقاعة",
},
Mask: {
Title: "شاشة تظهر الأقنعة",
SubTitle: "عرض شاشة تظهر الأقنعة قبل بدء الدردشة الجديدة",
Splash: {
Title: "شاشة تظهر الأقنعة",
SubTitle: "عرض شاشة تظهر الأقنعة قبل بدء الدردشة الجديدة",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,14 @@ const cn = {
SubTitle: "在预览气泡中预览 Markdown 内容",
},
Mask: {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
Splash: {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const cs: PartialLocaleType = {
SubTitle: "Zobrazit v náhledu bubliny",
},
Mask: {
Title: "Úvodní obrazovka Masek",
SubTitle: "Před zahájením nového chatu zobrazte úvodní obrazovku Masek",
Splash: {
Title: "Úvodní obrazovka Masek",
SubTitle: "Před zahájením nového chatu zobrazte úvodní obrazovku Masek",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const de: PartialLocaleType = {
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
Splash: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,14 @@ const en: LocaleType = {
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
Splash: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const es: PartialLocaleType = {
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
Splash: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
12 changes: 9 additions & 3 deletions app/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ const fr: PartialLocaleType = {
SubTitle: "Aperçu du Markdown dans une bulle",
},
Mask: {
Title: "Écran de masque",
SubTitle:
"Afficher un écran de masque avant de démarrer une nouvelle discussion",
Splash: {
Title: "Écran de masque",
SubTitle:
"Afficher un écran de masque avant de démarrer une nouvelle discussion",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const it: PartialLocaleType = {
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
Splash: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/jp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,14 @@ const jp: PartialLocaleType = {
SubTitle: "プレビューバブルでマークダウンコンテンツをプレビュー",
},
Mask: {
Title: "キャラクターページ",
SubTitle: "新規チャット作成時にキャラクターページを表示する",
Splash: {
Title: "キャラクターページ",
SubTitle: "新規チャット作成時にキャラクターページを表示する",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const ko: PartialLocaleType = {
SubTitle: "버블에서 마크다운 미리 보기",
},
Mask: {
Title: "마스크 시작 화면",
SubTitle: "새로운 채팅 시작 전에 마스크 시작 화면 표시",
Splash: {
Title: "마스크 시작 화면",
SubTitle: "새로운 채팅 시작 전에 마스크 시작 화면 표시",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const ru: PartialLocaleType = {
SubTitle: "Предварительный просмотр markdown в пузыре",
},
Mask: {
Title: "Экран заставки маски",
SubTitle: "Показывать экран заставки маски перед началом нового чата",
Splash: {
Title: "Экран заставки маски",
SubTitle: "Показывать экран заставки маски перед началом нового чата",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const tr: PartialLocaleType = {
SubTitle: "Preview markdown in bubble",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
Splash: {
Title: "Mask Splash Screen",
SubTitle: "Show a mask splash screen before starting new chat",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ const tw: PartialLocaleType = {
SubTitle: "在预览气泡中预览 Markdown 内容",
},
Mask: {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
Splash: {
Title: "面具启动页",
SubTitle: "新建聊天时,展示面具启动页",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
10 changes: 8 additions & 2 deletions app/locales/vi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ const vi: PartialLocaleType = {
SubTitle: "Xem trước nội dung markdown bằng bong bóng",
},
Mask: {
Title: "Mask Splash Screen",
SubTitle: "Chớp màn hình khi bắt đầu cuộc trò chuyện mới",
Splash: {
Title: "Mask Splash Screen",
SubTitle: "Chớp màn hình khi bắt đầu cuộc trò chuyện mới",
},
Builtin: {
Title: "Show Builtin Masks",
SubTitle: "Show builtin masks in mask list",
},
},
Prompt: {
Disable: {
Expand Down
1 change: 1 addition & 0 deletions app/store/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const DEFAULT_CONFIG = {
disablePromptHint: false,

dontShowMaskSplashScreen: false, // dont show splash screen when create chat
dontAddBuiltinMasks: false, // dont add builtin masks

models: DEFAULT_MODELS as any as LLMModel[],

Expand Down
1 change: 1 addition & 0 deletions app/store/mask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const useMaskStore = create<MaskStore>()(
(a, b) => b.id - a.id,
);
const config = useAppConfig.getState();
if (config.dontAddBuiltinMasks) return userMasks;
const buildinMasks = BUILTIN_MASKS.map(
(m) =>
({
Expand Down