From 97a86a9fbbd2ebe2b4e686c799009d5b5eaa8c61 Mon Sep 17 00:00:00 2001 From: "Ericson \"Fogo\" Soares" Date: Fri, 6 Oct 2023 17:46:26 -0300 Subject: [PATCH] [ENG-888] Media view should show current folder downward (#1437) * Done but ugly * layout * Now with a select --------- Co-authored-by: ameer2468 <33054370+ameer2468@users.noreply.github.com> --- core/src/api/search.rs | 12 ++++++- core/src/preferences/library.rs | 1 + .../app/$libraryId/Explorer/OptionsPanel.tsx | 33 +++++++++++++++++-- interface/app/$libraryId/Explorer/store.ts | 1 + interface/app/$libraryId/location/$id.tsx | 18 ++++++---- packages/client/src/core.ts | 4 +-- 6 files changed, 57 insertions(+), 12 deletions(-) diff --git a/core/src/api/search.rs b/core/src/api/search.rs index 4f65f4631..a87767cc1 100644 --- a/core/src/api/search.rs +++ b/core/src/api/search.rs @@ -121,6 +121,8 @@ struct FilePathFilterArgs { #[specta(optional)] path: Option, #[specta(optional)] + with_descendants: Option, + #[specta(optional)] object: Option, #[specta(optional)] hidden: Option, @@ -177,7 +179,15 @@ impl FilePathFilterArgs { self.hidden.map(Some).map(hidden::equals), directory_materialized_path_str .map(Some) - .map(materialized_path::equals), + .map(|materialized_path| { + if let Some(true) = self.with_descendants { + materialized_path::starts_with( + materialized_path.unwrap_or_else(|| "/".into()), + ) + } else { + materialized_path::equals(materialized_path) + } + }), self.object.and_then(|obj| { let params = obj.into_params(); diff --git a/core/src/preferences/library.rs b/core/src/preferences/library.rs index 781cfc473..cec510822 100644 --- a/core/src/preferences/library.rs +++ b/core/src/preferences/library.rs @@ -62,6 +62,7 @@ pub struct ExplorerSettings { grid_item_size: Option, media_columns: Option, media_aspect_square: Option, + media_view_with_descendants: Option, open_on_double_click: Option, show_bytes_in_grid_view: Option, col_visibility: Option>, diff --git a/interface/app/$libraryId/Explorer/OptionsPanel.tsx b/interface/app/$libraryId/Explorer/OptionsPanel.tsx index fd086d6c2..dc3035dfd 100644 --- a/interface/app/$libraryId/Explorer/OptionsPanel.tsx +++ b/interface/app/$libraryId/Explorer/OptionsPanel.tsx @@ -121,7 +121,7 @@ export default () => {
Explorer -
+
{ {settings.layoutMode === 'media' && ( { if (typeof value !== 'boolean') return; @@ -171,6 +171,30 @@ export default () => {
+ {settings.layoutMode === 'media' && ( +
+ Media View Context + +
+ )} +
Double click action