diff --git a/CLAUDE.md b/CLAUDE.md index f805433..6abcfe7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -99,6 +99,13 @@ npm run build:mac # macOS universal build - `src/app/` - Core modules (window, tray, shortcuts) - `src/inject/` - Web page injection logic +## Documentation Guidelines + +- **Main README**: Only include common, frequently-used parameters to avoid clutter +- **CLI Documentation** (`bin/README.md`): Include ALL parameters with detailed usage examples +- **Rare/Advanced Parameters**: Should have full documentation in CLI docs but minimal/no mention in main README +- **Examples of rare parameters**: `--title`, `--incognito`, `--system-tray-icon`, etc. + ### Key Configuration Files - `pake.json` - App configuration diff --git a/bin/README.md b/bin/README.md index f4018ea..b98f569 100644 --- a/bin/README.md +++ b/bin/README.md @@ -224,6 +224,18 @@ Hide the window instead of exiting when clicking the close button. Default is `t --hide-on-close ``` +#### [title] + +Set the window title bar text. If not specified, the window title will be empty. + +```shell +--title + +# Examples: +--title "My Application" +--title "Google Translate" +``` + #### [incognito] Launch the application in incognito/private browsing mode. Default is `false`. When enabled, the webview will run in private mode, which means it won't store cookies, local storage, or browsing history. This is useful for privacy-sensitive applications. diff --git a/bin/README_CN.md b/bin/README_CN.md index 3d971d4..f7bf803 100644 --- a/bin/README_CN.md +++ b/bin/README_CN.md @@ -232,6 +232,18 @@ pake [url] [options] --incognito ``` +#### [title] + +设置窗口标题栏文本。如果未指定,窗口标题将为空。 + +```shell +--title + +# 示例: +--title "我的应用" +--title "音乐播放器" +``` + #### [installer-language] 设置 Windows 安装包语言。支持 `zh-CN`、`ja-JP`,更多在 [Tauri 文档](https://tauri.app/distribute/windows-installer/#internationalization)。默认为 `en-US`。 diff --git a/bin/cli.ts b/bin/cli.ts index 28ccb0b..7f316ed 100644 --- a/bin/cli.ts +++ b/bin/cli.ts @@ -128,6 +128,7 @@ program .default(DEFAULT.hideOnClose) .hideHelp(), ) + .addOption(new Option('--title ', 'Window title').hideHelp()) .addOption( new Option('--incognito', 'Launch app in incognito/private mode').default( DEFAULT.incognito, diff --git a/bin/helpers/merge.ts b/bin/helpers/merge.ts index 7736bac..fb288f5 100644 --- a/bin/helpers/merge.ts +++ b/bin/helpers/merge.ts @@ -34,6 +34,7 @@ export async function mergeConfig( installerLanguage, hideOnClose, incognito, + title, } = options; const { platform } = process; @@ -51,6 +52,7 @@ export async function mergeConfig( disabled_web_shortcuts: disabledWebShortcuts, hide_on_close: hideOnClose, incognito: incognito, + title: title || null, }; Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions }); diff --git a/bin/types.ts b/bin/types.ts index 7a9e022..0cc4e8b 100644 --- a/bin/types.ts +++ b/bin/types.ts @@ -6,6 +6,9 @@ export interface PakeCliOptions { // Application name name?: string; + // Window title (supports Chinese characters) + title?: string; + // Application icon icon: string; diff --git a/src-tauri/src/app/config.rs b/src-tauri/src/app/config.rs index 852ec02..51ef52f 100644 --- a/src-tauri/src/app/config.rs +++ b/src-tauri/src/app/config.rs @@ -15,6 +15,7 @@ pub struct WindowConfig { pub activation_shortcut: String, pub hide_on_close: bool, pub incognito: bool, + pub title: Option, } #[derive(Debug, Serialize, Deserialize)] diff --git a/src-tauri/src/app/window.rs b/src-tauri/src/app/window.rs index b5117ce..f8c94db 100644 --- a/src-tauri/src/app/window.rs +++ b/src-tauri/src/app/window.rs @@ -28,8 +28,14 @@ pub fn set_window(app: &mut App, config: &PakeConfig, tauri_config: &Config) -> serde_json::to_string(&window_config).unwrap() ); + let window_title = window_config + .title + .as_ref() + .map(|t| t.as_str()) + .unwrap_or(""); + let mut window_builder = WebviewWindowBuilder::new(app, "pake", url) - .title("") + .title(window_title) .visible(false) .user_agent(user_agent) .resizable(window_config.resizable)