Use the browsable schema picker in the layout creator#956
Draft
JeroenDeDauw wants to merge 9 commits into
Draft
Conversation
Add a SchemaSummary type and getSchemaSummaries( offset, limit ) to the SchemaLookup port, with REST (GET /neowiki/v0/schemas) and in-memory implementations — reusing the endpoint the Schemas page already uses, no new backend. A cached, paginated getAllSchemaSummaries() store action loads every schema once (cleared on save) for the schema picker to filter client-side. SchemasPage reuses the shared SchemaSummary type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rebuild SchemaLookup on CdxCombobox so the field opens the full schema list on click (empty or filled) and filters as you type, with descriptions shown throughout. Only an exact existing schema is committed; unmatched text reverts to the committed value on blur, so the field never holds an invalid value. Reword the now-shared placeholder to "Select a schema" under a neutral neowiki-schema-lookup-placeholder key, stretch the field to full width, and register CdxCombobox. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Clearing the relation type now updates the model instead of silently keeping the previous value; the property name is used only as the on-create default. The target-schema required error shows only after the field has been touched (visited and left empty) rather than immediately on a newly added relation property. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-ups from the #953 review: - Page getAllSchemaSummaries by request offset instead of loaded count. The summaries endpoint counts every Schema page in totalRows but omits ones it cannot load (restricted/malformed), so advancing the offset by the loaded count re-requested earlier names and duplicated entries in the cached picker list. - Handle a failed schema load in SchemaLookup's onMounted instead of leaving an unhandled rejection and a silently empty picker. - Commit the canonical schema name from the picker rather than the raw combobox text, so input with surrounding whitespace cannot store a target schema that does not resolve. - Simplify the picker's menu state to a computed over a query ref, removing the imperative showAllSchemas/toMenuItems bookkeeping, and drop the now-unused searchAndFetchMissingSchemas store action. - Drop the SchemaLookup clear test that drove an event the real component never emits; add coverage for the canonical-name commit, the no-op re-emit, the load-failure path, and offset pagination. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A Schema could be saved with a relation-type property whose relation
(edge label) or targetSchema was empty or whitespace-only: the save-time
JSON Schema used additionalProperties:true and never constrained those
fields. An empty relation type then crashed Neo4j projection when a
Subject populated the relation, via Cypher::escape('') throwing — for a
user who need not be the one who saved the schema. An empty targetSchema
was only caught at read time by SchemaName('').
Add an if/then to schemaContentSchema.json: when a property definition's
type is "relation", relation and targetSchema are required and must
contain a non-whitespace character. This rejects the invalid schema at
save time through the existing SchemaContentValidator, the same path
that already rejects an empty type, rather than corrupting on read.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes #955 The layout creator selected the Layout's Schema with a plain CdxSelect fed by a separate getSchemaNames('') call (names only, no descriptions, no type-to-filter). Replace it with the shared SchemaLookup component, which browses the full schema list, filters as you type, shows schema descriptions, and reuses the cached all-schemas summary load — matching the subject creator and relation-property pickers. onSchemaSelected now receives the picked schema name (SchemaLookup only commits an exact existing schema), and the dead getSchemaNames load and its now-orphaned placeholder message are removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Vue picker component shared its name with the unrelated SchemaLookup data-access interface (application/SchemaLookup.ts) — public-api.ts even re-exported both under the name SchemaLookup (one as a type, one as a value). Rename the component, its placeholder message, and its CSS class to SchemaPicker so the UI picker and the data-access lookup are clearly distinct. The data interface keeps the SchemaLookup name, paired with SchemaRepository. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follows the SchemaLookup-to-SchemaPicker component rename merged from the base branch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #955
Stacked on #953 (the
SchemaPickerbrowsable picker) — this PR targets that branch, so its diff is just the layout-creator change. Merge #953 first; GitHub retargets this tomasterafterwards.The layout creator selected the Layout's Schema with a plain
CdxSelectfed by a separategetSchemaNames( '' )call (names only, no descriptions, no type-to-filter). Replace it with the sharedSchemaPickercomponent, which browses the full schema list, filters as you type, shows schema descriptions, and reuses the cached all-schemas summary load — matching the subject creator and relation-property pickers.onSchemaSelectednow receives the picked schema name (SchemaPickeronly commits an exact existing schema), and the deadgetSchemaNamesload and its now-orphaned placeholder message are removed.LayoutCreatorhas no unit test to extend, so correctness here rests onSchemaPicker's own coverage plus a browser check of the Layout creation dialog (open Special:Layouts → Create Layout).make tsciis green (1060 tests, build + lint).