Feat/add follows#1
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds follow/unfollow features: new Action/Effect variants, App state and helper, executor handlers for follow effects, profile and search UI to display/manage follows, CI workflow, and an MIT LICENSE file. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/screen/user_search.rs (1)
83-90: Avoid extracting the same user identifier twice per row.
Line 83 and Line 72 both derive the same value (pubkey/npub). Reuse one local variable to keep rendering logic tighter and reduce drift risk.♻️ Suggested cleanup
- let npub = user + let user_id = user .get("pubkey") .or_else(|| user.get("npub")) .and_then(|v| v.as_str()) .unwrap_or(""); - let short_npub = if npub.len() > 20 { - format!("{}...", &npub[..17]) + let short_npub = if user_id.len() > 20 { + format!("{}...", &user_id[..17]) } else { - npub.to_string() + user_id.to_string() }; - - let pubkey = user - .get("pubkey") - .or_else(|| user.get("npub")) - .and_then(|v| v.as_str()) - .unwrap_or(""); - let is_following = app.is_following(pubkey); + let is_following = app.is_following(user_id);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/screen/user_search.rs` around lines 83 - 90, The code extracts the same identifier twice (first as `pubkey`/`npub` earlier and again around `let pubkey = user.get("pubkey")...`) — instead, compute the identifier once and reuse it for following checks and rendering: keep one local variable (e.g., the existing `pubkey` from the earlier extraction) and replace the later extraction with that variable when calling `app.is_following(pubkey)` and building `follow_badge`; update references to `pubkey`/`npub` in the `user_search` rendering path so all logic (including `is_following` and `follow_badge`) uses the single reused identifier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/app.rs`:
- Around line 1177-1205: The help overlay for Screen::Profile and
Screen::UserSearch is missing the new follow/unfollow keybindings ('d' for
unfollow and Tab for follow); update the help data where help entries are
constructed (the function or constant that builds the help overlay for
Screen::Profile and Screen::UserSearch) to include entries describing the Tab
key (follow) and the 'd' key (unfollow) with brief labels so they appear in the
overlay; ensure the same text appears where help entries are generated for both
Profile and UserSearch screens (search the code for the help-generation function
or constant used by render_help or the Screen enum match) and add the two
keybinding entries in those cases.
---
Nitpick comments:
In `@src/screen/user_search.rs`:
- Around line 83-90: The code extracts the same identifier twice (first as
`pubkey`/`npub` earlier and again around `let pubkey = user.get("pubkey")...`) —
instead, compute the identifier once and reuse it for following checks and
rendering: keep one local variable (e.g., the existing `pubkey` from the earlier
extraction) and replace the later extraction with that variable when calling
`app.is_following(pubkey)` and building `follow_badge`; update references to
`pubkey`/`npub` in the `user_search` rendering path so all logic (including
`is_following` and `follow_badge`) uses the single reused identifier.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
LICENSE.mdsrc/action.rssrc/app.rssrc/main.rssrc/screen/profile.rssrc/screen/user_search.rs
b6be9d5 to
19a263c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/app.rs`:
- Around line 1636-1639: The help text added to the help lines is incorrect:
replace the hint call that currently uses "j / k" for navigation with the actual
navigation keys and correct description; specifically, in the block that pushes
hints into lines (the calls to hint(...) that build the help text), change
hint("j / k", "Navigate results") to hint("Up / Down", "Navigate results") and
either remove or repurpose the existing hint("j / k", ...) entry to reflect that
j/k modify the search input (e.g., hint("j / k", "Move cursor in input") or
simply omit it) so the help matches the UserSearch behavior. Ensure you update
the same calls to hint(...) that populate lines so labels and descriptions are
consistent with the UserSearch navigation code.
19a263c to
1191cab
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/app.rs (1)
1636-1638:⚠️ Potential issue | 🟡 MinorFix UserSearch navigation hint to match actual keys.
Line 1637 still says
j / knavigate, but navigation is handled by arrow keys (Line 1286-Line 1295);j/ktype into input.Suggested fix
- lines.push(hint("j / k", "Navigate results")); + lines.push(hint("↑ / ↓", "Navigate results"));🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app.rs` around lines 1636 - 1638, The navigation hint text is wrong: locate the call lines.push(hint("j / k", "Navigate results")) (used alongside lines.push(hint("Enter", "Search")) and lines.push(hint("Tab", "Follow / Unfollow")) in app.rs) and change the key label to match actual navigation keys (e.g., replace "j / k" with "↑ / ↓" or "Arrow keys") so the hint reflects that navigation is handled by the arrow keys; keep the hint helper function name hint and other surrounding calls unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/app.rs`:
- Around line 1636-1638: The navigation hint text is wrong: locate the call
lines.push(hint("j / k", "Navigate results")) (used alongside
lines.push(hint("Enter", "Search")) and lines.push(hint("Tab", "Follow /
Unfollow")) in app.rs) and change the key label to match actual navigation keys
(e.g., replace "j / k" with "↑ / ↓" or "Arrow keys") so the hint reflects that
navigation is handled by the arrow keys; keep the hint helper function name hint
and other surrounding calls unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9d47b81b-6575-421b-a496-89c038c70809
📒 Files selected for processing (4)
.github/workflows/ci.ymlsrc/app.rssrc/main.rssrc/screen/user_search.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/ci.yml
1191cab to
c6ad76c
Compare
c6ad76c to
b25d91a
Compare
Summary by CodeRabbit
New Features
Chores