Improve MindSpace visual editor UX and default RMB billing.
Add color-coded edit highlights with an in-preview legend, strip CSP meta for srcdoc editing, and simplify fullscreen preview to immersive visual edit only. Default billing to CNY token rates unless H5_USE_BACKEND_COST=1. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,3 +39,16 @@ test('computeDeltaCostCents returns zero when no usage delta', () => {
|
||||
});
|
||||
assert.equal(computeDeltaCostCents(previous, current, config), 0);
|
||||
});
|
||||
|
||||
test('computeDeltaCostCents ignores backend USD cost unless explicitly enabled', () => {
|
||||
const previous = { lastInputTokens: 0, lastOutputTokens: 0, lastAccumulatedCost: 0.01 };
|
||||
const current = normalizeTokenState({
|
||||
accumulatedInputTokens: 1000,
|
||||
accumulatedOutputTokens: 500,
|
||||
accumulatedCost: 0.02,
|
||||
});
|
||||
const rmbConfig = { ...config, useBackendCost: false };
|
||||
assert.equal(computeDeltaCostCents(previous, current, rmbConfig), 5);
|
||||
const usdConfig = { ...config, useBackendCost: true };
|
||||
assert.equal(computeDeltaCostCents(previous, current, usdConfig), 8);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user