This is an automated email from the ASF dual-hosted git repository.
wu-sheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-horizon-ui.git
The following commit(s) were added to refs/heads/main by this push:
new f2a01b1 ui dashboards: stop clearing URL ?instance= on landing's null
→ name transition
f2a01b1 is described below
commit f2a01b11b6f401fc31b87abdf95258bc80785ba5
Author: Wu Sheng <[email protected]>
AuthorDate: Sun May 17 19:47:55 2026 +0800
ui dashboards: stop clearing URL ?instance= on landing's null → name
transition
Root cause of the "wrong-id auto-pick is slow / never works" symptom:
watch(serviceName, (next, prev) => {
if (prev !== undefined && next !== prev && selectedInstance.value) {
setSelectedInstance(null); // ← BUG
}
});
`prev !== undefined` is true for `prev === null`, so when landing
finally resolved `serviceName` from `null → "agent::rating"` the
watch fired and called `setSelectedInstance(null)` — stripping the
operator's URL `?instance=` BEFORE the auto-pick / fallback watch
could even read it. That meant:
- The fallback event never fired (selectedInstance was null when
the instance list arrived, so we hit the silent-default path).
- The dashboard query had to wait for the next instance auto-pick
cycle to re-stamp `?instance=`, on top of the BFF latency the
operator was already paying.
The watch's INTENT was: drop the stale instance when the operator
clicks a different SERVICE in the picker (old service's instance
won't exist on the new one). The `null → name` transition isn't a
service change, it's landing resolution finishing — must not trigger
the clear.
Fix: gate on both ends being real names (`if (!prev || !next) return;`).
Same fix applied to the endpoint counterpart.
---
.../render/layer-dashboard/LayerDashboardsView.vue | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue
b/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue
index 13e9379..0a1727c 100644
--- a/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue
+++ b/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue
@@ -159,10 +159,17 @@ watch(landingRows, (rows) => {
setSelectedService(first.serviceId);
}
}, { immediate: true });
-// Drop the stale instance whenever the service changes — the new
-// service's instance list almost never matches the previous pick.
+// Drop the stale instance whenever the service ACTUALLY changes —
+// the new service's instance list almost never matches the previous
+// pick. The transition `null → "service-name"` (initial landing
+// resolution) is NOT a service change and must not clear the URL
+// `?instance=` — doing so blew away the operator's URL pick before
+// the auto-pick / fallback path could even read it, and the dashboard
+// query then waited for the next instance list + auto-pick cycle.
+// Only fire when both ends of the transition are real service names.
watch(serviceName, (next, prev) => {
- if (prev !== undefined && next !== prev && selectedInstance.value) {
+ if (!prev || !next) return;
+ if (next !== prev && selectedInstance.value) {
setSelectedInstance(null);
}
});
@@ -264,9 +271,12 @@ watchEffect(() => {
setSelectedEndpoint(list[0].name);
}
});
-// Drop stale endpoint when service changes.
+// Drop stale endpoint when service ACTUALLY changes — same rule as
+// the instance counterpart above: the `null → name` landing-resolution
+// transition must not clear the URL `?endpoint=`.
watch(serviceName, (next, prev) => {
- if (prev !== undefined && next !== prev && selectedEndpoint.value) {
+ if (!prev || !next) return;
+ if (next !== prev && selectedEndpoint.value) {
setSelectedEndpoint(null);
}
});