diff --git a/src/components/QuestDetailPanel.tsx b/src/components/QuestDetailPanel.tsx index 51fd3d9..cc8c487 100644 --- a/src/components/QuestDetailPanel.tsx +++ b/src/components/QuestDetailPanel.tsx @@ -4,8 +4,6 @@ import { openUrl } from "@tauri-apps/plugin-opener"; import { QuestStep } from "../types"; import { TextWithCoords } from "./TextWithCoords"; -const PREVIEW_LENGTH = 280; - interface Props { questName: string; questUrl: string | null; @@ -146,40 +144,70 @@ export default function QuestDetailPanel({ questName, questUrl, profileId, onClo )} - {/* Quest info header (first step) */} {!loading && headerStep && ( )} - {/* Action steps */} {!loading && actionSteps.map((step) => { const done = completedSteps.has(step.index); const expanded = expandedSteps.has(step.index); - const needsTruncate = step.text.length > PREVIEW_LENGTH; + + if (done) { + const firstLine = step.text.split('\n').find(l => l.trim().length > 0) ?? step.text; + return ( +
+
+ toggleStep(step.index)} + style={{ flexShrink: 0, cursor: "pointer" }} + /> + + {firstLine} + +
+
+ ); + } + + const lines = step.text.split('\n').filter(l => l.trim().length > 0); + const needsTruncate = lines.length > 4; const displayText = needsTruncate && !expanded - ? step.text.slice(0, PREVIEW_LENGTH).trimEnd() + "…" + ? lines.slice(0, 4).join('\n') : step.text; return (
toggleStep(step.index)} - style={{ marginTop: "2px", flexShrink: 0 }} + style={{ marginTop: "2px", flexShrink: 0, cursor: "pointer" }} />
@@ -198,21 +226,18 @@ export default function QuestDetailPanel({ questName, questUrl, profileId, onClo )} {step.images.length > 0 && ( -
+
{step.images.map((src, j) => ( - + /> ))}
)} @@ -249,21 +274,18 @@ function QuestHeader({ step }: { step: QuestStep }) {
{step.images.length > 0 && ( -
+
{step.images.map((src, j) => ( - + /> ))}
)}