Skip to content

feat(lstsv): map appearance horizontal to the bootstrap_buttons question theme - #229

Merged
jstet merged 1 commit into
mainfrom
feat/horizontal-buttons-227
Nov 4, 2026
Merged

jstet merged 1 commit into
mainfrom
feat/horizontal-buttons-227

Conversation

@jstet

@jstet jstet commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Closes #227.

appearance: horizontal and horizontal-compact on a select_one set LimeSurvey's core question theme bootstrap_buttons (Q-row column question_theme_name, type stays L), so a short list renders as a row of buttons. Built on #232's mechanism: both registry entries carry lsQuestionTheme: {"name": "bootstrap_buttons"}; no new schema field or code path for the mapping itself. DDI is unchanged and keeps the appearance.

Two small points beyond the registry entries:

  • Way back: themedAppearanceOf matches both appearances (same theme). It returns the first registered one, so bootstrap_buttons comes back as horizontal; horizontal-compact is registered after it. No extra field was needed; a test pins this.
  • Dropdown wins: themeAttributes now takes the LimeSurvey type and keeps a theme that doesn't override the type (bootstrap_buttons) only on a plain list. Without it minimal horizontal would emit a ! question with the buttons theme.

Not included: columns / columns-n → display_columns; a follow-up.

Before / After

XLSForm Before After
select_one yn + horizontal warning, plain radio list L with question_theme_name=bootstrap_buttons
TSV bootstrap_buttons on L theme ignored appearance: horizontal

Tests

New tests/ts/unit/horizontalButtons.test.ts (6 tests: both appearances, no column when unused, minimal precedence, select_multiple warns, round trip). appearance.test.ts now uses another unsupported appearance. npm test: 1765 passed (108 files); npm run validate clean.

🤖 Generated with Claude Code

…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
jstet force-pushed the feat/horizontal-buttons-227 branch from 09bf158 to 42118de Compare November 4, 2026 18:59
@jstet
jstet marked this pull request as ready for review November 4, 2026 19:01
@jstet
jstet merged commit 967ede9 into main Nov 4, 2026
4 checks passed
@jstet
jstet deleted the feat/horizontal-buttons-227 branch November 4, 2026 19:03
@jstet jstet mentioned this pull request Nov 4, 2026
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.

xlsform2lstsv: map appearance=horizontal to the bootstrap_buttons question theme

1 participant