From 94155f292d131ecf6dda458dc73d7e647077b17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Tue, 14 Jul 2026 00:27:56 +0300 Subject: [PATCH] Add autocomplete typeahead for property and type lookups Replace the long property/type with its sentinel + custom-datatype input and the datatype/lang mutual-exclusion, unchanged. Dead local:vocab-options and local:ontology-label removed from vocab.xsl. Tests: adapted datatype/features/editor/tables suites to drive the typeahead via a shared typeahead-helper.mjs; the features lint test keeps term-unresolvable via the retained datatype free-text input. New tests/browser/typeahead.mjs covers filter, keyboard/mouse select, free-IRI entry, non-IRI rejection, edit-prefill button, and stale-selection invalidation. Co-Authored-By: Claude Fable 5 --- CLAUDE.md | 7 +- rdfa-editor.css | 101 +++++++- src/index.xsl | 4 +- src/overlay.xsl | 78 ++---- src/typeahead.xsl | 382 +++++++++++++++++++++++++++++ src/vocab.xsl | 33 +-- tests/browser/datatype.mjs | 6 +- tests/browser/editor.mjs | 7 +- tests/browser/features.mjs | 14 +- tests/browser/run.mjs | 2 +- tests/browser/tables.mjs | 3 +- tests/browser/typeahead-helper.mjs | 37 +++ tests/browser/typeahead.mjs | 169 +++++++++++++ 13 files changed, 741 insertions(+), 102 deletions(-) create mode 100644 src/typeahead.xsl create mode 100644 tests/browser/typeahead-helper.mjs create mode 100644 tests/browser/typeahead.mjs diff --git a/CLAUDE.md b/CLAUDE.md index c064720..e0b6da5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,8 +24,9 @@ Modules under `src/`: - **index.xsl** — entry point: `$vocab-hrefs` param, `main` template (async vocabulary prefetch via `ixsl:schedule-action/@document`, then overlay init), `local:document-uri()`. - **RDFa2RDFXML-v3.xsl** — RDFa 1.1 → RDF/XML extraction. **Pure XSLT, no `ixsl:`** — it runs headless via `xslt3` for the test suite. Strictly W3C-conformant (RDFa 1.1 processing rules, section 7.5, including chaining via typed resources and `rdfa:usesVocabulary`). Covers `@about`/`@typeof`/`@property`/`@content`/`@datatype`/`@resource`/`@href`/`@src`/`@prefix` (and `xmlns:*`)/`@vocab` with bare terms, `@lang`+`@xml:lang` inheritance, base-URI resolution (`about=""` = the document, `` honored), and exclusion of `head`/`script`/`style`/`[data-role='rendering']` subtrees. Out of scope (documented future work): `@rel`/`@rev`, `@inlist`, safe CURIEs, `@datetime`/`