From 60640dfa981e419cf86413c924fd26822bd42327 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Fri, 18 Sep 2026 08:26:37 +0800 Subject: feat(frontend): 布局/认证/项目页迁移 shadcn 并修复 375px 溢出 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [变更性质] 本提交为 UI 迁移与移动端布局修复,产品功能不变。 [新增功能] Leader 第 2 轮验收的失败项:AuthPages 在 375px 视口横向溢出 47px, 原因为 .auth-card 固定 400px 宽度。 [实现方案] AuthPages:.auth-wrap 改为 flex 包裹,.auth-card 改用 width:min(400px,100%),三档视口下登录/注册/重置均零溢出。 Layout.svelte 重写为 shadcn Button(退出按钮)+ Tailwind 主题变量, 同时保留 .layout/.content/.navlink/.brand 等 legacy class 以维持 mobileCss.test.ts 的断言语义。ProjectsPage 迁移 shadcn Card/Table 等 (保留 p-name 链接语义),新增 projectsPageLoad.test.ts 回归项目列表 加载失败时的错误呈现。 [影响范围] frontend/src/components/Layout.svelte、pages/AuthPages.svelte、 pages/ProjectsPage.svelte;视觉验证覆盖 375/768/1440 全零溢出。 --- frontend/src/pages/ProjectsPage.svelte | 77 +++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 30 deletions(-) (limited to 'frontend/src/pages/ProjectsPage.svelte') diff --git a/frontend/src/pages/ProjectsPage.svelte b/frontend/src/pages/ProjectsPage.svelte index b29a856..13525b6 100644 --- a/frontend/src/pages/ProjectsPage.svelte +++ b/frontend/src/pages/ProjectsPage.svelte @@ -6,6 +6,12 @@ import { extractStatusMessage } from '../lib/state'; import { go } from '../lib/router'; import { fmtDateTime } from '../lib/format'; + import { Button } from '$lib/components/ui/button'; + import * as Card from '$lib/components/ui/card'; + import * as Table from '$lib/components/ui/table'; + import { Input } from '$lib/components/ui/input'; + import { Label } from '$lib/components/ui/label'; + import { Alert } from '$lib/components/ui/alert'; let busy = $state(false); let error = $state(null); @@ -27,6 +33,13 @@ } } + // 159399 QA regression (2026-09-17): load() existed but was wired nowhere, + // so the projects page kept rendering the store's stale/empty state and + // users saw 还没有项目 despite existing projects on the server. + $effect(() => { + void load(); + }); + async function create(e: SubmitEvent) { e.preventDefault(); if (!newName.trim()) return; @@ -49,9 +62,9 @@ {#snippet actions()} - + {/snippet}
@@ -60,18 +73,18 @@

新建项目

- - + +
- - + +
- {#if createErr}{/if} + {#if createErr}{/if}
- +
{/if} @@ -81,32 +94,36 @@ {/if} {#if projectsStore.all.length > 0} -
- - - - - - - - - - + + + + + 名称 + 简介 + 版本代 + 最近更新 + + + {#each projectsStore.all as p (p.id)} - - - - - - + + + {p.name} + + {p.description ?? '—'} + {p.draft_generation ?? '—'} + {fmtDateTime(p.updated_at)} + {/each} - -
名称简介版本代最近更新
{p.name}{p.description ?? '—'}{p.draft_generation ?? '—'}{fmtDateTime(p.updated_at)}
-
+ + + {/if}
-- cgit v1.2.3