fix: v0.5.1 - window/tray behavior, model table & capability UI polish
- Window: minimize keeps taskbar button (remove minimize-to-tray hook); close button hides to tray; tray left-click always shows + focuses window - Dashboard model table: model column auto-width (whitespace-nowrap, no truncation) - Capabilities editor: expose only thinking; image_in/video_in/tool_use still auto-derived from models.dev - Model mapping table: theme-aware row divider (fix harsh dark line in light mode)
This commit is contained in:
1 parent
6f2b927914
commit
3dd1fd93fe
7 files changed
+18
-31
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "kimiswitch",
|
"name": "kimiswitch",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.5.0",
|
"version": "0.5.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
Generated
+1
-1
@@ -1958,7 +1958,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kimiswitch"
|
name = "kimiswitch"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "kimiswitch"
|
name = "kimiswitch"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
description = "Kimi Switch - model config manager"
|
description = "Kimi Switch - model config manager"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@@ -65,28 +65,24 @@ pub fn run() {
|
|||||||
if button == MouseButton::Left && button_state == MouseButtonState::Up {
|
if button == MouseButton::Left && button_state == MouseButtonState::Up {
|
||||||
let app = tray.app_handle();
|
let app = tray.app_handle();
|
||||||
if let Some(window) = app.get_webview_window("main") {
|
if let Some(window) = app.get_webview_window("main") {
|
||||||
if window.is_visible().unwrap_or(true) {
|
|
||||||
let _ = window.hide();
|
|
||||||
} else {
|
|
||||||
let _ = window.show();
|
let _ = window.show();
|
||||||
let _ = window.unminimize();
|
let _ = window.unminimize();
|
||||||
let _ = window.set_focus();
|
let _ = window.set_focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.build(app)?;
|
.build(app)?;
|
||||||
|
|
||||||
// Minimize to tray: restore then hide so the taskbar button disappears
|
// Close button -> hide to tray instead of quitting. Minimize keeps
|
||||||
|
// the taskbar button (native behaviour); only an explicit close
|
||||||
|
// (window X) retreats to the tray.
|
||||||
let window_clone = window.clone();
|
let window_clone = window.clone();
|
||||||
window.on_window_event(move |event| match event {
|
window.on_window_event(move |event| match event {
|
||||||
tauri::WindowEvent::Resized(_) => {
|
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||||
if window_clone.is_minimized().unwrap_or(false) {
|
api.prevent_close();
|
||||||
let _ = window_clone.unminimize();
|
|
||||||
let _ = window_clone.hide();
|
let _ = window_clone.hide();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"productName": "Kimi Switch",
|
"productName": "Kimi Switch",
|
||||||
"version": "0.5.0",
|
"version": "0.5.1",
|
||||||
"identifier": "com.kimiswitch.app",
|
"identifier": "com.kimiswitch.app",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ function ModelMapping({
|
|||||||
<th className="text-center px-4 py-3 font-medium w-20">{t("operation")}</th>
|
<th className="text-center px-4 py-3 font-medium w-20">{t("operation")}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="divide-y divide-[#2a2a2e]">
|
<tbody className="divide-y divide-border">
|
||||||
{models.map((m) => (
|
{models.map((m) => (
|
||||||
<tr key={m.alias} className="hover:bg-hover">
|
<tr key={m.alias} className="hover:bg-hover">
|
||||||
<td className="px-4 py-2">
|
<td className="px-4 py-2">
|
||||||
@@ -776,8 +776,6 @@ function CapabilitiesCell({
|
|||||||
onChange: (next: string[]) => void;
|
onChange: (next: string[]) => void;
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const known = new Set<string>(KNOWN_CAPABILITIES);
|
|
||||||
const customs = capabilities.filter((c) => !known.has(c));
|
|
||||||
|
|
||||||
const toggle = (cap: string, on: boolean) => {
|
const toggle = (cap: string, on: boolean) => {
|
||||||
if (on) {
|
if (on) {
|
||||||
@@ -789,7 +787,13 @@ function CapabilitiesCell({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5">
|
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5">
|
||||||
{KNOWN_CAPABILITIES.map((cap) => (
|
{/* Only `thinking` is user-editable. The other capabilities
|
||||||
|
(always_thinking / image_in / video_in / tool_use) are still
|
||||||
|
auto-derived from models.dev via `capabilitiesFromRef` and saved
|
||||||
|
to config.toml — they just aren't exposed for manual editing.
|
||||||
|
To restore the full editor, drop the `.filter(...)` below and
|
||||||
|
re-add the custom-capabilities input (see git history). */}
|
||||||
|
{KNOWN_CAPABILITIES.filter((cap) => cap === "thinking").map((cap) => (
|
||||||
<label
|
<label
|
||||||
key={cap}
|
key={cap}
|
||||||
className="flex items-center gap-1 text-xs text-content-muted cursor-pointer"
|
className="flex items-center gap-1 text-xs text-content-muted cursor-pointer"
|
||||||
@@ -803,19 +807,6 @@ function CapabilitiesCell({
|
|||||||
{t(CAPABILITY_LABELS[cap])}
|
{t(CAPABILITY_LABELS[cap])}
|
||||||
</label>
|
</label>
|
||||||
))}
|
))}
|
||||||
<input
|
|
||||||
className="w-28 bg-transparent border border-border rounded px-1.5 py-1 text-xs focus:ring-2 focus:ring-blue-500 focus:outline-none"
|
|
||||||
value={customs.join(", ")}
|
|
||||||
placeholder={t("customCapabilities")}
|
|
||||||
onChange={(e) => {
|
|
||||||
const newCustoms = e.target.value
|
|
||||||
.split(",")
|
|
||||||
.map((s) => s.trim())
|
|
||||||
.filter(Boolean);
|
|
||||||
const kept = capabilities.filter((c) => known.has(c));
|
|
||||||
onChange([...kept, ...newCustoms]);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ export function DashboardPage() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<div className="text-content-primary truncate">{m.modelDisplay || m.model}</div>
|
<div className="text-content-primary whitespace-nowrap">{m.modelDisplay || m.model}</div>
|
||||||
{m.costEstimated && (
|
{m.costEstimated && (
|
||||||
<span className="text-[10px] text-yellow-600">估算</span>
|
<span className="text-[10px] text-yellow-600">估算</span>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in new issue
Block a user