refactor(app): improve route types, reduce amount of as any (#217)

This commit is contained in:
Illia Panasenko
2026-04-08 12:52:37 +08:00
committed by GitHub
parent ac5e6df6c9
commit 6a4f439541
21 changed files with 61 additions and 61 deletions
+2 -2
View File
@@ -165,7 +165,7 @@ export function useCommandCenter() {
const settingsRoute = useMemo<Href>(() => {
const serverIdFromPath = activeServerId;
return serverIdFromPath ? (buildHostSettingsRoute(serverIdFromPath) as Href) : "/";
return serverIdFromPath ? buildHostSettingsRoute(serverIdFromPath) : "/";
}, [activeServerId]);
const actionItems = useMemo(() => {
@@ -220,7 +220,7 @@ export function useCommandCenter() {
workspaceId: agent.cwd,
target: { kind: "agent", agentId: agent.id },
});
router.navigate(route as any);
router.navigate(route);
},
[setOpen],
);
+1 -1
View File
@@ -190,7 +190,7 @@ export function useGitActions({ serverId, cwd, icons }: UseGitActionsInput): Use
const targetWorkingDir = resolveNewAgentWorkingDir(cwd, status ?? null);
void runArchiveWorktree({ serverId, cwd, worktreePath })
.then(() => {
router.replace(buildNewAgentRoute(serverId, targetWorkingDir) as any);
router.replace(buildNewAgentRoute(serverId, targetWorkingDir));
})
.catch((err) => {
const message = err instanceof Error ? err.message : "Failed to archive worktree";
@@ -11,7 +11,7 @@ import { buildHostWorkspaceRoute } from "@/utils/host-routes";
*/
export function navigateToWorkspace(serverId: string, workspaceId: string) {
const href = buildHostWorkspaceRoute(serverId, workspaceId);
router.navigate(href as any);
router.navigate(href);
}
export function useWorkspaceNavigation() {