Skip to content

fix(tui): end a clipped /feedback description at a word, with an ellipsis - #7027

Merged
Hmbown merged 2 commits into
codewhale-hq:mainfrom
Lstarsky0:ux/feedback-description-ellipsis
Oct 20, 2026
Merged

Hmbown merged 2 commits into
codewhale-hq:mainfrom
Lstarsky0:ux/feedback-description-ellipsis

Conversation

@Lstarsky0

@Lstarsky0 Lstarsky0 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The /feedback picker lets the card edge cut each option's description, so below about 80 columns the rows end mid-word with nothing to say the text was cut. At 40×12, before:

 │ ▸ 1. Bug report    Report a proble │
 │   2. Feature request    Suggest an │
 │   3. Security vulnerability    Rev │

After:

 │ ▸ 1. Bug report    Report a…       │
 │   2. Feature request    Suggest…   │
 │   3. Security vulnerability    Re… │

At 60×16 the third row went from "Review the security pol" to "Review the security…".

/mode had the same problem and truncates its hints at a word boundary at the width left after the prefix, so this does the same: it measures the number, label and gap that are actually painted and truncates the description to the rest with codewhale_ratatui::text::truncate_words. That's the same word-boundary cut, but it spends ... in ASCII-safe mode, where the backend would otherwise draw … as a lone . and "Review the security…" would read as a finished sentence. The third row at 40×12 has three columns left, so it gets the shortest form, "Re…" ("Re." in ASCII-safe mode). It's still not a whole word, but it now shows it was cut. Where the descriptions fit, as at 80×24 and 100×32, nothing changes.

Issue

No-Issue: /feedback descriptions are cut mid-word at narrow widths, no issue filed for it

How I tested it

  • Ran a debug build in a pseudo-terminal with an empty HOME and opened /feedback at 40×12, 50×14, 60×16, 80×24 and 100×32, with this change and with a build of d5f6699 (the file is unchanged since). 80×24 and 100×32 are byte-identical before and after; the three narrower sizes differ only in the description text.
  • With CODEWHALE_ASCII_SAFE=1 at 60×16, the third row reads Review the security. with only the first commit and Review the security... with the second. Outside ASCII-safe mode the second commit changes nothing: 40×12, 50×14 and 60×16 are byte-identical to the first commit's.
  • cargo fmt --all -- --check, cargo clippy -p codewhale-tui --all-targets --all-features with CI's flags, and cargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, plus cargo +1.89.0 check -p codewhale-tui.
  • cargo nextest run -p codewhale-tui --lib: 15349 passed, none failed, including the six feedback picker tests.

Checklist

  • One focused change, on ba6366b; it merges cleanly into current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

…psis

The /feedback picker paints each option's description as is and lets
the card edge cut it, so below about 80 columns the rows end mid-word:
"Report a proble", "Suggest an", "Rev" at 40x12, and "Review the
security pol" at 60x16. Nothing marks the text as cut.

The /mode picker had the same problem and truncates its hints with
semantic_truncate at the width left after the prefix. Do the same here:
measure the number, label and gap actually painted, and truncate the
description to the rest. At 40x12 the rows now read "Report a…",
"Suggest…" and "Re…", and at 60x16 "Review the security…". Where the
descriptions fit, as at 80x24 and 100x32, the picker renders as before.

Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
@Lstarsky0
Lstarsky0 requested a review from Hmbown as a code owner October 19, 2026 16:39

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 19, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T16:44:38.704748Z ee04065 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee040656a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/tui/src/tui/feedback_picker.rs Outdated
UnicodeWidthStr::width(lead.as_str()) + UnicodeWidthStr::width(option.label) + 4,
);
let description =
crate::tui::ui_text::semantic_truncate(option.description, description_width);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the truncation marker in ASCII-safe mode

When CODEWHALE_ASCII_SAFE=1 and this modal is narrow enough to truncate, semantic_truncate emits …, but ColorCompatBackend::draw sends that cell through glyphs::ascii_fallback, which converts it to a single .. A line such as Review the security… therefore renders as Review the security., hiding that more guidance was omitted and defeating the signal this change is meant to add; use an ASCII-aware word truncator (the existing codewhale_ratatui::text::truncate_words reserves ...) or otherwise account for this mode.

Useful? React with 👍 / 👎.

With CODEWHALE_ASCII_SAFE=1 the backend maps "…" to a single "." on
draw, so a clipped description such as "Review the security…" showed
as "Review the security.", which reads as a finished sentence.

codewhale_ratatui::text::truncate_words is the same word-boundary
truncation and spends "..." in ASCII-safe mode, so use it here. Outside
ASCII-safe mode the rows render exactly as before; at 60x16 in ASCII
mode the third row now reads "Review the security...".

Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
@Hmbown
Hmbown merged commit 9af0fbb into codewhale-hq:main Oct 20, 2026
28 checks passed
@Hmbown

Hmbown commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

🤖 This reply is from Claude Opus 5.5, an AI agent working on behalf of the Codewhale maintainers. It is posted through @Hmbown's account, but Hunter did not write it.

Thanks @Lstarsky0. Ending clipped /feedback descriptions at a word with a visible ellipsis matches /mode, and switching to truncate_words in the second commit keeps the cut visible under CODEWHALE_ASCII_SAFE=1, which answers the Codex note. Your before/after captures from 40×12 to 100×32 made this quick to verify. Merged in 9af0fbb for 0.10.2, which hasn't shipped yet.

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

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants