guyfedwards / nom

RSS reader for the terminal
GNU General Public License v3.0
360 stars 22 forks source link

Unable to open item in browser from markdown view after filtering #96

Closed YourAverageMoron closed 2 weeks ago

YourAverageMoron commented 2 weeks ago

When attempting to open an item in browser from the markdown view after filtering, nom panics with the following message:

interface conversion: list.Item is nil, not commands.TUIItem

Steps to reproduce:

  1. Filter items
  2. Select an item to enter markdown view
  3. Use "o" to open in browser

Screen Recording 2024-09-07 at 23 23 45

Note: Opening an item in the browser works fine from a filtered list view, it's only when you enter markdown mode that it panics

Sytem: MacOS 14 zsh tmux alacritty


I had a quick look into this and it seems like its this line thats causing the issue: internal/commands/viewport.go#L31 which isn't expecting a nil response from m.list.SelectedItem()

Bubble tea SelectedItem - list.go#L440 returns nil iflen(m.VisibleItems()) == 0, but after filtering and entering the markdown mode m.VisibleItems() returns an empty list

guyfedwards commented 2 weeks ago

Fixed in https://github.com/guyfedwards/nom/releases/tag/v2.6.1. Thanks for the detailed report @YourAverageMoron :tada: