Fix: WidgetConfigDialog scope + reorder race condition

Two bugs in the widget config dialog:

1. Service Overview edit showed main-dashboard widgets. The dialog
   called useWidgetInstances() with no args, fetching ALL widgets. Now
   accepts a serviceId prop; OverviewTab passes instance.id so the
   dialog lists + creates only service-scoped widgets. New built-in
   widgets added from a service Overview inherit the serviceId.

2. Reorder up/down buttons did nothing. moveInstance fired two
   saveWidget mutations via Promise.all — the first mutation's
   onSuccess cache invalidation triggered a refetch before the second
   completed, reverting the swap. Changed to sequential awaits so
   both sort_order writes land before the cache refreshes.

127 tests pass; lint/build green.
This commit is contained in:
Developer
2026-07-06 10:29:24 +00:00
parent 447775048c
commit bfe7ce7367
2 changed files with 10 additions and 7 deletions
@@ -72,6 +72,7 @@ export function OverviewTab({ instance }: { instance: ServiceInstance }) {
<WidgetConfigDialog
open={configOpen}
onClose={() => setConfigOpen(false)}
serviceId={instance.id}
/>
</div>
);