feat(ui,api): wave 3 — editorial pricing, real cancel, server history, DeepL purge
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 3m36s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 3m36s
Pricing: full editorial redesign — serif card headers with accent pills
replace the colored font-black blocks, tone sweep across toggle/metrics/
features/CTAs, PLAN_COLORS removed; one design system app-wide.
Translate: decorative titles one step down (CTA hierarchy restored);
glossary and image-translation blocks hidden entirely for free users
(progressive disclosure — three controls for free).
Reviews: XLIFF hint line explains the exchange format; backend errors
routed through a friendly mapper (session/not-found/rate-limit/server).
Landing: fabricated hero UI cards (fake 'Context Engine' overlay)
removed — the photo no longer promises screens that don't exist.
Nav: single DashboardNavLinks component shared by sidebar and mobile
drawer (was duplicated markup).
API: GET /api/v1/translations (user job history, paginated; completed
jobs retained 24h) and POST /api/v1/translations/{id}/cancel —
cooperative cancellation with worker checkpoints before dispatch and
before finalisation, reserved quota released immediately. Translate
monitor now offers a real 'Cancel translation' next to 'Back to start';
recent-jobs list reads server history first, localStorage fallback.
DeepL purge (backend): provider module, registry registration, config
attrs/defaults, dispatch branch, admin settings schema + test branch,
legacy availability block, validation rules, plan provider lists,
error-code mappings, MCP enums, translator prompt mention, related
tests updated/removed. Fallback resolver skips unknown providers, so
stale chains containing 'deepl' degrade gracefully.
Verified: backend 110 tests passed; frontend build exit 0, vitest 9/9,
0 missing i18n keys, eslint 63 errors (vs 64 at HEAD).
This commit is contained in:
@@ -43,6 +43,17 @@ interface RebuildResponse {
|
||||
data: { job_id: string; rebuilt: boolean; segments_applied: number; download_url: string };
|
||||
}
|
||||
|
||||
/** Map raw backend errors to something the reviewer can act on. */
|
||||
function friendlyReviewError(raw: string | undefined, t: (k: string) => string, fallbackKey: string): string | undefined {
|
||||
if (!raw) return undefined;
|
||||
const r = raw.toLowerCase();
|
||||
if (r.includes('401') || r.includes('unauthorized') || r.includes('403')) return t('reviews.error.sessionExpired');
|
||||
if (r.includes('404') || r.includes('not found')) return t('reviews.error.notFound');
|
||||
if (r.includes('429') || r.includes('rate')) return t('reviews.error.rateLimited');
|
||||
if (r.includes('500') || r.includes('server')) return t('reviews.error.server');
|
||||
return raw || t(fallbackKey);
|
||||
}
|
||||
|
||||
function authHeaders(): Record<string, string> {
|
||||
const token = typeof window !== 'undefined' ? localStorage.getItem('token') : null;
|
||||
const headers: Record<string, string> = {};
|
||||
@@ -130,7 +141,7 @@ export default function ReviewPage() {
|
||||
} catch (err) {
|
||||
notify.error({
|
||||
title: t('reviews.error.title'),
|
||||
description: err instanceof Error ? err.message : t('reviews.error.update'),
|
||||
description: friendlyReviewError(err instanceof Error ? err.message : undefined, t, 'reviews.error.update'),
|
||||
});
|
||||
} finally {
|
||||
setSavingId(null);
|
||||
@@ -174,7 +185,7 @@ export default function ReviewPage() {
|
||||
} catch (err) {
|
||||
notify.error({
|
||||
title: t('reviews.rebuildFailed'),
|
||||
description: err instanceof Error ? err.message : undefined,
|
||||
description: friendlyReviewError(err instanceof Error ? err.message : undefined, t, 'reviews.error.update'),
|
||||
});
|
||||
} finally {
|
||||
setIsRebuilding(false);
|
||||
@@ -191,7 +202,7 @@ export default function ReviewPage() {
|
||||
} catch (err) {
|
||||
notify.error({
|
||||
title: t('reviews.xliffExportFailed'),
|
||||
description: err instanceof Error ? err.message : undefined,
|
||||
description: friendlyReviewError(err instanceof Error ? err.message : undefined, t, 'reviews.error.update'),
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -223,7 +234,7 @@ export default function ReviewPage() {
|
||||
} catch (err) {
|
||||
notify.error({
|
||||
title: t('reviews.xliffImportFailed'),
|
||||
description: err instanceof Error ? err.message : undefined,
|
||||
description: friendlyReviewError(err instanceof Error ? err.message : undefined, t, 'reviews.error.update'),
|
||||
});
|
||||
} finally {
|
||||
setIsImporting(false);
|
||||
@@ -256,6 +267,9 @@ export default function ReviewPage() {
|
||||
edited: counts.edited,
|
||||
})}
|
||||
</p>
|
||||
<p className="max-w-xl text-xs font-light text-brand-dark/50 dark:text-white/50">
|
||||
{t('reviews.xliffHint')}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button variant={approveArmed ? 'default' : 'outline'} size="sm" onClick={approveAll} disabled={counts.pending === 0}>
|
||||
|
||||
Reference in New Issue
Block a user