Fix Bird CLI widget: navigation, text wrapping, error handling#58
Open
Fix Bird CLI widget: navigation, text wrapping, error handling#58
Conversation
Fixes all issues reported in #56: 1. Esc now works to exit search results and mentions views - Root cause: after async results loaded, mode returned to Normal and is_modal_open() returned false, so Esc was unhandled - Added Esc handler in normal mode for Twitter widget - Esc in detail view closes detail first, then tweets on second press 2. Detail view now supports j/k scrolling - Added scroll_offset to TweetDetail with scroll support - j/k/up/down keys work when detail view is open 3. Node ExperimentalWarning no longer treated as error - Filter out ExperimentalWarning lines from bird CLI stderr 4. Text wrapping and small terminal support - Tweet list truncates long text with "..." to fit width - Compose/reply/search modals use absolute min sizes - Status messages wrap within available width - Search modal wraps query text 5. Reply modal shows tweet being replied to - Displays @author and preview of original tweet - Shows error feedback when no tweet is selected 6. Compose/reply modals show placeholder text when empty - "Type your tweet..." / "Type your reply..." hints Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all issues reported in #56:
Root Causes & Fixes
1. Unable to exit search/mentions (Esc not working)
Root cause: After async results loaded,
close_modal()set mode to Normal andis_modal_open()returned false. All key events went to the normal handler, which had no Esc case.Fix: Added Esc handler in normal mode that clears tweets when Twitter widget is selected. Esc in detail view closes detail first; second press clears tweets.
2. Detail view not scrollable
Root cause:
is_modal_open()returned true for detail view, routing events to the modal handler which only handled Esc/Char/Backspace/Enter. Navigation keys were silently swallowed.Fix: Added scroll offset to
TweetDetailand j/k/up/down handlers in the modal event handler when detail view is active.3. Compose error (Node ExperimentalWarning)
Root cause: Bird CLI stderr contained Node.js
ExperimentalWarninglines that were shown as the error message even when they aren't real errors.Fix: Filter out lines containing
ExperimentalWarningfrom stderr before reporting errors.4. Text clipped on right side
Root cause: Tweet list used
Line(single-line, no wrapping). Long tweets were clipped.Fix: Truncate tweet text to available width with
...ellipsis. AddedWrapto status messages and search modal.5. Compose input invisible in small windows
Root cause: Modals used percentage-based sizing that became too small in small terminals.
Fix: New
centered_modal()helper with absolute minimum sizes. Placeholder text hints when input is empty.6. Reply not working / no feedback
Root cause: When
tweet_urlwas None, the reply case silently did nothing.Fix: Send
TwitterData::Error("No tweet selected to reply to")when URL is missing. Reply modal now shows the tweet being replied to (author + text preview).Files Changed
src/app.rs— Esc handler in normal mode, detail view navigation, reply error feedbacksrc/ui/widgets/twitter.rs— Scroll support, modal layout, text truncation, Node warning filter, reply context displayTest Plan
cargo fmt— cleancargo clippy— zero warningscargo test— 6/6 passcargo build— successResolves #56
🤖 Generated with Claude Code