From 1979401003d475ac678f524f98c9ad9f3f27e1d8 Mon Sep 17 00:00:00 2001 From: Mark Shaw Date: Mon, 9 Mar 2026 14:16:19 +0800 Subject: [PATCH 1/3] feat(tray): add Settings menu item and improve Open navigation Add a "Settings" entry to the system tray menu for quick access to the settings page. Also make "Open Timlyzer" navigate to the home page (/) instead of just showing the window, ensuring consistent behavior with other tray navigation items. Bump version to 0.2.0. Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/src/tray.rs | 13 +++++++++++++ src-tauri/tauri.conf.json | 2 +- src/i18n/locales/en-US/tray.json | 1 + src/i18n/locales/zh-CN/tray.json | 1 + 7 files changed, 19 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e1910bd..68721c6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "timlyzer", "private": true, - "version": "0.1.0", + "version": "0.2.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 123bb40..278e868 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4491,7 +4491,7 @@ dependencies = [ [[package]] name = "timlyzer" -version = "0.1.0" +version = "0.2.0" dependencies = [ "active-win-pos-rs", "chrono", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5c8d875..2dc40ed 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "timlyzer" -version = "0.1.0" +version = "0.2.0" description = "Automatic time tracking application" authors = ["Timlyzer"] edition = "2021" diff --git a/src-tauri/src/tray.rs b/src-tauri/src/tray.rs index 276dde6..2ae7e3c 100644 --- a/src-tauri/src/tray.rs +++ b/src-tauri/src/tray.rs @@ -14,6 +14,7 @@ pub struct TrayTranslations { pub tracking_enabled: String, pub open: String, pub summary: String, + pub settings: String, pub quit: String, } @@ -23,6 +24,7 @@ impl Default for TrayTranslations { tracking_enabled: "Tracking Enabled".to_string(), open: "Open Timlyzer".to_string(), summary: "Today's Summary".to_string(), + settings: "Settings".to_string(), quit: "Quit".to_string(), } } @@ -39,6 +41,8 @@ fn create_menu(app: &AppHandle, trans: &TrayTranslations) -> taur )?; let open_item = MenuItem::with_id(app, "open", &trans.open, true, None::<&str>)?; let summary_item = MenuItem::with_id(app, "summary", &trans.summary, true, None::<&str>)?; + let settings_item = + MenuItem::with_id(app, "settings", &trans.settings, true, None::<&str>)?; let separator = MenuItem::with_id(app, "sep1", "───────────", false, None::<&str>)?; let quit_item = MenuItem::with_id(app, "quit", &trans.quit, true, None::<&str>)?; @@ -49,6 +53,7 @@ fn create_menu(app: &AppHandle, trans: &TrayTranslations) -> taur &separator, &open_item, &summary_item, + &settings_item, &separator, &quit_item, ], @@ -77,6 +82,7 @@ pub fn setup_tray(app: &tauri::App) -> Result { if let Some(window) = app.get_webview_window("main") { let _ = window.show(); let _ = window.set_focus(); + let _ = window.eval("window.location.assign('/')"); } } "summary" => { @@ -87,6 +93,13 @@ pub fn setup_tray(app: &tauri::App) -> Result { let _ = window.eval("window.location.assign('/summary')"); } } + "settings" => { + if let Some(window) = app.get_webview_window("main") { + let _ = window.show(); + let _ = window.set_focus(); + let _ = window.eval("window.location.assign('/settings')"); + } + } "quit" => { app.exit(0); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 59a4092..7a30a2f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Timlyzer", - "version": "0.1.0", + "version": "0.2.0", "identifier": "com.timlyzer.app", "build": { "beforeDevCommand": "pnpm dev", diff --git a/src/i18n/locales/en-US/tray.json b/src/i18n/locales/en-US/tray.json index e65b31a..7b3b26e 100644 --- a/src/i18n/locales/en-US/tray.json +++ b/src/i18n/locales/en-US/tray.json @@ -2,5 +2,6 @@ "tracking_enabled": "Tracking Enabled", "open": "Open Timlyzer", "summary": "Today's Summary", + "settings": "Settings", "quit": "Quit" } diff --git a/src/i18n/locales/zh-CN/tray.json b/src/i18n/locales/zh-CN/tray.json index 1ec362d..06ef641 100644 --- a/src/i18n/locales/zh-CN/tray.json +++ b/src/i18n/locales/zh-CN/tray.json @@ -2,5 +2,6 @@ "tracking_enabled": "启用追踪", "open": "打开 Timlyzer", "summary": "今日概览", + "settings": "设置", "quit": "退出" } From b75ee5fbeb01a470830322ce736d3553c763fef3 Mon Sep 17 00:00:00 2001 From: Mark Shaw Date: Mon, 9 Mar 2026 14:20:55 +0800 Subject: [PATCH 2/3] revert: remove manual version bump from tray menu PR Version management should be handled by CI workflow, not manual edits. Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 68721c6..e1910bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "timlyzer", "private": true, - "version": "0.2.0", + "version": "0.1.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 278e868..123bb40 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4491,7 +4491,7 @@ dependencies = [ [[package]] name = "timlyzer" -version = "0.2.0" +version = "0.1.0" dependencies = [ "active-win-pos-rs", "chrono", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 2dc40ed..5c8d875 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "timlyzer" -version = "0.2.0" +version = "0.1.0" description = "Automatic time tracking application" authors = ["Timlyzer"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 7a30a2f..59a4092 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Timlyzer", - "version": "0.2.0", + "version": "0.1.0", "identifier": "com.timlyzer.app", "build": { "beforeDevCommand": "pnpm dev", From 9aeb3c42ac518c697a47918855ab2ed664778276 Mon Sep 17 00:00:00 2001 From: Mark Shaw Date: Mon, 9 Mar 2026 14:21:28 +0800 Subject: [PATCH 3/3] ci: add version bump workflow Automates version bumping across package.json, tauri.conf.json, and Cargo.toml via GitHub Actions workflow_dispatch. Supports patch/minor/major bump types and custom version input. Creates a git tag that triggers the existing release workflow. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/version-bump.yml | 87 ++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/version-bump.yml diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml new file mode 100644 index 0000000..45a846f --- /dev/null +++ b/.github/workflows/version-bump.yml @@ -0,0 +1,87 @@ +name: Version Bump + +on: + workflow_dispatch: + inputs: + bump: + description: "Version bump type" + required: true + type: choice + options: + - patch + - minor + - major + custom_version: + description: "Custom version (overrides bump type, e.g. 1.2.3)" + required: false + type: string + +jobs: + bump-version: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + + - name: Calculate new version + id: version + run: | + CURRENT=$(node -p "require('./package.json').version") + echo "current=$CURRENT" >> "$GITHUB_OUTPUT" + + if [ -n "${{ inputs.custom_version }}" ]; then + NEW="${{ inputs.custom_version }}" + else + IFS='.' read -r major minor patch <<< "$CURRENT" + case "${{ inputs.bump }}" in + major) NEW="$((major + 1)).0.0" ;; + minor) NEW="$major.$((minor + 1)).0" ;; + patch) NEW="$major.$minor.$((patch + 1))" ;; + esac + fi + + echo "new=$NEW" >> "$GITHUB_OUTPUT" + echo "Bumping version: $CURRENT -> $NEW" + + - name: Update package.json + run: | + node -e " + const fs = require('fs'); + const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); + pkg.version = '${{ steps.version.outputs.new }}'; + fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n'); + " + + - name: Update tauri.conf.json + run: | + node -e " + const fs = require('fs'); + const conf = JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json', 'utf8')); + conf.version = '${{ steps.version.outputs.new }}'; + fs.writeFileSync('src-tauri/tauri.conf.json', JSON.stringify(conf, null, 2) + '\n'); + " + + - name: Update Cargo.toml + run: | + sed -i 's/^version = "${{ steps.version.outputs.current }}"/version = "${{ steps.version.outputs.new }}"/' src-tauri/Cargo.toml + + - name: Update Cargo.lock + run: | + sed -i '/^name = "timlyzer"/{n;s/^version = "${{ steps.version.outputs.current }}"/version = "${{ steps.version.outputs.new }}"/}' src-tauri/Cargo.lock + + - name: Commit and tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml src-tauri/Cargo.lock + git commit -m "chore: bump version to v${{ steps.version.outputs.new }}" + git tag "v${{ steps.version.outputs.new }}" + git push origin main --tags