Repository navigation
fix(tui): end a clipped /feedback description at a word, with an ellipsis - #7027
Conversation
…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>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| UnicodeWidthStr::width(lead.as_str()) + UnicodeWidthStr::width(option.label) + 4, | ||
| ); | ||
| let description = | ||
| crate::tui::ui_text::semantic_truncate(option.description, description_width); |
There was a problem hiding this comment.
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>
|
🤖 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 |
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:
After:
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
CODEWHALE_ASCII_SAFE=1at 60×16, the third row readsReview the security.with only the first commit andReview 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-featureswith CI's flags, andcargo check -p codewhale-tui --all-targets: clean. Clippy also on 1.99, pluscargo +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
maincargo fmt --allpasses, and tests cover new or changed behaviordocs/features.toml(cargo test -p codewhale-tui --test feature_registrychecks it) — n/a