refactor(types): rename AppType to AppId for semantic clarity

Rename `AppType` to `AppId` across the entire frontend codebase to better
reflect its purpose as an application identifier rather than a type category.
This aligns frontend naming with backend command parameter conventions.

Changes:
- Rename type `AppType` to `AppId` in src/lib/api/types.ts
- Remove `AppType` export from src/lib/api/index.ts
- Update all component props from `appType` to `appId` (43 files)
- Update all variable names from `appType` to `appId`
- Synchronize documentation (CHANGELOG, refactoring plans)
- Update test files and MSW mocks

BREAKING CHANGE: `AppType` type is no longer exported. Use `AppId` instead.
All component props have been renamed from `appType` to `appId`.
This commit is contained in:
Jason
2025-10-30 14:59:15 +08:00
parent 80dd6e9381
commit 8e4a0a1bbb
43 changed files with 327 additions and 347 deletions

View File

@@ -5,7 +5,7 @@ import type {
McpServerSpec,
McpStatus,
} from "@/types";
import type { AppType } from "./types";
import type { AppId } from "./types";
export const mcpApi = {
async getStatus(): Promise<McpStatus> {
@@ -31,7 +31,7 @@ export const mcpApi = {
return await invoke("validate_mcp_command", { cmd });
},
async getConfig(app: AppType = "claude"): Promise<McpConfigResponse> {
async getConfig(app: AppId = "claude"): Promise<McpConfigResponse> {
return await invoke("get_mcp_config", { app });
},
@@ -44,7 +44,7 @@ export const mcpApi = {
},
async upsertServerInConfig(
app: AppType,
app: AppId,
id: string,
spec: McpServer,
options?: { syncOtherSide?: boolean },
@@ -61,7 +61,7 @@ export const mcpApi = {
},
async deleteServerInConfig(
app: AppType,
app: AppId,
id: string,
options?: { syncOtherSide?: boolean },
): Promise<boolean> {
@@ -76,7 +76,7 @@ export const mcpApi = {
},
async setEnabled(
app: AppType,
app: AppId,
id: string,
enabled: boolean,
): Promise<boolean> {