From e909ff584af0b8b9b168f04a8a623d36a9487e8c Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 9 Mar 2021 19:06:25 +0000 Subject: [PATCH 1/6] Make screens searchable and make routes collapsible --- packages/builder/src/builderStore/index.js | 3 +- .../ComponentNavigationTree/PathTree.svelte | 92 +++++++++++++------ .../ComponentNavigationTree/index.svelte | 2 +- .../FrontendNavigatePane.svelte | 15 ++- 4 files changed, 77 insertions(+), 35 deletions(-) diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index 2e9ec1166c..8b0cde8658 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -2,7 +2,6 @@ import { getFrontendStore } from "./store/frontend" import { getBackendUiStore } from "./store/backend" import { getAutomationStore } from "./store/automation" import { getHostingStore } from "./store/hosting" - import { getThemeStore } from "./store/theme" import { derived, writable } from "svelte/store" import analytics from "analytics" @@ -66,3 +65,5 @@ export const initialise = async () => { console.log(err) } } + +export const screenSearchString = writable(null) diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte index c9e9d27958..9a4b02a4f1 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte @@ -1,8 +1,11 @@ - +{#if !noSearchMatch} + (routeManuallyOpened = !routeManuallyOpened)} + opened={routeOpened} + {border} + withArrow={route.subpaths} /> -{#each Object.entries(route.subpaths) as [url, subpath]} - {#each Object.entries(subpath.screens) as [role, screenId]} - changeScreen(screenId)}> - - - {#if selectedScreen?._id === screenId} - - {/if} - {/each} -{/each} + {#if routeOpened} + {#each filteredScreens as screen (screen.id)} + changeScreen(screen.id)}> + + + {#if selectedScreen?._id === screen.id} + + {/if} + {/each} + {/if} +{/if} diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/index.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/index.svelte index 720b18f8f9..65425a5b9f 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/index.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/index.svelte @@ -56,7 +56,7 @@
- {#each paths as path, idx} + {#each paths as path, idx (path)} 0} {path} route={routes[path]} /> {/each} diff --git a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte index 147f32bb3e..2fcd4ebf1e 100644 --- a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte +++ b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte @@ -1,19 +1,19 @@ {#if !noSearchMatch} (routeManuallyOpened = !routeManuallyOpened)} + on:click={toggleManuallyOpened} opened={routeOpened} {border} withArrow={route.subpaths} /> From 768b03fc8a85a80d18279fb4d6edbc0c178e2df8 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 10 Mar 2021 10:35:49 +0000 Subject: [PATCH 5/6] Don't close folders when selecting a new screen --- .../NavigationPanel/ComponentNavigationTree/PathTree.svelte | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte index ad1b54d700..5f98a2b9ed 100644 --- a/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte +++ b/packages/builder/src/components/design/NavigationPanel/ComponentNavigationTree/PathTree.svelte @@ -37,9 +37,6 @@ const changeScreen = screenId => { store.actions.screens.select(screenId) - - // Reset manually opened flag every time a new screen is selected - routeManuallyOpened = false } const getAllScreens = route => { From 8820edd1bcf342a7fd36588c27e24e5c7c68c84a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 11 Mar 2021 15:53:31 +0000 Subject: [PATCH 6/6] Add clear icon to screen search field --- .../FrontendNavigatePane.svelte | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte index a64bf9f0ee..e235e3b254 100644 --- a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte +++ b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte @@ -85,11 +85,16 @@ {/each} - +
+ + ($screenSearchString = null)} /> +