Hello, if issue #2476is currently unassigned or available, please consider assigning it to me. Hello @prajwalgh, thank's for contributing, I assigned you :) Hello @prajwalgh do you manage to do it or do you need any help ?
Namespace File Editor should keep track of the previously selected namespace if there was one
### Explain the bug

Currently it always select the first namespace available unless we have a default namespace setting set up.
It can be annoying when you try to debug as you may need to reload the page sometimes and it fails to retrieve the previously selected namespace.
I think if we have a RestoreUrl saved for editor it should take it instead of selecting the first namespace.

### Environment Information

- Kestra Version:
- Operating System and Java Version (if not using Kestra Docker image):

ui/src/components/namespace/Editor.vue ui/src/utils/constants.js
ui/src/components/namespace/Editor.vue ui/src/utils/constants.js
diff --git a/ui/src/components/namespace/Editor.vue b/ui/src/components/namespace/Editor.vue
index 6442817617..3863e66645 100644
--- a/ui/src/components/namespace/Editor.vue
+++ b/ui/src/components/namespace/Editor.vue
@@ -41,11 +41,13 @@
     import RestoreUrl from "../../mixins/restoreUrl";
     import {apiUrl} from "override/utils/route";
     import {mapState} from "vuex";
+    import {storageKeys} from "../../utils/constants";
 
     export default {
         mixins: [RouteContext, RestoreUrl],
         methods: {
             namespaceUpdate(namespace) {
+                localStorage.setItem(storageKeys.LATEST_NAMESPACE, namespace);
                 this.$router.push({
                     params: {
                         namespace
@@ -85,7 +87,7 @@
             });
 
             // Setup namespace
-            const namespace = localStorage.getItem("defaultNamespace");
+            const namespace = localStorage.getItem(storageKeys.LATEST_NAMESPACE) ? localStorage.getItem(storageKeys.LATEST_NAMESPACE) : localStorage.getItem(storageKeys.DEFAULT_NAMESPACE);
             if (namespace) {
                 this.namespaceUpdate(namespace);
             } else if (this.namespaces?.length > 0) {
diff --git a/ui/src/utils/constants.js b/ui/src/utils/constants.js
index d7657ef368..2d0cc18b2d 100644
--- a/ui/src/utils/constants.js
+++ b/ui/src/utils/constants.js
@@ -28,7 +28,9 @@ export const storageKeys = {
     DISPLAY_EXECUTIONS_COLUMNS: "displayExecutionsColumns",
     DISPLAY_FLOW_EXECUTIONS_COLUMNS: "displayFlowExecutionsColumns",
     SELECTED_TENANT: "selectedTenant",
-    EXECUTE_FLOW_BEHAVIOUR: "executeFlowBehaviour"
+    EXECUTE_FLOW_BEHAVIOUR: "executeFlowBehaviour",
+    DEFAULT_NAMESPACE: "defaultNamespace",
+    LATEST_NAMESPACE: "latestNamespace"
 }
 
 export const executeFlowBehaviours = {
