Skip to content

Implement SetHighlightedFunc (#6) - #20

Merged
cassdeckard merged 3 commits into
mainfrom
fix/6
Mar 2, 2026
Merged

Implement SetHighlightedFunc (#6)#20
cassdeckard merged 3 commits into
mainfrom
fix/6

Conversation

@cassdeckard

Copy link
Copy Markdown
Owner

Summary

Implements #6 SetHighlightedFunc for TextView with region support.

Changes

  • Config: Add onHighlighted field to Primitive for TextView with regions: true
  • Builder: Wire SetHighlightedFunc in PropertyMapper; sets __highlightedRegion before running the template callback
  • Builtin: Add showHighlightedNotification to display the selected region number
  • Example: Extend textview.yaml with onHighlighted demo and status display
  • Docs: Document onHighlighted and __highlightedRegion in tview-coverage.md
  • Tests: Add TestApplyTextViewProperties_OnHighlighted and TestBuildFlex_TextViewWithOnHighlighted

Usage

primitive:
  type: textView
  regions: true
  text: '["slide1"]Slide 1[""] ["slide2"]Slide 2[""]'
  onHighlighted: '{{ switchToPage "{{ bindState __highlightedRegion }}" }}'

Enables presentation-style info bar navigation where clicking/selecting a region switches pages.

@github-actions

github-actions Bot commented Mar 2, 2026

Copy link
Copy Markdown

Test Results

245 tests  +2   245 ✅ +2   0s ⏱️ ±0s
  5 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 0e1bb30. ± Comparison against base commit d06bc34.

♻️ This comment has been updated with latest results.

@cassdeckard
cassdeckard merged commit d0cc00f into main Mar 2, 2026
2 checks passed
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