feat: 优化项目 Agent 工作区布局

增加四阶段进度、项目上下文侧栏和更清晰的执行卡片层级,同时保留现有流式事件接收、确认与恢复流程。
This commit is contained in:
Zhu Junhao
2026-09-03 10:53:59 +08:00
parent 988c0fe555
commit 4759759d02
3 changed files with 286 additions and 74 deletions

View File

@@ -1,13 +1,15 @@
:root {
font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
color: #111827;
background: #fff;
background: #f6f7f9;
font-synthesis: none;
--blue: #0f5df5;
--blue-soft: #f2f7ff;
--blue: #1769e8;
--blue-soft: #eef5ff;
--muted: #667085;
--line: #e8edf5;
--line: #e3e8ef;
--green: #087d41;
--surface: #fff;
--canvas: #f6f7f9;
}
* { box-sizing: border-box; }
@@ -15,16 +17,16 @@ body { margin: 0; min-width: 0; min-height: 100vh; }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; background: #fff; }
.rail { width: 84px; flex: 0 0 84px; height: 100vh; position: sticky; top: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 20px 10px; gap: 18px; }
.app-shell { min-height: 100vh; display: flex; background: var(--canvas); }
.rail { width: 76px; flex: 0 0 76px; height: 100vh; position: sticky; top: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 20px 8px; gap: 16px; background: var(--surface); }
.brand { width: 46px; height: 46px; border-radius: 9px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand svg { width: 24px; }
.rail a { width: 64px; height: 66px; border-radius: 9px; color: #405170; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 15px; }
.rail a { width: 60px; height: 62px; border-radius: 8px; color: #526078; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 14px; }
.rail a svg { width: 24px; height: 24px; }
.rail a.active { background: var(--blue); color: #fff; }
.rail .brand + a { margin-top: 6px; }
.project-list { width: 276px; flex: 0 0 276px; height: 100vh; position: sticky; top: 0; overflow-y: auto; border-right: 1px solid var(--line); padding: 24px 16px; background: #fff; }
.project-list { width: 264px; flex: 0 0 264px; height: 100vh; position: sticky; top: 0; overflow-y: auto; border-right: 1px solid var(--line); padding: 24px 14px; background: var(--surface); }
.aside-title { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.aside-title h2 { font-size: 20px; margin: 0; }
.icon-button { width: 32px; height: 32px; border: 1px solid #9aa8bd; border-radius: 50%; background: #fff; color: #395277; font-size: 23px; line-height: 27px; cursor: pointer; }
@@ -34,16 +36,53 @@ a { color: inherit; text-decoration: none; }
.project-item time { color: #697794; font-size: 13px; }
.project-item.selected { background: #edf4ff; color: var(--blue); }
.aside-empty { padding: 20px 12px; color: #98a2b3; }
.main-view { min-width: 0; flex: 1; }
.main-view { min-width: 0; flex: 1; background: var(--surface); }
.project-page { min-height: 100vh; display: flex; flex-direction: column; }
.page-header { height: 80px; flex: 0 0 80px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; background: rgba(255,255,255,.95); position: sticky; top: 0; z-index: 3; }
.project-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas); }
.page-header { height: 72px; flex: 0 0 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 3; }
.page-heading, .run-actions { display: flex; align-items: center; gap: 12px; }
.page-header h1 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.tag { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border: 1px solid #cfd7e4; border-radius: 6px; color: #52617b; font-size: 14px; font-weight: 500; white-space: nowrap; }
.page-header h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid #cfd7e4; border-radius: 6px; color: #52617b; font-size: 13px; font-weight: 500; white-space: nowrap; }
.tag.blue { color: var(--blue); border-color: #9dbdff; }
.tag.green { color: var(--green); border-color: #9be0bd; }
.work-scroll { width: min(920px, calc(100% - 64px)); margin: 0 auto; padding: 32px 0 72px; }
.project-workspace { width: min(1280px, 100%); margin: 0 auto; padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.workspace-main { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.project-stage-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--line); list-style: none; }
.project-stage { min-width: 0; position: relative; display: flex; align-items: center; gap: 10px; color: #8a94a6; }
.project-stage:not(:last-child)::after { content: ""; height: 1px; position: absolute; top: 15px; left: 42px; right: 12px; background: #dce2eb; }
.project-stage.is-complete:not(:last-child)::after { background: #8fb6f4; }
.stage-marker { width: 30px; height: 30px; flex: 0 0 30px; position: relative; z-index: 1; display: grid; place-items: center; border: 1px solid #cfd7e4; border-radius: 50%; background: #f8fafc; color: #68758a; font-size: 13px; font-weight: 700; }
.project-stage.is-complete .stage-marker { border-color: #b8e0cc; background: #e9f7f0; color: var(--green); }
.project-stage.is-current .stage-marker { border-color: var(--blue); background: var(--blue); color: #fff; }
.stage-copy { min-width: 0; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; padding-right: 10px; background: var(--surface); }
.stage-copy strong { overflow: hidden; color: #4f5d73; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.stage-copy small { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.project-stage.is-current .stage-copy strong { color: #172033; }
.project-stage.is-complete .stage-copy strong { color: #344054; }
.work-scroll { width: min(900px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 72px; }
.project-context-panel { min-width: 0; position: sticky; top: 96px; display: grid; gap: 12px; }
.context-card { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.context-card h2 { margin: 0; color: #253047; font-size: 15px; }
.context-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.context-card-heading > span, .context-status { color: #768399; font-size: 12px; white-space: nowrap; }
.context-status { padding: 3px 7px; border-radius: 4px; background: #e9f7f0; color: var(--green); }
.context-stage-summary { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.context-stage-index { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; }
.context-stage-summary > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.context-stage-summary strong { color: #202b3f; font-size: 14px; }
.context-stage-summary small { color: var(--blue); font-size: 12px; }
.context-definition-list { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.context-definition-list > div { display: flex; justify-content: space-between; gap: 12px; color: #748096; font-size: 12px; }
.context-definition-list dt, .context-definition-list dd { margin: 0; }
.context-definition-list dd { overflow: hidden; color: #47546a; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.current-model-name { display: block; overflow: hidden; color: #344054; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.context-file-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.context-file-list li { min-width: 0; display: flex; align-items: center; gap: 8px; color: #536078; font-size: 13px; }
.context-file-list svg { width: 16px; flex: 0 0 16px; color: #728099; }
.context-file-list span, .context-file-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-context-list a { color: var(--blue); }
.context-empty { margin: 0; color: #8a94a6; font-size: 13px; line-height: 1.6; }
.context-more { display: block; margin-top: 12px; color: #768399; }
.history-loading { margin-top: 24vh; text-align: center; color: var(--muted); }
.material-start { width: 640px; max-width: 100%; margin: 10vh auto 0; }
@@ -59,11 +98,11 @@ a { color: inherit; text-decoration: none; }
.file-chips svg { width: 16px; color: var(--blue); }
.file-chips > small { align-self: center; color: var(--muted); }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.load-earlier { align-self: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px 16px; }
.load-earlier:hover, .load-earlier:focus-visible { color: var(--primary); }
.flow-row { min-width: 0; content-visibility: auto; contain-intrinsic-size: 54px; }
.flow-message { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; margin: 0; }
.flow-message { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.flow-message > .flow-content { grid-column: 2; }
.flow-tool, .flow-reasoning, .flow-notice { position: relative; padding-left: 54px; }
.agent-avatar { width: 38px; height: 38px; border-radius: 11px; background: #edf4ff; color: var(--blue); display: grid; place-items: center; }
@@ -89,7 +128,9 @@ a { color: inherit; text-decoration: none; }
.agent-markdown a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.agent-markdown table { display: block; max-width: 100%; margin: 12px 0; overflow-x: auto; border-collapse: collapse; }
.agent-markdown th, .agent-markdown td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.activity-row { color: #778195; font-size: 13px; border: 0; }
.activity-row { color: #6f7b90; font-size: 13px; border: 0; }
.flow-tool .activity-row { padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfc; }
.flow-tool .activity-row summary { width: 100%; }
.activity-row summary { width: max-content; max-width: 100%; display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; list-style: none; }
.activity-row summary::-webkit-details-marker { display: none; }
.activity-row summary::after { content: ""; margin-left: 2px; color: #a1a9b7; transition: transform .16s ease; }
@@ -107,15 +148,15 @@ a { color: inherit; text-decoration: none; }
.finalizing-row span { color: transparent; background: linear-gradient(90deg, #8d96a6 25%, #3f83ed 50%, #8d96a6 75%); background-size: 220% 100%; background-clip: text; animation: activity-shimmer 1.7s linear infinite; }
@keyframes activity-shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .activity-row.active summary span, .finalizing-row span { color: inherit; background: none; animation: none; } }
.notice-row { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-radius: 8px; background: #f6f9ff; }
.notice-row { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid #dce5f2; border-radius: 8px; background: #f6f9ff; }
.notice-row svg { width: 18px; }
.notice-row.success { color: #087d41; }
.notice-row.error { color: #c53131; background: #fff7f7; }
.notice-row.info { color: #45658f; background: #f7f9fc; }
.pending { opacity: .9; }
.ask-card { width: 700px; max-width: calc(100% - 60px); margin: 28px 0 0 60px; padding: 22px; border-radius: 9px; background: #f6f9ff; box-shadow: inset 0 0 0 1px #d7e4fb; }
.ask-card h3 { color: var(--blue); margin: 0 0 5px; font-size: 20px; }
.ask-card { width: 700px; max-width: calc(100% - 60px); margin: 28px 0 0 60px; padding: 22px; border-radius: 9px; background: #fffaf2; box-shadow: inset 0 0 0 1px #f1ca8b; }
.ask-card h3 { color: #28354a; margin: 0 0 5px; font-size: 19px; }
.ask-card > p { color: #697794; margin: 0 0 16px; font-size: 14px; }
.plan-fields { overflow: hidden; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px #dce4ef; }
.plan-fields label { display: grid; grid-template-columns: 150px 1fr; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); }
@@ -127,7 +168,7 @@ a { color: inherit; text-decoration: none; }
.plan-summary { margin: 12px 0 16px; padding: 11px 14px; border-radius: 6px; color: #4b6188; background: #eaf2ff; }
.plan-note { display: block; margin-bottom: 16px; }
.plan-note > span { display: block; margin-bottom: 8px; color: #53617b; font-size: 14px; }
.ask-actions { display: flex; gap: 8px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.material-items { margin-bottom: 16px; overflow: hidden; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px #dce4ef; }
.material-item { min-height: 72px; display: grid; grid-template-columns: minmax(180px, 1fr) 190px 58px; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.material-item:last-child { border-bottom: 0; }
@@ -141,7 +182,7 @@ a { color: inherit; text-decoration: none; }
.material-clear { margin: 0; padding: 16px; color: var(--green); }
.material-more { width: 100%; padding: 11px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--blue); cursor: pointer; }
.material-upload:focus-within, .material-more:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.artifact-card { margin: 28px 0 min(28vh, 280px) 60px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px #dce4ef; }
.artifact-card { margin: 28px 0 72px 60px; border-radius: 8px; overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px #dce4ef; }
.artifact-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.artifact-row:last-child { border: 0; }
.artifact-row > svg { width: 25px; color: var(--blue); }
@@ -222,8 +263,16 @@ a { color: inherit; text-decoration: none; }
.el-input__wrapper, .el-textarea__inner { box-shadow: inset 0 0 0 1px #d9e0ea; }
.el-dialog { border-radius: 12px; }
@media (max-width: 1320px) {
.project-workspace { max-width: 960px; grid-template-columns: minmax(0, 1fr); }
.project-context-panel { display: none; }
}
@media (max-width: 1180px) {
.project-list { width: 240px; flex-basis: 240px; }
.project-workspace { padding: 20px; }
.project-stage-bar { padding-right: 18px; padding-left: 18px; }
.stage-copy small { display: none; }
.settings-page { padding-left: 28px; padding-right: 28px; }
.settings-grid { grid-template-columns: 310px 1fr; }
.skill-grid { grid-template-columns: 390px 1fr; }
@@ -236,6 +285,10 @@ a { color: inherit; text-decoration: none; }
.rail { width: 64px; flex-basis: 64px; padding-left: 0; padding-right: 0; }
.rail a { width: 52px; font-size: 12px; }
.project-list { width: 190px; flex-basis: 190px; padding: 20px 10px; }
.project-workspace { padding: 12px; }
.workspace-main { border-radius: 7px; }
.project-stage-bar { grid-template-columns: repeat(4, minmax(112px, 1fr)); overflow-x: auto; padding: 16px; }
.project-stage:not(:last-child)::after { right: 8px; }
.work-scroll { width: calc(100% - 32px); }
.page-header { padding: 0 16px; }
.page-header h1 { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; }