Skip to content

test(e2e): drive current modal surfaces and Escape-based cleanup, fixing multi-value and PROMPT-02#187

Merged
chhoumann merged 2 commits into
masterfrom
184-e2e-multi-valuetestts-7-tests-and-audit-modals-prompt-02-fail-pre-existing-promptsuggester-ui-never-renders-in-the-isolated-instance
Jul 11, 2026
Merged

test(e2e): drive current modal surfaces and Escape-based cleanup, fixing multi-value and PROMPT-02#187
chhoumann merged 2 commits into
masterfrom
184-e2e-multi-valuetestts-7-tests-and-audit-modals-prompt-02-fail-pre-existing-promptsuggester-ui-never-renders-in-the-isolated-instance

Conversation

@chhoumann

@chhoumann chhoumann commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Repairs the two failure classes in #184 - and corrects its diagnosis: the prompt/suggester UI renders fine in the headless isolated instance. The failing tests were waiting for modals the product no longer opens.

Root cause. Since #168, editMetaElement routes eligible top-level YAML properties (Auto Properties are intercepted first) to the NativePropertyPrompt (Obsidian's native widgets). The 7 multi-value tests and audit-modals PROMPT-02 were still driving the pre-#168 GenericSuggester + GenericPrompt flow, so their .suggestion-item / .metaEditPromptInput waits timed out with the native modal open - and each stuck modal cascaded modal-count-leak failures into later files. (That the legacy modals render headlessly was already proven green by audit-suggester.test.ts, which clicks real .suggestion-item rows and types into .metaEditPromptInput, and by metaedit-runtime.test.ts's nested-YAML prompt flow; the new inline-Dataview tests below pin it in this suite too.)

What changed:

  • multi-value rewritten for the current surfaces. The Metaedit doesn't edit arrays of tags properly. #94/works great apart from the tags YAML front matter, can we get a list of tags and add multiple tags? #51/comma/cmd: invariants now drive the native prompt's real widget interactions - in-place pill edit (focus pill, Enter, retype, Enter; order preserved), pill add, contenteditable text - with the same exact-YAML assertions as before. The scalar tests additionally pin that neither legacy modal participates. The legacy GenericSuggester+GenericPrompt editor still owns inline Dataview fields, so four new tests pin that surviving surface, including the add-command discrimination (VALUE_SELECTION_PREFIX vs sentinels) that only runs there.
  • PROMPT-02 asserts the native date widget (input[type=date].mod-date inside the native host) instead of the legacy prompt's date input, keeping its original assertions on the surface a user actually gets.
  • Escape-based modal cleanup, centralized and failure-safe. Obsidian 1.13 removed .modal-close-button, silently turning every class-targeted close click into a no-op (same family as test(e2e): survive Obsidian 1.13 settings popout and modal DOM changes quickadd#1523). A shared closeAllModals (harness-exported, in-app) closes via Escape through the keymap scope - running real onClose paths so promises resolve and scopes pop - with app.workspace.activeModal?.close() as lifecycle-aware fallback and a loud diagnostic error instead of DOM removal. It replaces every .modal-close-button click and raw el.remove() teardown across the audit/runtime/auto-properties/bulk/fluid suites, and is wired into the harness's beforeDataRestore, so a FAILED test's leaked modal is unwound before the next test - killing the cascade class at the root.
  • Shared native-prompt drivers. native-properties' in-app helpers moved to tests/e2e/nativePromptHelpers.ts (now also used by multi-value), gaining editPillByText and a suggest-popover guard: typing in a multi-select opens a fuzzy popover whose scope owns Enter, which would commit the highlighted suggestion instead of the literal text (this was live: adding tag "asia" committed "course-flash/writing-obsidian-plugins").
  • Vault-agnostic typing. List/scalar drives pin the key's property type via metadataTypeManager.setType (as native-properties already does), because widget resolution follows vault-wide type memory - in the shared dev vault, authors is typed text by unrelated notes and would mount the text widget.

Verification (Obsidian 1.13.0, isolated instance per AGENTS runbook):

  • Full e2e suite on a fresh instance: 16 files, 106 passed, 1 skipped (documented manual), 0 failed - vs the issue's 94 passed / 8 failed baseline.
  • Failure-safe cleanup proven directly: a temporary test that opened a native prompt and threw left the next test observing modalCount === 0 (temp test removed after verification).
  • pnpm run lint, pnpm run build, pnpm run test (355 unit tests) all green.

No product code touched; no release impact.

Fixes #184

@chhoumann chhoumann marked this pull request as ready for review July 11, 2026 21:46
@chhoumann chhoumann merged commit 1576171 into master Jul 11, 2026
8 checks passed
@chhoumann chhoumann deleted the 184-e2e-multi-valuetestts-7-tests-and-audit-modals-prompt-02-fail-pre-existing-promptsuggester-ui-never-renders-in-the-isolated-instance branch July 11, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E: multi-value.test.ts (7 tests) and audit-modals PROMPT-02 fail pre-existing - prompt/suggester UI never renders in the isolated instance

1 participant