From d45a0fb8b0e95326a0228b139d03d4c59fe1ffba Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Sat, 6 Jun 2026 14:03:59 +0200 Subject: [PATCH] feat(furni-editor): optimistically reflect mirrored public_name on save The server now mirrors the furnidata display name into items_base.public_name, so on updateFurnidata patch selectedItem.publicName immediately; the auto detail re-fetch that follows agrees with the DB value (no flicker). Not applied to revertFurnidata (revert restores the previous DB name). --- src/hooks/furni-editor/useFurniEditor.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/furni-editor/useFurniEditor.ts b/src/hooks/furni-editor/useFurniEditor.ts index 201b735..16e9f0f 100644 --- a/src/hooks/furni-editor/useFurniEditor.ts +++ b/src/hooks/furni-editor/useFurniEditor.ts @@ -249,6 +249,10 @@ export const useFurniEditor = () => const updateFurnidata = useCallback((id: number, name: string, description: string) => { pendingActionRef.current = { action: 'update', itemId: id }; + // Optimistic: the server now mirrors the furnidata display name into + // items_base.public_name, so reflect it immediately in the read-only + // "Public Name" field. The auto re-fetch that follows will agree (no flicker). + setSelectedItem(prev => (prev && prev.id === id ? { ...prev, publicName: name } : prev)); setLoading(true); SendMessageComposer(new FurniEditorUpdateFurnidataComposer(id, JSON.stringify({ name, description }))); }, []);