Feature: TUI Actor Thought Block
  Scenarios exercising the ThoughtBlock domain model and ThoughtBlockWidget.

  # ── Domain model: ThoughtBlock ──────────────────────────────────────

  Scenario: Create a thought block with content
    When I create a thought block with content "I need to analyze the code."
    Then the thought block content should be "I need to analyze the code."
    And the thought block max_lines should be 10
    And the thought block should be collapsed by default

  Scenario: Create a thought block with custom max_lines
    When I create a thought block with content "short" and max_lines 5
    Then the thought block max_lines should be 5

  Scenario: Thought block with content under max_lines is not truncated
    When I create a thought block with 5 lines of content
    Then the thought block should not be truncated
    And the thought block visible lines count should be 5

  Scenario: Thought block with content over max_lines is truncated when collapsed
    When I create a thought block with 15 lines of content
    Then the thought block should be truncated
    And the thought block visible lines count should be 10
    And the thought block hidden line count should be 5

  Scenario: Expand a thought block shows all lines
    When I create a thought block with 15 lines of content
    And I expand the thought block
    Then the thought block should not be truncated
    And the thought block visible lines count should be 15
    And the thought block should be expanded

  Scenario: Collapse a thought block hides excess lines
    When I create a thought block with 15 lines of content
    And I expand the thought block
    And I collapse the thought block
    Then the thought block should be truncated
    And the thought block visible lines count should be 10
    And the thought block should be collapsed

  Scenario: Toggle expands a collapsed thought block
    When I create a thought block with 15 lines of content
    And I toggle the thought block
    Then the thought block should be expanded

  Scenario: Toggle collapses an expanded thought block
    When I create a thought block with 15 lines of content
    And I expand the thought block
    And I toggle the thought block
    Then the thought block should be collapsed

  Scenario: Rendered text includes truncation indicator when collapsed
    When I create a thought block with 15 lines of content
    Then the thought block rendered text should contain "space to expand"

  Scenario: Rendered text does not include truncation indicator when expanded
    When I create a thought block with 15 lines of content
    And I expand the thought block
    Then the thought block rendered text should not contain "space to expand"

  Scenario: Empty thought block handling
    When I create a thought block with empty content
    Then the thought block lines count should be 0
    And the thought block should not be truncated
    And the thought block rendered text should be empty

  Scenario: Thought block with exactly max_lines is not truncated
    When I create a thought block with exactly 10 lines of content
    Then the thought block should not be truncated
    And the thought block visible lines count should be 10

  # ── Widget: ThoughtBlockWidget ───────────────────────────────────────

  Scenario: ThoughtBlockWidget wraps a thought block domain model
    When I create a thought block widget with content "Actor is reasoning."
    Then the widget thought content should be "Actor is reasoning."
    And the widget should be collapsed

  Scenario: ThoughtBlockWidget displays collapsed indicator when collapsed
    When I create a thought block widget with 15 lines of content
    Then the widget display text should contain "▶"

  Scenario: ThoughtBlockWidget displays expanded indicator when expanded
    When I create a thought block widget with 15 lines of content
    And I toggle the thought block widget
    Then the widget display text should contain "▼"

  Scenario: ThoughtBlockWidget toggle expands the widget
    When I create a thought block widget with 15 lines of content
    And I toggle the thought block widget
    Then the widget should be expanded

  Scenario: ThoughtBlockWidget toggle collapses an expanded widget
    When I create a thought block widget with 15 lines of content
    And I toggle the thought block widget
    And I toggle the thought block widget
    Then the widget should be collapsed

  Scenario: ThoughtBlockWidget expand method expands the widget
    When I create a thought block widget with 15 lines of content
    And I expand the thought block widget
    Then the widget should be expanded

  Scenario: ThoughtBlockWidget collapse method collapses the widget
    When I create a thought block widget with 15 lines of content
    And I expand the thought block widget
    And I collapse the thought block widget
    Then the widget should be collapsed

  Scenario: ThoughtBlockWidget muted CSS class is applied
    When I create a thought block widget with content "test"
    Then the widget CSS classes should contain "thought-block"

  Scenario: ThoughtBlockWidget collapsed CSS class is applied when collapsed
    When I create a thought block widget with content "test"
    Then the widget CSS classes should contain "thought-block--collapsed"

  Scenario: ThoughtBlockWidget expanded CSS class is applied when expanded
    When I create a thought block widget with 15 lines of content
    And I expand the thought block widget
    Then the widget CSS classes should contain "thought-block--expanded"
    And the widget CSS classes should not contain "thought-block--collapsed"

  Scenario: ThoughtBlockWidget empty content shows empty indicator
    When I create a thought block widget with empty content
    Then the widget display text should contain "empty thought"
