fix(navigation): resolve the 74 approved application destinations

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
leefer
2026-10-22 02:57:12 +08:00
co-authored by multica-agent
parent a666f6bd12
commit 9d54b9d8dd
32 changed files with 128 additions and 85 deletions
@@ -1,4 +1,5 @@
<script lang="ts">
import { resolve } from "$app/paths";
import { onMount } from "svelte";
import { spotlight } from "$lib/actions/spotlight";
import { createQuery } from "@tanstack/svelte-query";
@@ -186,14 +187,14 @@
style:--scene={`var(--sc-${scene})`}
>
<aside class="sidebar" aria-label="全站导航">
<a class="brand" href="/" aria-label="返回工作室"
<a class="brand" href={resolve('/')} aria-label="返回工作室"
>AIGC{#if expanded}<small>创作工作台</small>{/if}</a
>
<nav aria-label="主要导航">
{#each mainNav as item}<a
class="nav-item reference-option"
use:spotlight
href={item.href}
href={resolve(item.href)}
style:--nav-c={`var(--sc-${item.scene})`}
aria-current={item.matches(page.url.pathname) ? "page" : undefined}
title={item.label}
@@ -204,7 +205,7 @@
{#each NAV_MANAGE as item}<a
class="nav-item reference-option"
use:spotlight
href={item.href}
href={resolve(item.href)}
style:--nav-c={`var(--sc-${item.scene})`}
aria-current={item.matches(page.url.pathname) ? "page" : undefined}
title={item.label}
@@ -235,13 +236,13 @@
<a
class="nav-item reference-option"
use:spotlight
href="/settings"
href={resolve('/settings')}
aria-current={page.url.pathname === "/settings" ? "page" : undefined}
title="设置"><Icon name="settings" size={18} /><span>设置</span></a
>
<a
class="connection"
href="/connections"
href={resolve('/connections')}
title={connDetail}
aria-label={connDetail}
><span class="status-chip-dot {connDot}"></span>{#if expanded}<span
@@ -271,14 +272,14 @@
{#if currentNav?.id === "connections"}
<a
class="a-btn secondary sm"
href="/connections"
href={resolve('/connections')}
aria-current={page.url.pathname === "/connections"
? "page"
: undefined}>ComfyUI 连接</a
>
<a
class="a-btn secondary sm"
href="/models"
href={resolve('/models')}
aria-current={page.url.pathname === "/models" ? "page" : undefined}
>大语言模型</a
>
@@ -1,4 +1,6 @@
<script lang="ts">
import type { Pathname } from "$app/types";
import { resolve } from "$app/paths";
import { goto } from "$app/navigation";
import { createQuery } from "@tanstack/svelte-query";
import { toStore } from "svelte/store";
@@ -17,7 +19,7 @@
group: "pages" | "projects";
label: string;
icon: IconName;
href: string;
href: Pathname;
}
const listId = `palette-${Math.random().toString(36).slice(2, 9)}`;
@@ -69,7 +71,7 @@
function go(entry: Entry) {
open = false;
void goto(entry.href);
void goto(resolve(entry.href));
}
function move(step: number) {
@@ -1,4 +1,5 @@
<script lang="ts">
import { resolve } from '$app/paths';
import { createQuery } from '@tanstack/svelte-query';
import { toStore } from 'svelte/store';
import { projects } from '$lib/api';
@@ -56,7 +57,7 @@
<ShellPop bind:open label={t('shell.scopeHint')} width="300px">
<a
class="a-menu-item"
href="/"
href={resolve('/')}
aria-current={onProjectsList ? 'page' : undefined}
onclick={() => (open = false)}
>
@@ -70,7 +71,7 @@
{:else if $projectsQuery.isError}
<p class="scope-note err">{t('shell.scopeLoadFailed')}</p>
{:else if recent.length === 0}
<a class="a-menu-item" href="/" onclick={() => (open = false)}>
<a class="a-menu-item" href={resolve('/')} onclick={() => (open = false)}>
<Icon name="plus" size={15} />
<span class="a-menu-label">{t('shell.scopeEmpty')}</span>
</a>
@@ -78,7 +79,7 @@
{#each recent as project (project.id)}
<a
class="a-menu-item"
href="/workbench/{project.id}"
href={resolve(`/workbench/${project.id}`)}
aria-current={project.id === projectId ? 'true' : undefined}
onclick={() => (open = false)}
>
@@ -1,4 +1,5 @@
<script lang="ts">
import { resolve } from '$app/paths';
import { createQuery } from '@tanstack/svelte-query';
import { toStore } from 'svelte/store';
import { workflows, type Job } from '$lib/api';
@@ -93,7 +94,7 @@
{:else}
{#each recent as job (job.id)}
{@const info = jobStatusInfo(job)}
<a class="a-menu-item tray-row" href="/tasks" title={info.detail} onclick={() => (open = false)}>
<a class="a-menu-item tray-row" href={resolve('/tasks')} title={info.detail} onclick={() => (open = false)}>
<span class="tray-copy">
<span class="a-menu-label">{workflowName(job)}</span>
<span class="tray-meta">{jobSourceLabel(job)} · <span class="mono">{timeOf(job)}</span></span>
@@ -102,7 +103,7 @@
</a>
{/each}
{/if}
<a class="a-menu-item tray-all" href="/tasks" onclick={() => (open = false)}>
<a class="a-menu-item tray-all" href={resolve('/tasks')} onclick={() => (open = false)}>
<span class="a-menu-label">{t('shell.trayAll')}</span>
</a>
</ShellPop>
+2 -1
View File
@@ -1,3 +1,4 @@
import type { Pathname } from "$app/types";
import type { IconName } from "$lib/components/ui/icons";
// IDs are retained for the existing page contracts while B1–B4 replace layouts.
@@ -18,7 +19,7 @@ export interface NavItem {
id: NavId;
label: string;
icon: IconName;
href: string;
href: Pathname;
scene: "project" | "image" | "agent" | "manage" | "asset";
matches: (path: string) => boolean;
}