fix: align canvas action credit costs

This commit is contained in:
134 2026-06-14 20:22:29 +08:00
parent 85930dc1a6
commit 5e0464c522

View File

@ -160,6 +160,7 @@ import { buildImageProxyUrl } from "@/lib/image-delivery";
import {
DEFAULT_PUBLIC_THREED_MODEL_ALIAS_CONFIG,
getDefaultThreeDModelAliasId,
resolveThreeDModelBillingId,
type PublicThreeDModelAliasConfig,
} from "@/lib/model3d/model-alias-config";
import {
@ -1858,8 +1859,19 @@ export function ImageNode({
[pointsSystemConfig]
);
const worldImageCreditCost = useMemo(
() => get3DWorldCreditCost(pointsSystemConfig, selectedWorldModelEntry?.id),
[pointsSystemConfig, selectedWorldModelEntry?.id]
() => {
const worldBillingModelId = resolveThreeDModelBillingId(
selectedWorldModelEntry?.id || selectedWorldModelVersion,
publicModelAliasConfig.worldModels
);
return get3DWorldCreditCost(pointsSystemConfig, worldBillingModelId);
},
[
pointsSystemConfig,
publicModelAliasConfig.worldModels,
selectedWorldModelEntry?.id,
selectedWorldModelVersion,
]
);
const tripoImageToModelCostLabel = formatImageNodeFeatureCostLabel({
cost: tripoImageToModelCreditCost,
@ -1897,6 +1909,7 @@ export function ImageNode({
getImageToolCostShortLabel("watermark-remove");
const extendCostShortLabel = getImageToolCostShortLabel("extend");
const promptRegenerateCostShortLabel = getImageToolCostShortLabel("repaint");
const localEditCostShortLabel = promptRegenerateCostShortLabel;
const angleEditCostShortLabel = getImageToolCostShortLabel("angle-edit");
const enhanceCostShortLabel = formatImageNodeFeatureCostShortLabel({
cost: calculateEnhanceProPointsEstimate(pointsSystemConfig, {
@ -9288,7 +9301,7 @@ export function ImageNode({
{isSelectedImageActionInline("localEdit") ? (
<Button
className="h-10 rounded-xl px-3 font-medium text-[13px] text-slate-700 hover:bg-slate-100 hover:text-slate-900 dark:text-slate-100 dark:hover:bg-zinc-800"
className="group relative h-10 rounded-xl px-3 font-medium text-[13px] text-slate-700 hover:bg-slate-100 hover:text-slate-900 dark:text-slate-100 dark:hover:bg-zinc-800"
disabled={isProcessing || isSubmittingLocalEdit}
onClick={() => handleAction("local-edit")}
title={imageLocalEditItem.label}
@ -9300,6 +9313,10 @@ export function ImageNode({
item={imageLocalEditItem}
/>
{imageLocalEditItem.label}
<ImageActionCreditBadge
compact
label={localEditCostShortLabel}
/>
</Button>
) : null}
@ -9573,7 +9590,8 @@ export function ImageNode({
fallback={Wand2}
item={imageLocalEditItem}
/>
{imageLocalEditItem.label}
<span>{imageLocalEditItem.label}</span>
<ImageActionCreditBadge label={localEditCostShortLabel} />
</DropdownMenuItem>
) : null}
{isSelectedImageActionInMore("removeWatermark") ? (