Skip to content

Fix Bird CLI widget: navigation, text wrapping, error handling#58

Open
muk2 wants to merge 1 commit intomainfrom
fix/bird-cli-issues-56
Open

Fix Bird CLI widget: navigation, text wrapping, error handling#58
muk2 wants to merge 1 commit intomainfrom
fix/bird-cli-issues-56

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 17, 2026

Summary

Fixes all issues reported in #56:

  • Esc key now works to exit search results and mentions views
  • Detail view scrolling with j/k keys
  • Node ExperimentalWarning no longer treated as command failure
  • Text wrapping for tweets, modals, and status messages
  • Reply modal shows which tweet is being replied to
  • Small terminal support with absolute minimum modal sizes

Root Causes & Fixes

1. Unable to exit search/mentions (Esc not working)

Root cause: After async results loaded, close_modal() set mode to Normal and is_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 TweetDetail and 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 ExperimentalWarning lines that were shown as the error message even when they aren't real errors.

Fix: Filter out lines containing ExperimentalWarning from 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. Added Wrap to 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_url was 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 feedback
  • src/ui/widgets/twitter.rs — Scroll support, modal layout, text truncation, Node warning filter, reply context display

Test Plan

  • cargo fmt — clean
  • cargo clippy — zero warnings
  • cargo test — 6/6 pass
  • cargo build — success
  • Manual: search tweets, Esc to clear results
  • Manual: load mentions, Esc to exit
  • Manual: open detail view, scroll with j/k, Esc to close
  • Manual: compose tweet in small terminal
  • Manual: reply to tweet, verify context shown

Resolves #56

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BirdCLI Integration Issues

1 participant