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
+22
-35
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "kimiswitch",
|
||||
"private": true,
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
Generated
+1
-1
@@ -1958,7 +1958,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "kimiswitch"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "kimiswitch"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
description = "Kimi Switch - model config manager"
|
||||
authors = ["you"]
|
||||
edition = "2021"
|
||||
|
||||
+9
-13
@@ -65,27 +65,23 @@ pub fn run() {
|
||||
if button == MouseButton::Left && button_state == MouseButtonState::Up {
|
||||
let app = tray.app_handle();
|
||||
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.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.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();
|
||||
window.on_window_event(move |event| match event {
|
||||
tauri::WindowEvent::Resized(_) => {
|
||||
if window_clone.is_minimized().unwrap_or(false) {
|
||||
let _ = window_clone.unminimize();
|
||||
let _ = window_clone.hide();
|
||||
}
|
||||
tauri::WindowEvent::CloseRequested { api, .. } => {
|
||||
api.prevent_close();
|
||||
let _ = window_clone.hide();
|
||||
}
|
||||
_ => {}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"productName": "Kimi Switch",
|
||||
"version": "0.5.0",
|
||||
"version": "0.5.1",
|
||||
"identifier": "com.kimiswitch.app",
|
||||
"build": {
|
||||
"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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-[#2a2a2e]">
|
||||
<tbody className="divide-y divide-border">
|
||||
{models.map((m) => (
|
||||
<tr key={m.alias} className="hover:bg-hover">
|
||||
<td className="px-4 py-2">
|
||||
@@ -776,8 +776,6 @@ function CapabilitiesCell({
|
||||
onChange: (next: string[]) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const known = new Set<string>(KNOWN_CAPABILITIES);
|
||||
const customs = capabilities.filter((c) => !known.has(c));
|
||||
|
||||
const toggle = (cap: string, on: boolean) => {
|
||||
if (on) {
|
||||
@@ -789,7 +787,13 @@ function CapabilitiesCell({
|
||||
|
||||
return (
|
||||
<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
|
||||
key={cap}
|
||||
className="flex items-center gap-1 text-xs text-content-muted cursor-pointer"
|
||||
@@ -803,19 +807,6 @@ function CapabilitiesCell({
|
||||
{t(CAPABILITY_LABELS[cap])}
|
||||
</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>
|
||||
);
|
||||
}
|
||||
@@ -228,7 +228,7 @@ export function DashboardPage() {
|
||||
}}
|
||||
/>
|
||||
<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 && (
|
||||
<span className="text-[10px] text-yellow-600">估算</span>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user