fix: clarify popup text and form fields in import UI - fix Italian copy in nitro editor, use shared CloneSource interface, make nitro/icon fields optional
CI / check (push) Successful in 31s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m3s

This commit is contained in:
openhands committed 2026-08-06 20:44:34 +02:00
1 parent f792c276b7
commit 94ccd098d5
2 files changed
+15 -16

No files matched your search

@@ -28,20 +28,12 @@ import {
} from "@/components/ui/select"; } from "@/components/ui/select";
import { adminFetch } from "@/lib/admin-fetch"; import { adminFetch } from "@/lib/admin-fetch";
import { HABBO_GAMEDATA_HOTELS } from "@/lib/habbo-gamedata-hotel"; import { HABBO_GAMEDATA_HOTELS } from "@/lib/habbo-gamedata-hotel";
import type { CloneSource } from "@/lib/services/clone-sources";
import { runSseImport } from "@/lib/sse-client"; import { runSseImport } from "@/lib/sse-client";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
// ── Types ───────────────────────────────────────────────────────────────────── // ── Types ─────────────────────────────────────────────────────────────────────
interface CloneSource {
id: string;
name: string;
furnidataUrl: string;
nitroBaseUrl: string;
iconBaseUrl: string;
hotel: string;
}
interface FurniItem { interface FurniItem {
classname: string; classname: string;
name: string; name: string;
@@ -80,6 +72,9 @@ function SourceForm({ initial, onSave, onCancel, saving }: SourceFormProps) {
const [furnidataUrl, setFurnidataUrl] = useState(initial?.furnidataUrl ?? ""); const [furnidataUrl, setFurnidataUrl] = useState(initial?.furnidataUrl ?? "");
const [nitroBaseUrl, setNitroBaseUrl] = useState(initial?.nitroBaseUrl ?? ""); const [nitroBaseUrl, setNitroBaseUrl] = useState(initial?.nitroBaseUrl ?? "");
const [iconBaseUrl, setIconBaseUrl] = useState(initial?.iconBaseUrl ?? ""); const [iconBaseUrl, setIconBaseUrl] = useState(initial?.iconBaseUrl ?? "");
const [sourceSwfBaseUrl, setSourceSwfBaseUrl] = useState(
initial?.sourceSwfBaseUrl ?? "",
);
const [hotel, setHotel] = useState(initial?.hotel ?? ""); const [hotel, setHotel] = useState(initial?.hotel ?? "");
async function handleSubmit(e: React.FormEvent) { async function handleSubmit(e: React.FormEvent) {
@@ -90,6 +85,7 @@ function SourceForm({ initial, onSave, onCancel, saving }: SourceFormProps) {
furnidataUrl, furnidataUrl,
nitroBaseUrl, nitroBaseUrl,
iconBaseUrl, iconBaseUrl,
sourceSwfBaseUrl,
hotel, hotel,
}); });
} }
@@ -119,13 +115,16 @@ function SourceForm({ initial, onSave, onCancel, saving }: SourceFormProps) {
placeholder="Nitro base URL (e.g. https://x/bundled/furniture)" placeholder="Nitro base URL (e.g. https://x/bundled/furniture)"
value={nitroBaseUrl} value={nitroBaseUrl}
onChange={(e) => setNitroBaseUrl(e.target.value)} onChange={(e) => setNitroBaseUrl(e.target.value)}
required
/> />
<Input <Input
placeholder="Icon base URL (e.g. https://x/icons)" placeholder="Icon base URL (e.g. https://x/icons)"
value={iconBaseUrl} value={iconBaseUrl}
onChange={(e) => setIconBaseUrl(e.target.value)} onChange={(e) => setIconBaseUrl(e.target.value)}
required />
<Input
placeholder="SWF base URL (optional, for non-Habbo sources)"
value={sourceSwfBaseUrl}
onChange={(e) => setSourceSwfBaseUrl(e.target.value)}
/> />
<Select value={hotel} onValueChange={setHotel}> <Select value={hotel} onValueChange={setHotel}>
<SelectTrigger> <SelectTrigger>
@@ -339,7 +339,7 @@ export function NitroEditorDialog({
{colorCount > 0 && ( {colorCount > 0 && (
<Badge variant="outline" className="text-[10px] gap-1"> <Badge variant="outline" className="text-[10px] gap-1">
<Palette className="w-2.5 h-2.5" /> <Palette className="w-2.5 h-2.5" />
{colorCount} colori {colorCount} colors
</Badge> </Badge>
)} )}
{animCount > 0 && ( {animCount > 0 && (
@@ -491,7 +491,7 @@ export function NitroEditorDialog({
<Compass className="w-4 h-4 text-muted-foreground" /> <Compass className="w-4 h-4 text-muted-foreground" />
<h3 className="text-sm font-medium">Directions</h3> <h3 className="text-sm font-medium">Directions</h3>
<span className="text-xs text-muted-foreground ml-auto"> <span className="text-xs text-muted-foreground ml-auto">
{directions.length} attive {directions.length} active
</span> </span>
</div> </div>
<div className="flex items-center justify-center"> <div className="flex items-center justify-center">
@@ -541,7 +541,7 @@ export function NitroEditorDialog({
<section className="rounded-lg border bg-card p-4"> <section className="rounded-lg border bg-card p-4">
<div className="flex items-center gap-2 mb-3"> <div className="flex items-center gap-2 mb-3">
<Eye className="w-4 h-4 text-muted-foreground" /> <Eye className="w-4 h-4 text-muted-foreground" />
<h3 className="text-sm font-medium">Tipo</h3> <h3 className="text-sm font-medium">Types</h3>
</div> </div>
<div className="grid grid-cols-2 gap-3"> <div className="grid grid-cols-2 gap-3">
<div> <div>
@@ -663,7 +663,7 @@ export function NitroEditorDialog({
<Palette className="w-4 h-4 text-muted-foreground" /> <Palette className="w-4 h-4 text-muted-foreground" />
<h3 className="text-sm font-medium">Colori</h3> <h3 className="text-sm font-medium">Colori</h3>
<Badge variant="secondary" className="text-[10px] ml-auto"> <Badge variant="secondary" className="text-[10px] ml-auto">
{colorCount} varianti {colorCount} colors
</Badge> </Badge>
</div> </div>
<div className="space-y-3"> <div className="space-y-3">
@@ -672,7 +672,7 @@ export function NitroEditorDialog({
<div key={colorId} className="rounded-md border p-3"> <div key={colorId} className="rounded-md border p-3">
<div className="flex items-center gap-2 mb-2"> <div className="flex items-center gap-2 mb-2">
<span className="text-xs font-medium"> <span className="text-xs font-medium">
Variante #{colorId} Color Variant #{colorId}
</span> </span>
{/* Color preview dots */} {/* Color preview dots */}
<div className="flex gap-1 ml-auto"> <div className="flex gap-1 ml-auto">