[PR #15] [MERGED] feat: improve service repair flow and macOS tray/dock UXCodex/service repair auto fix #16

Closed
opened 2026-03-16 12:14:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hnewcity/KiroaaS/pull/15
Author: @RegenLau
Created: 3/13/2026
Status: Merged
Merged: 3/13/2026
Merged by: @hnewcity

Base: mainHead: codex/service-repair-auto-fix


📝 Commits (2)

  • d4e13c0 feat(settings): add service repair flow with explicit port conflict confirmation
  • 9826403 feat(macos): hide dock icon when minimizing to tray

📊 Changes

11 files changed (+659 additions, -4 deletions)

View changed files

📝 public/icon.png (+0 -0)
📝 src-tauri/icons/128x128.png (+0 -0)
📝 src-tauri/icons/128x128@2x.png (+0 -0)
📝 src-tauri/icons/32x32.png (+0 -0)
📝 src-tauri/icons/icon.icns (+0 -0)
📝 src-tauri/icons/icon.ico (+0 -0)
📝 src-tauri/icons/icon.png (+0 -0)
📝 src-tauri/src/main.rs (+228 -0)
📝 src/components/SettingsForm.tsx (+273 -4)
📝 src/lib/i18n.ts (+144 -0)
📝 src/lib/tauri.ts (+14 -0)

📄 Description

Background

This PR addresses two issues:

  1. There was no reliable, guided recovery path for service failures (especially 401 and port conflicts).
  2. macOS desktop behavior and visual consistency needed improvement (Dock icon remained visible when minimized, and app icon looked visually out of place).

Changes

1. Guided service repair flow (Settings)

  • Added a full “Repair Service” workflow:
    • restart gateway
    • health check (/health)
    • API self-check (/v1/models)
  • When 401 is detected, the app now auto-rotates proxy_api_key, saves config, restarts, and retries.

2. Port conflict handling now requires explicit user confirmation

  • Added process detection for occupied ports (PID / process name / command).
  • If a conflict is detected, the UI now prompts the user and waits.
  • The app only terminates the occupying process after explicit user confirmation (“Close occupier and continue”).
  • No more silent/automatic process termination.

3. macOS minimize behavior improved (tray-first)

  • On minimize/hide/close, app switches to Accessory activation policy so Dock icon is hidden and app stays in tray.
  • On tray restore/show, app switches back to Regular so Dock behavior is restored.
  • Result: minimize now behaves as “hide to tray” instead of persistent Dock presence.

4. App icon visual normalization

  • Kept the existing icon style, but normalized corner radius and safe margins.
  • Regenerated and updated multi-platform icon assets (icns / ico / png sizes).
  • Synced public/icon.png for in-app visual consistency.

Validation

  • npm run build
  • cargo check
  • Manual validation
    • Port conflict now prompts before process termination.
    • 401 repair path works.
    • On macOS, minimized app no longer stays in Dock and can be restored from tray.
    • Icon scale/corner appearance is visually improved.

Scope

  • Frontend: settings repair flow and related UX text
  • Tauri/Rust: port occupier detection + termination commands, macOS Dock/tray visibility behavior
  • Assets: app icon resources (icon.icns, icon.ico, png variants, public/icon.png)

Review Recommendation

From a user-impact vs. risk perspective, we strongly recommend adopting item #3 and item #4 first: both are low-intrusion, independently verifiable, and provide immediate visible UX improvements.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hnewcity/KiroaaS/pull/15 **Author:** [@RegenLau](https://github.com/RegenLau) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@hnewcity](https://github.com/hnewcity) **Base:** `main` ← **Head:** `codex/service-repair-auto-fix` --- ### 📝 Commits (2) - [`d4e13c0`](https://github.com/hnewcity/KiroaaS/commit/d4e13c08da17d12b055562f3956d3c51f76fab58) feat(settings): add service repair flow with explicit port conflict confirmation - [`9826403`](https://github.com/hnewcity/KiroaaS/commit/982640324ed17bf4359ac6d7a2ac8da6946377d7) feat(macos): hide dock icon when minimizing to tray ### 📊 Changes **11 files changed** (+659 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `public/icon.png` (+0 -0) 📝 `src-tauri/icons/128x128.png` (+0 -0) 📝 `src-tauri/icons/128x128@2x.png` (+0 -0) 📝 `src-tauri/icons/32x32.png` (+0 -0) 📝 `src-tauri/icons/icon.icns` (+0 -0) 📝 `src-tauri/icons/icon.ico` (+0 -0) 📝 `src-tauri/icons/icon.png` (+0 -0) 📝 `src-tauri/src/main.rs` (+228 -0) 📝 `src/components/SettingsForm.tsx` (+273 -4) 📝 `src/lib/i18n.ts` (+144 -0) 📝 `src/lib/tauri.ts` (+14 -0) </details> ### 📄 Description ## Background This PR addresses two issues: 1. There was no reliable, guided recovery path for service failures (especially `401` and port conflicts). 2. macOS desktop behavior and visual consistency needed improvement (Dock icon remained visible when minimized, and app icon looked visually out of place). ## Changes ### 1. Guided service repair flow (Settings) - Added a full “Repair Service” workflow: - restart gateway - health check (`/health`) - API self-check (`/v1/models`) - When `401` is detected, the app now auto-rotates `proxy_api_key`, saves config, restarts, and retries. ### 2. Port conflict handling now requires explicit user confirmation - Added process detection for occupied ports (PID / process name / command). - If a conflict is detected, the UI now prompts the user and waits. - The app only terminates the occupying process after explicit user confirmation (“Close occupier and continue”). - No more silent/automatic process termination. ### 3. macOS minimize behavior improved (tray-first) - On minimize/hide/close, app switches to `Accessory` activation policy so Dock icon is hidden and app stays in tray. - On tray restore/show, app switches back to `Regular` so Dock behavior is restored. - Result: minimize now behaves as “hide to tray” instead of persistent Dock presence. ### 4. App icon visual normalization - Kept the existing icon style, but normalized corner radius and safe margins. - Regenerated and updated multi-platform icon assets (`icns` / `ico` / png sizes). - Synced `public/icon.png` for in-app visual consistency. ## Validation - `npm run build` ✅ - `cargo check` ✅ - Manual validation ✅ - Port conflict now prompts before process termination. - `401` repair path works. - On macOS, minimized app no longer stays in Dock and can be restored from tray. - Icon scale/corner appearance is visually improved. ## Scope - Frontend: settings repair flow and related UX text - Tauri/Rust: port occupier detection + termination commands, macOS Dock/tray visibility behavior - Assets: app icon resources (`icon.icns`, `icon.ico`, png variants, `public/icon.png`) ## Review Recommendation From a user-impact vs. risk perspective, we **strongly recommend adopting item #3 and item #4** first: both are low-intrusion, independently verifiable, and provide immediate visible UX improvements. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 12:14:48 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/KiroaaS#16
No description provided.