Skip to content

Add rich content support and interactive decision points to SelectionListNode#96

Merged
Aaronontheweb merged 3 commits intodevfrom
feature/inline-selection-list-layout
Dec 18, 2025
Merged

Add rich content support and interactive decision points to SelectionListNode#96
Aaronontheweb merged 3 commits intodevfrom
feature/inline-selection-list-layout

Conversation

@Aaronontheweb
Copy link
Owner

Summary

  • Adds SelectionItemContent class for multi-line, styled selection items with support for ITextSegment (static and animated)
  • Adds "Something else..." option with inline text input for custom user responses
  • Implements interactive decision points in the streaming chat demo
  • Fixes inline layout positioning for dynamic content

Closes #92

Changes

Core Library (src/Termina)

  • SelectionItemContent: New class for building rich, multi-line selection item content with styled segments
  • CompositeTextSegment: Combines multiple ITextSegment instances into a single segment
  • SelectionListNode:
    • New constructor accepting Func<T, SelectionItemContent> for rich content
    • WithOtherOption() method for adding custom input option
    • OtherSelected observable for custom input submissions
    • Sub-context rendering fix for proper coordinate translation
  • SelectionItem: Extended to support SelectionItemContent and "Other" item type

Demo (demos/Termina.Demo.Streaming)

  • LlmSimulatorActor: Simulates decision points with choices
  • StreamingChatPage: Handles decision list display inline between chat history and input
  • StreamingChatViewModel: Manages decision point state and user responses

Tests

  • 35 tests for SelectionListNode (all passing)
  • Tests for SelectionItemContent and CompositeTextSegment

Test plan

  • All 673 tests pass
  • Demo shows decision list inline without clearing other UI
  • Selection via arrow keys and Enter works
  • Quick selection via number keys (1-9) works
  • "Something else..." option opens inline text input
  • Custom input submission triggers follow-up response
  • Escape cancels decision and continues

…ListNode

- Add SelectionItemContent class for multi-line, styled selection items
- Support ITextSegment (static and animated) in selection item content
- Add "Other" option with inline text input for custom user responses
- Implement decision points in streaming chat demo with LLM simulation
- Fix inline layout positioning with HeightAuto() for dynamic content

The SelectionListNode now supports:
- Multi-line items with per-line styling
- Animated segments (spinners, etc.) within items
- "Something else..." option that opens inline text input
- Proper coordinate translation via sub-context rendering

Demo changes showcase interactive decision points where the LLM
presents choices and the user can select or provide custom input.
Add documentation for new features introduced in this branch:
- Rich content section with SelectionItemContent examples
- Multi-line items with animated segments (spinners)
- CompositeTextSegment usage examples
- Constructors section in API reference
- SelectionItemContent properties and methods tables
- Updated SelectionItem properties (Content, LineCount)
- Source code details for new classes
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) December 18, 2025 00:35
@Aaronontheweb Aaronontheweb merged commit 9c92e83 into dev Dec 18, 2025
7 checks passed
@Aaronontheweb Aaronontheweb deleted the feature/inline-selection-list-layout branch December 18, 2025 00:39
@Aaronontheweb Aaronontheweb mentioned this pull request Dec 18, 2025
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.

Feature Request: Support rich text/colored segments in SelectionListNode items

1 participant