From a32f80337bef24f07be47da97b862ff7a3e1d1a0 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Sat, 29 Aug 2026 16:28:58 +0300 Subject: [PATCH 1/5] Moves the file explorer styling and layout into the bundled themes --- README.md | 2 +- docs/technical/theming/Theming.md | 60 +- .../Core/Themes/Bundled/editorial-paper.zip | Bin 32274 -> 316687 bytes .../Core/Themes/Bundled/lumina-default.zip | Bin 31741 -> 316150 bytes .../ThemeFileSystemBrowserConfigurationDto.cs | 22 + .../DTO/Themes/ThemeFileSystemBrowserDto.cs | 29 + .../PresentationWebLayerServices.cs | 2 + .../Themes/ThemeFileSystemBrowserBuilder.cs | 105 ++++ .../Themes/ThemeFileSystemBrowserRenderer.cs | 146 +++++ .../FileSystemBrowserViewComponent.cs | 41 +- .../FileSystemBrowser/Default.cshtml | 514 ++---------------- .../FileSystemBrowser/Themed.cshtml | 3 + .../icons/Lyra/android-package-archive.svg | 23 - .../icons/Lyra/application-atom+xml.svg | 11 - .../icons/Lyra/application-certificate.svg | 11 - .../images/icons/Lyra/application-dicom.svg | 11 - .../icons/Lyra/application-epub+zip.svg | 11 - .../icons/Lyra/application-illustrator.svg | 11 - .../images/icons/Lyra/application-image.svg | 238 -------- .../images/icons/Lyra/application-json.svg | 12 - .../icons/Lyra/application-mathml+xml.svg | 21 - .../icons/Lyra/application-msonenote.svg | 11 - .../icons/Lyra/application-msoutlook.svg | 11 - .../Lyra/application-msword-template.svg | 14 - .../icons/Lyra/application-octet-stream.svg | 26 - .../images/icons/Lyra/application-ogg.svg | 13 - .../images/icons/Lyra/application-pdf.svg | 13 - .../icons/Lyra/application-pgp-signature.svg | 17 - .../images/icons/Lyra/application-pgp.svg | 11 - .../icons/Lyra/application-photoshop.svg | 11 - .../icons/Lyra/application-postscript.svg | 11 - .../images/icons/Lyra/application-sql.svg | 16 - .../icons/Lyra/application-vnd.appimage.svg | 11 - .../Lyra/application-vnd.flatpak.ref.svg | 15 - .../icons/Lyra/application-vnd.iccprofile.svg | 14 - ...application-vnd.kde.bluedevil-sendfile.svg | 19 - .../icons/Lyra/application-vnd.ms-access.svg | 9 - .../application-vnd.ms-cab-compressed.svg | 18 - .../icons/Lyra/application-vnd.ms-excel.svg | 14 - .../Lyra/application-vnd.ms-htmlhelp.svg | 15 - .../Lyra/application-vnd.ms-infopath.svg | 11 - .../Lyra/application-vnd.ms-powerpoint.svg | 14 - .../Lyra/application-vnd.ms-publisher.svg | 14 - ...plication-vnd.oasis.opendocument.chart.svg | 15 - ...sis.opendocument.presentation-template.svg | 11 - ...asis.opendocument.spreadsheet-template.svg | 16 - ...n-vnd.oasis.opendocument.text-template.svg | 11 - ...on-vnd.oasis.opendocument.web-template.svg | 11 - .../icons/Lyra/application-vnd.snap.svg | 11 - .../icons/Lyra/application-vnd.visio.svg | 11 - .../icons/Lyra/application-vnd.xdgapp.svg | 17 - .../images/icons/Lyra/application-winhlp.svg | 15 - .../icons/Lyra/application-x-7z-ace.svg | 14 - .../images/icons/Lyra/application-x-addon.svg | 11 - .../wwwroot/images/icons/Lyra/directory.svg | 36 -- .../wwwroot/images/icons/Lyra/drive.svg | 51 -- .../wwwroot/images/icons/Lyra/file.svg | 25 - .../wwwroot/images/ui/back.svg | 34 -- .../wwwroot/images/ui/check.svg | 3 - .../wwwroot/images/ui/favorite-star.svg | 17 - .../wwwroot/images/ui/forward.svg | 22 - .../wwwroot/images/ui/new-directory.svg | 17 - .../wwwroot/images/ui/up.svg | 22 - .../wwwroot/js/file-system-browser-dialog.js | 404 ++++++++------ .../js/theme-client-template-engine.js | 245 +++++++++ ...ileSystemBrowserConfigurationDtoFixture.cs | 52 ++ .../ThemeFileSystemBrowserDtoFixture.cs | 62 +++ .../EditLibraryViewEndpointTests.cs | 67 +++ .../ThemeFileSystemBrowserBuilderTests.cs | 123 +++++ .../ThemeFileSystemBrowserRendererTests.cs | 232 ++++++++ .../Core/Themes/ThemeTemplateEngineTests.cs | 19 + .../FileSystemBrowserViewComponentTests.cs | 104 ++++ 72 files changed, 1577 insertions(+), 1682 deletions(-) create mode 100644 src/Lumina.Presentation.Web/Common/DTO/Themes/ThemeFileSystemBrowserConfigurationDto.cs create mode 100644 src/Lumina.Presentation.Web/Common/DTO/Themes/ThemeFileSystemBrowserDto.cs create mode 100644 src/Lumina.Presentation.Web/Core/Themes/ThemeFileSystemBrowserBuilder.cs create mode 100644 src/Lumina.Presentation.Web/Core/Themes/ThemeFileSystemBrowserRenderer.cs create mode 100644 src/Lumina.Presentation.Web/Core/Views/Shared/Components/FileSystemBrowser/Themed.cshtml delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/android-package-archive.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-atom+xml.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-certificate.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-dicom.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-epub+zip.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-illustrator.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-image.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-json.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-mathml+xml.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-msonenote.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-msoutlook.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-msword-template.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-octet-stream.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-ogg.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-pdf.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-pgp-signature.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-pgp.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-photoshop.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-postscript.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-sql.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.appimage.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.flatpak.ref.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.iccprofile.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.kde.bluedevil-sendfile.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.ms-access.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.ms-cab-compressed.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.ms-excel.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.ms-htmlhelp.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.ms-infopath.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.ms-powerpoint.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.ms-publisher.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.oasis.opendocument.chart.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.oasis.opendocument.presentation-template.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.oasis.opendocument.spreadsheet-template.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.oasis.opendocument.text-template.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.oasis.opendocument.web-template.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.snap.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.visio.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-vnd.xdgapp.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-winhlp.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-x-7z-ace.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/application-x-addon.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/directory.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/drive.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/icons/Lyra/file.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/ui/back.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/ui/check.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/ui/favorite-star.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/ui/forward.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/ui/new-directory.svg delete mode 100644 src/Lumina.Presentation.Web/wwwroot/images/ui/up.svg create mode 100644 src/Lumina.Presentation.Web/wwwroot/js/theme-client-template-engine.js create mode 100644 tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Themes/ThemeFileSystemBrowserConfigurationDtoFixture.cs create mode 100644 tests/Common/Lumina.Presentation.Web.Fixtures/Common/DTO/Themes/ThemeFileSystemBrowserDtoFixture.cs create mode 100644 tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Themes/ThemeFileSystemBrowserBuilderTests.cs create mode 100644 tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/Themes/ThemeFileSystemBrowserRendererTests.cs create mode 100644 tests/UnitTests/Lumina.Presentation.Web.UnitTests/Core/ViewComponents/FileSystemBrowserViewComponentTests.cs diff --git a/README.md b/README.md index 34f826e7..2bf76a5b 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ To explore more about Enlightenment and their contributions to the open-source c ### Icons -Most icons were taken from [Lyra Icon Theme](https://github.com/yeyushengfan258/Lyra-icon-theme/tree/master/src), a beautiful icon theme for Linux desktops. +Most icons were taken from [Lyra Icon Theme](https://github.com/yeyushengfan258/Lyra-icon-theme/tree/master/src), a beautiful icon theme for Linux desktops. They ship as part of some of the bundled themes, in the `assets/images/icons/` directory of the theme pack. Several icons used in this project were adapted from icons sourced from [svgrepo](https://www.svgrepo.com/). diff --git a/docs/technical/theming/Theming.md b/docs/technical/theming/Theming.md index eb45aaae..9878a66d 100644 --- a/docs/technical/theming/Theming.md +++ b/docs/technical/theming/Theming.md @@ -162,6 +162,10 @@ Known page keys: | `shared/nav-menu` | The navigation menu of the theme. | | `shared/not-found` | The 404 page. | | `library/written-content-library/book-library/books/index` | The books browsing page. | +| `shared/file-system-browser` | The file system browser component shell. | +| `shared/file-system-browser/tree-node` | The tree view node of the file system browser. | +| `shared/file-system-browser/explorer-item` | The file system entry of the file system browser. | +| `shared/file-system-browser/path-segment` | The address bar path segment of the file system browser. | ### The Layout Template (shared/layout) @@ -229,6 +233,60 @@ The navigation template renders the menu of the active theme. Its model contains The navigation template is also best effort: when its template cannot be rendered, the application menu is used instead. +### The File System Browser Templates (shared/file-system-browser) + +The file system browser is a modal component hosted by the library editing page. Like the navigation menu, it is rendered from theme templates and is best effort: when its component template cannot be loaded, the application renders its own unstyled fallback. + +The component is split into a shell template and three sub templates, all provided as mirrored files under `templates/shared/file-system-browser/`. Because the sub template page keys live under the shell page key, the engine would resolve a missing sub template to the shell template by walking up the path scopes; the application detects this fallback and treats it as a missing sub template, so a theme can omit any sub template and keep the built-in rendering of that part. + +The shell template receives a model with the following fields: + +| Field | Content | +| --- | --- | +| `appBase` | The absolute base URL of the Web application, used to reference the application scripts, for example `{{appBase}}js/file-system-browser-dialog.js`. | +| `assetBase` | The base URL of the theme assets. | +| `iconBaseUrl` | The base URL of the file type icons of the theme, derived from `assetBase`. | +| `fileIconsUrl` | The URL of the file icons mapping of the theme, derived from `assetBase`. | +| `treeNodeTemplate` | The raw source of the `shared/file-system-browser/tree-node` template, inlined by the application into a `