Skip to content

Commit 3a8e289

Browse files
Spectualclaude
andcommitted
修复命令行动画换行导致布局偏移的问题
- 命令行 flex 容器添加 minHeight: 2.6em,预留两行空间 - 输出块改用 visibility 控制替代条件渲染,并设 minHeight 保持高度稳定 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 63e6dbc commit 3a8e289

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/components/ProfileSection.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,28 +128,28 @@ const AutoTypeCLI = () => {
128128
borderTop: "1px solid var(--term-border)",
129129
}}
130130
>
131-
<div style={{ display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" }}>
131+
<div style={{ display: "flex", alignItems: "flex-start", gap: "6px", flexWrap: "wrap", minHeight: "2.6em" }}>
132132
<span style={{ color: "var(--term-green)" }}>spectual</span>
133133
<span style={{ color: "var(--term-dim)" }}>@</span>
134134
<span style={{ color: "var(--term-blue)" }}>github.io</span>
135135
<span style={{ color: "var(--term-text)" }}>:~$</span>
136136
<span style={{ color: "var(--term-text)", marginLeft: "4px" }}>{text}</span>
137137
{phase !== "output" && <span className="cursor-blink" />}
138138
</div>
139-
{phase === "output" && (
140-
<div
141-
style={{
142-
color: "var(--term-dim)",
143-
marginTop: "6px",
144-
whiteSpace: "pre-line",
145-
borderLeft: "2px solid var(--term-border)",
146-
paddingLeft: "8px",
147-
fontSize: "11px",
148-
}}
149-
>
150-
{output}
151-
</div>
152-
)}
139+
<div
140+
style={{
141+
color: "var(--term-dim)",
142+
marginTop: "6px",
143+
whiteSpace: "pre-line",
144+
borderLeft: "2px solid var(--term-border)",
145+
paddingLeft: "8px",
146+
fontSize: "11px",
147+
minHeight: "2.8em",
148+
visibility: phase === "output" ? "visible" : "hidden",
149+
}}
150+
>
151+
{output}
152+
</div>
153153
</div>
154154
);
155155
};

0 commit comments

Comments
 (0)