From 40ddf4e6c733512a44b5ae0fc6065d0c4216e507 Mon Sep 17 00:00:00 2001 From: SandObserver <260779319+SandObserver@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:25:00 -0400 Subject: [PATCH] Fix: read the YAML layouts real dashboard configs use Three constructs refused a whole file, and between them they blocked most real configs, including the default one Dashy ships. A sequence written level with the key it belongs to is now read as that key's value. Only a sequence may do this; a mapping at the same column is the next key of the same parent. This is the common way of writing YAML and it also covers a Homepage group nested by two spaces. A block scalar is folded or kept literally, with chomping. Its body is consumed while scanning, so a list dash, a comment marker or a tab inside it is text rather than structure. Long API keys and icon URLs are wrapped this way. An empty flow collection reads as an empty list or mapping. One with contents still refuses, which is where parsing it would start to guess. Checked against js-yaml on fourteen real files: every one that both accept parses identically. --- CHANGELOG.md | 4 + ui/admin/index.html | 2 +- ui/js/admin.js | 2 +- ui/js/yaml-lite.js | 122 ++++++++++++++++++++---- ui/test/fixtures/dashy-flush-layout.yml | 29 ++++++ ui/test/import-fixtures.test.mjs | 26 +++++ ui/test/yaml-lite.test.mjs | 70 +++++++++++++- 7 files changed, 230 insertions(+), 25 deletions(-) create mode 100644 ui/test/fixtures/dashy-flush-layout.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 4428c521..95e16517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Importing from another dashboard reads a list written level with its key, a + value folded across lines, and an empty `[]` or `{}`, each of which used to + refuse the whole file. + - Confirming an import and naming a new folder use in-page dialogs instead of the browser's own. diff --git a/ui/admin/index.html b/ui/admin/index.html index 7b9b0f15..052c532d 100644 --- a/ui/admin/index.html +++ b/ui/admin/index.html @@ -285,6 +285,6 @@