[Maybe duplicate] Selected item in snapshot list is the one *after* last loaded snapshot

Hi,

When loading a snapshot, going back to the snapshot list for saving or loading another one shows with a selected list item that is not the currently loaded snapshot, which is inconvenient when repeatedly overwriting that snapshot with modified data, because you have to be more careful.

Steps to reproduce:

  1. Load any snapshot from personal (000 folder) snapshots
  2. Bold press ZS3 button to return to snapshot list

Expected behaviour:

Selected list item is current snapshot, no need to navigate for saving overwriting

Actual behaviour:

List item at position N+1 appears selected if current snapshot is at position N

Comment / guess:

This may be related to the fact that after restoring my data from a webconf backup now appear in folder ‘000’ and that the first item within that folder is now ‘..’ . Is a different algorithm for locating that position now necessary?

1 Like

I think I’ve spotted the culprit, but I’m absolutely not sure this is a sufficiently general fix. In case it is useful to you @jofemodo @riban (?) this fixes this issue for me and now:

diff --git a/zyngui/zynthian_gui_snapshot.py b/zyngui/zynthian_gui_snapshot.py
index 84a7a8f1..8a066b6a 100644
--- a/zyngui/zynthian_gui_snapshot.py
+++ b/zyngui/zynthian_gui_snapshot.py
@@ -197,8 +197,9 @@ class zynthian_gui_snapshot(zynthian_gui_selector_info):
                 self.list_data.append((fpath, i, title))
                 i += 1
                 if fpath == self.sm.last_snapshot_fpath:
-                    self.index = i + 1
-
+                    self.index = i
+                    if self.bankless_mode:
+                        self.index += 1

Because I’m not sure, no pull request for now of course…

Best

1 Like

Hi @emuse!

The fix looks good. I tested and pushed the change.

Thanks!

1 Like