Repository navigation
feat(lstsv): map appearance columns-n to display_columns - #243
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #239.
columns-n(and plaincolumns) onselect_one/select_multiplenow becomes LimeSurvey'sdisplay_columnsquestion attribute on L and M questions, so a long option list is laid out in n columns. The way back readsdisplay_columns=nascolumns-n.Design:
src/conventions/displayColumns.ts, which the appearance handler, the validator and the reverse path share.display_columnsis added toATTRIBUTE_COLUMNS.questionHelper.php, inputtypecolumns, default 1) states no maximum; 8 is the largest count its column selector offers and the renderer just adds the classnbcol-n. Anything else (columns-0,columns-9) warns with the new codeappearance-invalid-columnsand writes nothing.columns-xstaysappearance-unregistered.columnsmeans "as many as fit" in ODK, which LimeSurvey cannot do, so it becomes 2 (and reads back ascolumns-2).horizontal(the button theme is dropped, as a dropdown appearance already wins over it). A dropdown (minimal,autocomplete) has no columns: none is written. On other typescolumns-nwarnsappearance-invalid-for-type.nbcol-nat phone width (no LimeSurvey instance used).Before / After:
columns-2warnedappearance-unregisteredand was ignored.columns-2on a select givesdisplay_columns=2; the TSV round-trips tocolumns-2.Tests: new
tests/ts/unit/displayColumns.test.ts(17: mapping for one/multiple/plain/n=8, no column when unused, invalid n, wrong type, horizontal precedence, dropdown, round trips) and aappearance-invalid-columnscase indiagnosticCodes.test.ts.npm test: 1791 passed (109 files);npm run validatepasses.🤖 Generated with Claude Code