Skip to content

Fix: stop the importer losing sections and refusing valid configs - #36

Merged
SandObserver merged 1 commit into
mainfrom
fix/import-data-loss-and-dialog-dismissal
Aug 11, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/import-data-loss-and-dialog-dismissal

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Route a sequence element beginning with { or [ through scalar before the key matcher, so a flow collection refuses with its line number instead of parsing into a mapping made from its brace and first key.
  • Refuse an anchor or alias where a node begins rather than testing the whole trimmed line, so * and & inside a value stay text.
  • Derive a compound sequence element's key column from the dash line instead of assuming indent + 2.
  • Refuse a sequence written inside a sequence line, which previously read as the literal string.
  • Decode double-quoted escapes in a key with the same helper a value uses.
  • Chomp block scalars in foldBlock rather than trimming trailing blank lines in scan, so + keeps every trailing newline, and drop the empty string a final newline leaves behind in the row split.
  • Record SKIP.UNREADABLE for a Homepage top-level group that is not a list and for a Dashy section carrying neither items nor widgets.
  • Use a caller-supplied Set of taken ids directly in collector instead of copying it.
  • Attach the trapFocus keydown listener to the document in the capture phase, since the trapped root holds text that cannot take focus.
  • Require both ends of a backdrop click to land on the overlay before dismissing.
  • Release the previous trap when openModal's focus() is armed again.
  • Move the localUrl comment to the branch it describes and drop a subsumed startsWith test, a subsumed tab pattern and an unused depth parameter.

Testing
All green, except the Docker build smoke test, which has no local Docker and is left to CI. Added 11 tests for the modal in a new ui/test/modal.test.mjs, 7 for the parser refusals and block chomping, and 5 for the skips the converters now record.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

The YAML subset refused a flow collection only after a key, so one written
as a sequence element parsed into a mapping built from its brace and first
key, and the section vanished from the import with no skip recorded. The
anchor refusal tested the whole line, including values, so ordinary text
containing * or & refused the file. A sequence element indented with more
than one space after the dash threw on its continuation keys.

The converters passed over a malformed top-level group and a Dashy section
carrying no readable items, both without recording a skip, so a mangled file
imported smaller than it was with nothing in the preview saying why.

The dialog focus trap listened on the dialog element, which cannot hold
focus, so a click on text inside it sent Escape and the Tab wrap to the
document and neither worked. The backdrop dismissed on any click ending on
it, including a text selection released past the edge of the dialog.
@SandObserver SandObserver added the bug Something isn't working label Aug 11, 2026
@SandObserver
SandObserver merged commit 7c26b5d into main Aug 11, 2026
4 checks passed
@SandObserver
SandObserver deleted the fix/import-data-loss-and-dialog-dismissal branch August 11, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant