Skip to content

fix: use RenderPageWithBottomHelp in play.go list/station views; add g/G to docs#108

Merged
shinokada merged 5 commits intomainfrom
fix/footer-nav
Mar 2, 2026
Merged

fix: use RenderPageWithBottomHelp in play.go list/station views; add g/G to docs#108
shinokada merged 5 commits intomainfrom
fix/footer-nav

Conversation

@shinokada
Copy link
Copy Markdown
Owner

@shinokada shinokada commented Mar 2, 2026

Closes #73

📑 Description

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

Summary by CodeRabbit

  • New Features

    • Added global navigation shortcuts: g (Top) and G (End).
    • New "Import from URL" option.
    • Dedicated help overlay for the "I Feel Lucky" screen; press ? to toggle it.
  • Documentation

    • Updated keyboard shortcut listings and in-app help text to include new keys.
  • Refactor

    • Help text now appears in a bottom-aligned help bar across multiple list and selection views for consistent layout.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0becc7 and 8aab598.

📒 Files selected for processing (2)
  • v3/internal/ui/components/help.go
  • v3/internal/ui/lucky.go

📝 Walkthrough

Walkthrough

Adds g / G Top/End keyboard shortcuts, introduces a bottom-aligned help bar across multiple list/play views (switching render calls to height-aware RenderPageWithBottomHelp), adds a Lucky-screen help set, and introduces a gist import-from-URL state. Documentation updated.

Changes

Cohort / File(s) Summary
Documentation
docs/README.md, v3/README.md
Document the new g / G → Top / End global navigation shortcut.
UI — Play views
v3/internal/ui/play.go
Replaced RenderPage with RenderPageWithBottomHelp for selection views; added height arg and updated bottom help to include g/G: Top/End (and / for station filter).
UI — Most Played view
v3/internal/ui/most_played.go
Call SetSize before showing help overlay on ?; switched to RenderPageWithBottomHelp with model height; added g/G: Top/End to bottom help.
UI — Lucky view & help components
v3/internal/ui/lucky.go, v3/internal/ui/components/help.go
Added CreateLuckyHelp() help sections; swapped Lucky view to use the new help set; centralized footer help constants; added ? toggle handling; updated bottom-help usage.
UI — Gist flow
v3/internal/ui/gist.go
Added gistStateImportURL enum variant; replaced render calls with RenderPageWithBottomHelp and threaded height (h) into render calls for consistent bottom-help layout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I hop with g to the top so spry,
I bound with G to the end up high,
A bottom bar whispers the keys I know,
Help lights my path as I tiptoe. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds g/G (Top/End) navigation and updates rendering, but does not implement Page Up/Page Down support requested in issue #73. Implement Page Up and Page Down keyboard mappings to fully address the requirements in issue #73, not just Home/End navigation.
Out of Scope Changes check ⚠️ Warning Changes to lucky.go, most_played.go, gist.go, and help.go components go beyond the play.go list/station views specified in the PR title. Review whether changes to lucky.go, most_played.go, gist.go, and help.go are necessary for this PR or should be separated into distinct commits.
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: using RenderPageWithBottomHelp in play.go list/station views and adding g/G keyboard shortcuts to documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/footer-nav

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ws; add g/G to docs

- fix: use RenderPageWithBottomHelp in play.go, most_played.go; center help overlay; add g/G to docs
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
v3/internal/ui/most_played.go (1)

804-809: Consider using RenderPageWithBottomHelp for consistency.

The viewSavePrompt and viewSelectList methods still use RenderPage while viewList, viewPlaying, and viewTagInput now use RenderPageWithBottomHelp. For a consistent user experience with bottom-aligned help across all views, consider updating these as well.

♻️ Optional: Update viewSavePrompt to use RenderPageWithBottomHelp
-	return RenderPage(PageLayout{
+	return RenderPageWithBottomHelp(PageLayout{
 		Title:   "💾 Save Station",
 		Content: content.String(),
 		Help:    "Y: My-favorites • L: Choose list • N: Cancel",
-	})
+	}, m.height)

Similar change for viewSelectList.

Also applies to: 817-822

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@v3/internal/ui/most_played.go` around lines 804 - 809, Update viewSavePrompt
and viewSelectList to use RenderPageWithBottomHelp for consistent bottom-aligned
help: locate the calls that currently return RenderPage(PageLayout{Title: ...,
Content: ..., Help: "..."}) in the viewSavePrompt and viewSelectList functions
and replace them with RenderPageWithBottomHelp(PageLayout{Title: ..., Content:
...}, "Y: My-favorites • L: Choose list • N: Cancel") (i.e., move the help text
out of the PageLayout.Help field and pass it as the bottom-help argument to
RenderPageWithBottomHelp); apply the same change to the other occurrence around
the 817-822 block so all views use RenderPageWithBottomHelp consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@v3/internal/ui/most_played.go`:
- Around line 804-809: Update viewSavePrompt and viewSelectList to use
RenderPageWithBottomHelp for consistent bottom-aligned help: locate the calls
that currently return RenderPage(PageLayout{Title: ..., Content: ..., Help:
"..."}) in the viewSavePrompt and viewSelectList functions and replace them with
RenderPageWithBottomHelp(PageLayout{Title: ..., Content: ...}, "Y: My-favorites
• L: Choose list • N: Cancel") (i.e., move the help text out of the
PageLayout.Help field and pass it as the bottom-help argument to
RenderPageWithBottomHelp); apply the same change to the other occurrence around
the 817-822 block so all views use RenderPageWithBottomHelp consistently.

ℹ️ Review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a84c602 and 5a6038e.

📒 Files selected for processing (1)
  • v3/internal/ui/most_played.go

…n ? overlay

- fix: use RenderPageWithBottomHelp across all gist, lucky, play, most_played views
@shinokada
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
v3/internal/ui/lucky.go (1)

1301-1301: Consider centralizing Lucky footer help strings.

Lines 1301, 1407, and 1944 use hardcoded literals across views. Moving them to constants reduces copy/paste drift and keeps help text updates safer.

♻️ Refactor sketch
+const (
+	luckyHelpInputFooter   = "Tab: Switch focus • Enter: Search • ctrl+t: Shuffle • Esc: Back • ?: Help"
+	luckyHelpPlayingFooter = "Space: Pause • f: Fav • s: List • 0: Main Menu • ?: Help"
+	luckyHelpShuffleFooter = "Space: Pause • n: Next • [: Prev • f: Fav • h: Stop shuffle • 0: Main Menu • ?: Help"
+)
...
-	helpText := "Tab: Switch focus • Enter: Search • ctrl+t: Shuffle • Esc: Back • ?: Help"
+	helpText := luckyHelpInputFooter
...
-	helpText := "Space: Pause • f: Fav • s: List • 0: Main Menu • ?: Help"
+	helpText := luckyHelpPlayingFooter
...
-	help := "Space: Pause • n: Next • [: Prev • f: Fav • h: Stop shuffle • 0: Main Menu • ?: Help"
+	help := luckyHelpShuffleFooter

Also applies to: 1407-1407, 1944-1944

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@v3/internal/ui/lucky.go` at line 1301, Create a central constant (e.g., const
luckyFooterHelp = "Tab: Switch focus • Enter: Search • ctrl+t: Shuffle • Esc:
Back • ?: Help") in the same package and replace the hardcoded literal assigned
to helpText and the other occurrences in this file (the other literals around
where helpText is used) with that constant; update any references in functions
or view initializations that currently duplicate the string so all views use
luckyFooterHelp to avoid drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@v3/internal/ui/components/help.go`:
- Line 318: Replace the inconsistent help text entry {"f", "Save to
My-favorites"} so it uses the same terminology as runtime messages—change the
display string to "Save to Quick Favorites" (update the literal in the help
entries collection where {"f", "Save to My-favorites"} appears, and verify other
help strings use "Quick Favorites" to keep terminology consistent with save
success texts).

---

Nitpick comments:
In `@v3/internal/ui/lucky.go`:
- Line 1301: Create a central constant (e.g., const luckyFooterHelp = "Tab:
Switch focus • Enter: Search • ctrl+t: Shuffle • Esc: Back • ?: Help") in the
same package and replace the hardcoded literal assigned to helpText and the
other occurrences in this file (the other literals around where helpText is
used) with that constant; update any references in functions or view
initializations that currently duplicate the string so all views use
luckyFooterHelp to avoid drift.

ℹ️ Review info

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a6038e and f0becc7.

📒 Files selected for processing (4)
  • v3/internal/ui/components/help.go
  • v3/internal/ui/gist.go
  • v3/internal/ui/lucky.go
  • v3/internal/ui/most_played.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • v3/internal/ui/most_played.go

Comment thread v3/internal/ui/components/help.go Outdated
@shinokada shinokada merged commit 3acf3a9 into main Mar 2, 2026
9 checks passed
@shinokada shinokada deleted the fix/footer-nav branch March 2, 2026 10:38
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.

Cannot use PGDN/END keys

1 participant