Bug: Long strings in persona data or user input can break TUI layout #8892

Open
opened 2026-04-14 03:31:39 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit Message: fix(tui): truncate long persona/actor/preset names in PersonaBar and enable text wrapping in conversation widget
  • Branch: fix/tui-long-string-layout-break

Background and Context

The TUI does not currently handle very long strings in certain fields, which can lead to broken layouts and a poor user experience. Specifically, long persona names, actor names, preset names, or long user inputs can cause text to overflow and disrupt the UI.

The PersonaBar widget renders the active persona, actor, and preset names in a fixed-height status bar at the bottom of the TUI. When any of these names exceed a reasonable character length, the text overflows its allocated space and breaks the layout. Similarly, the conversation widget renders messages using Static widgets without explicit wrapping, meaning a very long unbroken string (e.g., a URL or a word with no spaces) can overflow horizontally and disrupt the conversation display.

Steps to Reproduce:

  1. Create a persona with a very long name (e.g., > 50 characters).
  2. Activate the persona.
  3. Observe the PersonaBar at the bottom of the TUI. The layout will be broken.
  4. Alternatively, type a very long string into the prompt without any spaces.

Expected Behavior

The TUI should gracefully handle long strings by truncating them with an ellipsis (...) in the PersonaBar and by using text wrapping in the conversation widget to prevent layout issues. No widget should overflow its allocated space regardless of the length of the string it is asked to display.

Acceptance Criteria

  • The PersonaBar widget truncates persona, actor, and preset names that exceed a configurable maximum length (e.g., 30 characters), appending ... to indicate truncation.
  • The truncation threshold is a named constant (not a magic number) defined in the PersonaBar module.
  • The conversation widget enables text wrapping on all Static message widgets so that long unbroken strings wrap correctly within the available width.
  • No TUI widget overflows its allocated space when given a string of arbitrary length.
  • BDD scenarios cover: (a) persona name truncation in PersonaBar, (b) actor name truncation, (c) preset name truncation, (d) long unbroken string wrapping in the conversation widget.
  • Integration tests verify the layout does not break under long-string inputs.
  • Test coverage remains ≥ 97%.

Subtasks

  • Identify the PersonaBar widget source file and the exact rendering logic for persona/actor/preset names.
  • Add a MAX_LABEL_LENGTH constant to the PersonaBar module.
  • Implement truncation logic: if len(name) > MAX_LABEL_LENGTH, display name[:MAX_LABEL_LENGTH] + "...".
  • Identify the conversation widget source file and the Static widget instantiation for messages.
  • Enable wrap=True (or equivalent Textual property) on all Static message widgets in the conversation widget.
  • Tests (Behave): Add BDD scenarios for PersonaBar name truncation (persona, actor, preset).
  • Tests (Behave): Add BDD scenario for long unbroken string wrapping in conversation.
  • Tests (Robot/Integration): Add integration test verifying no layout overflow under long-string inputs.
  • Verify coverage ≥ 97% via nox -s coverage_report.
  • Run nox (all default sessions), fix any errors.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit Message**: `fix(tui): truncate long persona/actor/preset names in PersonaBar and enable text wrapping in conversation widget` - **Branch**: `fix/tui-long-string-layout-break` ## Background and Context The TUI does not currently handle very long strings in certain fields, which can lead to broken layouts and a poor user experience. Specifically, long persona names, actor names, preset names, or long user inputs can cause text to overflow and disrupt the UI. The `PersonaBar` widget renders the active persona, actor, and preset names in a fixed-height status bar at the bottom of the TUI. When any of these names exceed a reasonable character length, the text overflows its allocated space and breaks the layout. Similarly, the `conversation` widget renders messages using `Static` widgets without explicit wrapping, meaning a very long unbroken string (e.g., a URL or a word with no spaces) can overflow horizontally and disrupt the conversation display. **Steps to Reproduce:** 1. Create a persona with a very long name (e.g., > 50 characters). 2. Activate the persona. 3. Observe the `PersonaBar` at the bottom of the TUI. The layout will be broken. 4. Alternatively, type a very long string into the prompt without any spaces. ## Expected Behavior The TUI should gracefully handle long strings by truncating them with an ellipsis (`...`) in the `PersonaBar` and by using text wrapping in the `conversation` widget to prevent layout issues. No widget should overflow its allocated space regardless of the length of the string it is asked to display. ## Acceptance Criteria - [ ] The `PersonaBar` widget truncates persona, actor, and preset names that exceed a configurable maximum length (e.g., 30 characters), appending `...` to indicate truncation. - [ ] The truncation threshold is a named constant (not a magic number) defined in the `PersonaBar` module. - [ ] The `conversation` widget enables text wrapping on all `Static` message widgets so that long unbroken strings wrap correctly within the available width. - [ ] No TUI widget overflows its allocated space when given a string of arbitrary length. - [ ] BDD scenarios cover: (a) persona name truncation in `PersonaBar`, (b) actor name truncation, (c) preset name truncation, (d) long unbroken string wrapping in the conversation widget. - [ ] Integration tests verify the layout does not break under long-string inputs. - [ ] Test coverage remains ≥ 97%. ## Subtasks - [ ] Identify the `PersonaBar` widget source file and the exact rendering logic for persona/actor/preset names. - [ ] Add a `MAX_LABEL_LENGTH` constant to the `PersonaBar` module. - [ ] Implement truncation logic: if `len(name) > MAX_LABEL_LENGTH`, display `name[:MAX_LABEL_LENGTH] + "..."`. - [ ] Identify the `conversation` widget source file and the `Static` widget instantiation for messages. - [ ] Enable `wrap=True` (or equivalent Textual property) on all `Static` message widgets in the `conversation` widget. - [ ] Tests (Behave): Add BDD scenarios for `PersonaBar` name truncation (persona, actor, preset). - [ ] Tests (Behave): Add BDD scenario for long unbroken string wrapping in `conversation`. - [ ] Tests (Robot/Integration): Add integration test verifying no layout overflow under long-string inputs. - [ ] Verify coverage ≥ 97% via `nox -s coverage_report`. - [ ] Run `nox` (all default sessions), fix any errors. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.7.0 milestone 2026-04-14 03:36:08 +00:00
Author
Owner

Triage Decision: VERIFIED — MoSCoW/Should Have

Real TUI layout bug: long strings in persona data or user input can break the TUI layout. This is a UX issue that affects the usability of the TUI, particularly for users with long persona names or who type long messages.

Priority/Medium — Layout issue; doesn't crash the TUI but degrades UX.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Triage Decision: VERIFIED — MoSCoW/Should Have** Real TUI layout bug: long strings in persona data or user input can break the TUI layout. This is a UX issue that affects the usability of the TUI, particularly for users with long persona names or who type long messages. **Priority/Medium** — Layout issue; doesn't crash the TUI but degrades UX. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Author
Owner

[GROOMED]
Quality issues identified:

  • None. All required labels (State/Verified, Priority/Medium, MoSCoW/Should have, Type/Bug) are present along with milestone v3.7.0.
  • Issue body already includes Metadata, Acceptance Criteria, Subtasks, and Definition of Done sections.

Actions taken:

  • Re-applied the Type/Bug label to confirm the Type taxonomy requirement.

Issue author follow-ups:

  • No additional Acceptance Criteria, Subtasks, Definition of Done, or Metadata updates required at this time.

Automated by CleverAgents Bot
Supervisor: Grooming Pool | Agent: grooming-pool-supervisor
Worker: [AUTO-GROOM-8892]

[GROOMED] Quality issues identified: - None. All required labels (State/Verified, Priority/Medium, MoSCoW/Should have, Type/Bug) are present along with milestone v3.7.0. - Issue body already includes Metadata, Acceptance Criteria, Subtasks, and Definition of Done sections. Actions taken: - Re-applied the Type/Bug label to confirm the Type taxonomy requirement. Issue author follow-ups: - No additional Acceptance Criteria, Subtasks, Definition of Done, or Metadata updates required at this time. --- **Automated by CleverAgents Bot** Supervisor: Grooming Pool | Agent: grooming-pool-supervisor Worker: [AUTO-GROOM-8892]
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8892
No description provided.