Skip to content

Show shuffle/repeat keys in help bar and persist state#2

Merged
lacymorrow merged 5 commits intomainfrom
feat/shuffle-repeat-keys
Mar 4, 2026
Merged

Show shuffle/repeat keys in help bar and persist state#2
lacymorrow merged 5 commits intomainfrom
feat/shuffle-repeat-keys

Conversation

@lacymorrow
Copy link
Copy Markdown
Owner

Changes

  • Help bar: Added [z] Shfl and [r] Rpt to the bottom controls line so they're discoverable without opening the Ctrl+K keymap overlay
  • Config persistence: Shuffle and repeat state now saves to config.toml on toggle, so preferences survive restarts

Both features are provider-agnostic — shuffle/repeat lives in the playlist package and works identically across local files, Navidrome, and Spotify.

They were only visible in the Ctrl+K keymap overlay but not in the
always-visible bottom controls line.
Saves shuffle and repeat preferences to config.toml when toggled via
z/r keys, so they survive restarts across all providers.
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience by making shuffle and repeat controls more accessible and persistent. Users will now see these options directly in the main interface's help bar and their chosen settings for shuffle and repeat will be remembered between sessions, improving overall usability and convenience.

Highlights

  • Help Bar Visibility: Added [z] Shfl and [r] Rpt key indicators to the bottom controls line, making shuffle and repeat functionality more discoverable without needing to open the Ctrl+K keymap overlay.
  • Configuration Persistence: Implemented saving of shuffle and repeat states to config.toml upon toggle, ensuring these preferences are maintained across application restarts.
Changelog
  • ui/keys.go
    • Persisted the 'repeat' state to config.toml when the repeat mode is cycled.
    • Persisted the 'shuffle' state to config.toml when shuffle is toggled.
  • ui/view.go
    • Added 'Shfl' (shuffle) and 'Rpt' (repeat) keybindings to the rendered help bar.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds discoverability for shuffle and repeat controls and persists their state. The changes look good, but there's an improvement to be made in error handling. Currently, if saving the configuration fails, the error is ignored. I've suggested handling these errors and displaying a status message to the user, which is consistent with how other errors are handled in the application.

ui/keys.go Outdated

case "r":
m.playlist.CycleRepeat()
_ = config.Save("repeat", fmt.Sprintf("%q", m.playlist.Repeat().String()))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

It's good practice to handle errors. The config.Save function can fail for various reasons (e.g., file permissions, disk full). Ignoring the error means the user's preference won't be saved, and they won't know why. The application already has a mechanism for displaying status messages to the user (m.saveMsg), which should be used here to report the error.

Suggested change
_ = config.Save("repeat", fmt.Sprintf("%q", m.playlist.Repeat().String()))
if err := config.Save("repeat", fmt.Sprintf("%q", m.playlist.Repeat().String())); err != nil {
m.saveMsg = fmt.Sprintf("Config save failed: %s", err)
m.saveMsgTTL = 60 // ~3s
}

ui/keys.go Outdated

case "z":
m.playlist.ToggleShuffle()
_ = config.Save("shuffle", fmt.Sprintf("%v", m.playlist.Shuffled()))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to the repeat setting, the error from config.Save should be handled here. This ensures that if saving the shuffle state fails, the user is notified via the UI status message.

Suggested change
_ = config.Save("shuffle", fmt.Sprintf("%v", m.playlist.Shuffled()))
if err := config.Save("shuffle", fmt.Sprintf("%v", m.playlist.Shuffled())); err != nil {
m.saveMsg = fmt.Sprintf("Config save failed: %s", err)
m.saveMsgTTL = 60 // ~3s
}

They were at positions 23-24, below the 12-line visible window.
Moved them right after volume controls so they're visible without
scrolling.
Each help hint has a priority. When the combined width exceeds the
terminal width, the lowest-priority hints are dropped first:

  100 Spc(⏯)  95 Q(Quit)  90 <>(Trk)  80 +-(Vol)  70 ←→(Seek)
   60 Ctrl+K(Keys)  50 Tab(Focus)  40 /(Search)  30 a(Queue)
   20 z(Shfl)  20 r(Rpt)

On a narrow terminal you still see play/pause, track nav, vol, and quit.
On wide terminals everything shows.
Show a status message via saveMsg when persisting fails instead of
silently ignoring the error.

Addresses Gemini Code Assist review feedback.
@lacymorrow lacymorrow merged commit 35818d4 into main Mar 4, 2026
@lacymorrow lacymorrow deleted the feat/shuffle-repeat-keys branch March 4, 2026 18:44
lacymorrow pushed a commit that referenced this pull request Mar 7, 2026
* Switched to using a ReadCloser instead of straight file

* Added navidrome client and playlist integration

* Removed logging

* Switched to a more generic implementation for future providers

* Merged with latest changes
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.

1 participant