diff --git a/components/agents/AgentWorkflowPanelDarkV2.tsx b/components/agents/AgentWorkflowPanelDarkV2.tsx
index 99fc21a06..fdf9992fc 100644
--- a/components/agents/AgentWorkflowPanelDarkV2.tsx
+++ b/components/agents/AgentWorkflowPanelDarkV2.tsx
@@ -156,6 +156,14 @@ function getWorkflowStepOptionLevels(params: {
return levels;
}
+function getWorkflowOptionDepthLabel(depth: number) {
+ return depth === 1 ? "主卡片" : `${depth}级子卡片`;
+}
+
+function getWorkflowOptionDepthShortLabel(depth: number) {
+ return depth === 1 ? "主" : `${depth}级`;
+}
+
function StepOptionCard({
option,
step,
@@ -695,7 +703,10 @@ export function AgentWorkflowPanelDarkV2({
selectionValue: selections[step.key],
});
const active = step.key === activeEmbeddedStepEntry.step.key;
- const stepSummary = stepSelectionSummaryMap[step.key] || "";
+ const stepSelectedPath = getAgentWorkflowSelectedOptionPath({
+ step,
+ selectionValue: selections[step.key],
+ });
const stepOptionLevels = getWorkflowStepOptionLevels({
step,
selectionValue: selections[step.key],
@@ -707,9 +718,9 @@ export function AgentWorkflowPanelDarkV2({
const activeStepChildLabel =
active && stepOptionLevels.length > 1
? `${
- activeEmbeddedOptionLevel?.depth === 1
- ? "主卡片"
- : `${activeEmbeddedOptionLevel?.depth || 1}级子卡片`
+ getWorkflowOptionDepthLabel(
+ activeEmbeddedOptionLevel?.depth || 1
+ )
}`
: deepestSelectedLevel > 1
? `已到 ${deepestSelectedLevel} 级`
@@ -717,68 +728,102 @@ export function AgentWorkflowPanelDarkV2({
return (
-
);
})}
diff --git a/components/image-annotator.tsx b/components/image-annotator.tsx
index b59559fcd..b2430c2af 100644
--- a/components/image-annotator.tsx
+++ b/components/image-annotator.tsx
@@ -350,6 +350,10 @@ export function ImageAnnotator({
{ label: "4:5", value: "4:5", ratio: 4 / 5 },
{ label: "21:9", value: "21:9", ratio: 21 / 9 },
];
+ const resizeQuickPresets = [
+ { label: "主图 1440×1440", width: 1440, height: 1440, aspectRatioValue: "1:1" },
+ { label: "主图 1440×1920", width: 1440, height: 1920, aspectRatioValue: "3:4" },
+ ] as const;
// 根据比例和宽度计算高度
const calculateHeightFromWidth = (width: number, ratio: number | null) => {
@@ -396,6 +400,14 @@ export function ImageAnnotator({
}
};
+ const handleResizeQuickPresetSelect = (
+ preset: (typeof resizeQuickPresets)[number]
+ ) => {
+ setResizeCanvasWidth(preset.width);
+ setResizeCanvasHeight(preset.height);
+ setSelectedAspectRatio(preset.aspectRatioValue);
+ };
+
// 确保在客户端渲染
useEffect(() => {
setMounted(true);
@@ -1019,6 +1031,14 @@ export function ImageAnnotator({
setResizeImageScale(newScale);
};
+ const handleResizeScaleSliderChange = (value: number[]) => {
+ const nextScale = value[0];
+ if (!isResizeMode || typeof nextScale !== "number" || Number.isNaN(nextScale)) {
+ return;
+ }
+ setResizeImageScale(Math.max(0.1, Math.min(5, nextScale)));
+ };
+
// 尺寸调整:渲染预览
useEffect(() => {
if (!isResizeMode || !resizeCanvasRef.current || !image || !resizeContainerRef.current) return;
@@ -1754,6 +1774,44 @@ export function ImageAnnotator({
/>
+
+ {resizeQuickPresets.map((preset) => {
+ const isActive =
+ resizeCanvasWidth === preset.width && resizeCanvasHeight === preset.height;
+ return (
+ handleResizeQuickPresetSelect(preset)}
+ className={cn(
+ "h-8 rounded-[18px] px-3 text-xs font-medium whitespace-nowrap",
+ isActive && "shadow-sm"
+ )}
+ >
+ {preset.label}
+
+ );
+ })}
+
+
+
+
+ 缩放
+
+
+
+ {(resizeImageScale * 100).toFixed(0)}%
+
+
+