Skip to content

Conversation

@EyalAmitay
Copy link

@EyalAmitay EyalAmitay commented Jan 20, 2026

Add optional StarterCategory support to group starters visually in the UI. Categories appear as clickable buttons with optional icons, revealing their starters when selected.

image

Usage

@cl.set_starter_categories
async def starter_categories(user):
    return [
        cl.StarterCategory(
            label="Creative",
            icon="https://example.com/creative.png",  # optional
            starters=[
                cl.Starter(label="Write a poem", message="Write a poem"),
                cl.Starter(label="Write a story", message="Write a story"),
            ],
        ),
        cl.StarterCategory(
            label="Educational",
            starters=[
                cl.Starter(label="Explain", message="Explain quantum computing"),
            ],
        ),
    ]

Changes

  • Backend: Added StarterCategory dataclass with label, icon (optional), and starters list
  • Backend: Added @set_starter_categories callback decorator
  • TypeScript: Added IStarterCategory interface in react-client
  • Frontend: Added StarterCategory component, updated Starters.tsx to render category buttons
  • Tests: Added backend unit test and Cypress E2E tests

Backward Compatibility

Fully backward compatible - existing @set_starters callbacks work unchanged and render flat starters as before. The starterCategories feature is additive and independent. When both defined, starterCategories will take precedence.

Test plan

  • Backend UTs pass
  • Cypress E2Es pass
  • Verified behavior locally
Screen.Recording.2026-01-20.at.2.17.42.PM.mov

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. backend Pertains to the Python backend. frontend Pertains to the frontend. labels Jan 20, 2026
@EyalAmitay EyalAmitay marked this pull request as draft January 20, 2026 09:53
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Add optional StarterCategory support to group starters visually in the UI.
Categories appear as clickable buttons with optional icons, revealing their
starters when selected.

- Add StarterCategory dataclass with label, icon, and starters list
- Add @set_starter_categories callback decorator
- Update frontend to render category buttons when categories are defined
- Maintain backward compatibility with existing flat starters
@EyalAmitay EyalAmitay changed the title feat: Add optional category field to starters for grouping feat: Add starter categories for grouped starters Jan 20, 2026
@EyalAmitay EyalAmitay marked this pull request as ready for review January 20, 2026 12:18
@dosubot dosubot bot added the enhancement New feature or request label Jan 20, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 12 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Pertains to the Python backend. enhancement New feature or request frontend Pertains to the frontend. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant