Repository navigation
feat(lstsv): appearance=autocomplete → searchable bootstrap_dropdown (#226) - #232
Merged
Merged
Conversation
…226) An appearance can now select a LimeSurvey question theme through a new registry Appearance field, lsQuestionTheme {name, attributes?}: the name goes to the Q row's question_theme_name, each attribute to a column of its own. autocomplete on select_one / select_one_from_file becomes `!` + question_theme_name=bootstrap_dropdown + show_search=true, LimeSurvey's core searchable dropdown; minimal stays a plain `!`. The way back reads a Q row whose theme and attributes match as that appearance (show_search `1` or `true`); `!` without the theme stays minimal. This replaces the lsReverse flag. The convention text no longer says LimeSurvey has no built-in search, and the cdlvocab- cssclass is described as provenance only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jstet
marked this pull request as ready for review
November 4, 2026 18:53
jstet
force-pushed
the
feat/searchable-dropdown-226
branch
from
November 4, 2026 18:53
819ac4a to
db98b66
Compare
jstet
added a commit
that referenced
this pull request
Nov 4, 2026
…ion theme (#227) horizontal and horizontal-compact on select_one use the registry's lsQuestionTheme (#232): question_theme_name=bootstrap_buttons. The way back reads the first registered appearance of a theme, horizontal. A theme that doesn't override the type is kept only on a plain list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jstet
added a commit
that referenced
this pull request
Nov 4, 2026
…ion theme (#227) (#229) horizontal and horizontal-compact on select_one use the registry's lsQuestionTheme (#232): question_theme_name=bootstrap_buttons. The way back reads the first registered appearance of a theme, horizontal. A theme that doesn't override the type is kept only on a plain list. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
Merged
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.
Closes #226.
appearance=autocompleteon aselect_one/select_one_from_fileused to become a plain LimeSurvey dropdown (!). On a long list (12,000 Kommunen) the native select only jumps by first letter. LimeSurvey 5+ ships the core question themebootstrap_dropdownfor type!, and itsshow_searchattribute adds a search box. The TSV import sets the theme fromquestion_theme_nameand stores the other extra columns as question attributes, so no plugin is needed.Mechanism. A new registry Appearance field,
lsQuestionTheme: {name, attributes?}(schema, codegen →APPEARANCES[*].lsQuestionTheme):AppearanceHandler.themeAttributes()writesquestion_theme_name = nameplus each attribute as a Q-row column, wherevalidForTypesallows it. It applies together withlsTypeOverride.themedAppearanceOf()(newsrc/conventions/questionTheme.ts, shared with the reverse type resolver) reads a Q row back as the appearance whose theme and attributes match, and whose type matcheslsTypeOverrideif one is set.show_searchcounts as matching when it istrueor1. A!row without that theme, or withbootstrap_dropdownbut noshow_search, staysminimal. This replaces thelsReverse: falseflag, which is removed.question_theme_nameandshow_searchare added toATTRIBUTE_COLUMNS. As before, they are written only when a row sets them. A test checks that every theme column the registry names is a TSV column.#227 should reuse this mechanism:
appearance:horizontalonly needs"lsQuestionTheme": {"name": "bootstrap_buttons"}(plus any attributes, added toATTRIBUTE_COLUMNS). The forward path, the reverse path and the column check work without code changes. An appearance with a theme and nolsTypeOverridereads back on the base type, if that type is invalidForTypes.minimalstays a plain!. The externalCodeList convention, theautocompletelsEffect, the README and the lstsv2xlsform reverse table no longer say that LimeSurvey has no built-in search. Thecdlvocab-<vocab>cssclass is now described as provenance only, not as a theme hook. DDI is unaffected: the appearance still goes out ascdl:appearance(autocomplete), and lstsv2ddi now reads it back asautocompleteinstead ofminimal.Before (
select_one land,appearance: autocomplete):After:
Tests
tests/ts/unit/questionTheme.test.ts(14 tests):select_oneandselect_one_from_file:autocompletewrites the theme,minimalwrites no theme columns,minimal autocompletewrites the theme, andautocompleteontextwrites no theme.validateLstsvSubsetaccepts the TSV.autocompletestaysautocomplete(both types) andminimalstaysminimal.bootstrap_dropdownwithoutshow_searchreads asminimal,show_search=1reads asautocomplete, and another theme reads asminimal.autocomplete.longFileList.test.ts: the way back now readsautocompleteandminimaleach as itself.question_theme_nameandshow_search.test_long_file_list_dropdown_with_derived_codes: after import, LimeSurvey reportsquestion_theme_name=bootstrap_dropdownand the attributeshow_search=true. It was run against the compose stack (LimeSurvey 6.16.4) and passes.npm test: 104 files and 1712 tests pass.npm run validate(lint, types, format, knip, dup, arch, markdownlint) is clean.uv run pytest(non-docker): 76 passed.🤖 Generated with Claude Code