Skip to content

Carousel config with age-appropriate starting index - #619

Merged
hardbyte merged 3 commits into
mainfrom
feat/carousel-reading-level
Apr 2, 2026
Merged

Carousel config with age-appropriate starting index#619
hardbyte merged 3 commits into
mainfrom
feat/carousel-reading-level

Conversation

@hardbyte

@hardbyte hardbyte commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #618. Adds carousel_config support so the reading level carousel starts at an age-appropriate book:

  • Age 5: Spot the Dog
  • Age 6-7: Cat in the Hat
  • Age 8-9: The 13-Storey Treehouse
  • Age 10-11: Charlie and the Chocolate Factory
  • Age 12-13: Harry Potter

Changes

  • chat_runtime.py: Pass carousel_config through _build_input_request, resolve template variables, store carousel options in _current_options
  • huey-profile-flow.json: Add set_reading_start action node using CEL ternary expression, add author names to option descriptions, update question text

Test plan

  • Unit tests pass (449/449)
  • API returns correct default_index for all ages (verified programmatically)
  • Frontend starts carousel at correct position (verified with Playwright)
  • Selection still stores full option object with ability_key

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e220cf3afc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +436 to +439
resolved = self.runtime.substitute_variables(val, session_state)
try:
resolved_config[key] = int(resolved)
except (ValueError, TypeError):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve typed carousel config values during substitution

The new carousel_config resolver uses substitute_variables, which always returns strings, and then only coerces integers; this means templated non-integer values (for example show_navigation: "{{temp.show_navigation}}") are emitted as string values like "True"/"False" instead of booleans. That breaks type fidelity for carousel settings and can cause clients to apply incorrect behavior when they expect native JSON types. Prefer substitute_object (or equivalent type-aware substitution) for each config value so booleans/lists/dicts remain correctly typed.

Useful? React with 👍 / 👎.

hardbyte added 3 commits April 3, 2026 12:39
Add carousel to the input types that match user responses against full
option objects and use option-index routing. Without this, carousel
selections were stored as raw strings instead of the full option object,
breaking downstream variable access like ability_key.
- Pass carousel_config through _build_input_request to frontend
- Resolve template variables in carousel_config (e.g. default_index)
- Store carousel options in _current_options for option matching
- Flow fixture: add set_reading_start action using CEL ternary to map
  age ranges to starting book indices
- Add author names to reading level option descriptions
Match the Landbot flow's age bounds to capture kids outside the 5-13
range.
@hardbyte
hardbyte force-pushed the feat/carousel-reading-level branch from 91576b6 to f81ca4a Compare April 2, 2026 23:39
@hardbyte
hardbyte merged commit c8087cf into main Apr 2, 2026
11 checks passed
@hardbyte
hardbyte deleted the feat/carousel-reading-level branch April 2, 2026 23:43
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.

1 participant