Add resume session button - #55
Conversation
tanjo3
left a comment
There was a problem hiding this comment.
Looked through, tested it, seems good to me. The hints not being saved is a bit unexpected so it should probably be noted somewhere so a user knows to saved their hints elsewhere. You should probably increment the minor version number too.
I had Claude review the PR as well and it picked up a few things for robustness, but I didn't flag them here as these changes are fine without them. If we wanted to, it'd probably best to review the entire codebase for robustness/security as its own PR.
Thanks! I'll spend a bit of time looking into saving hints since that really would be a huge convenience to have. If it looks to be a nuisance I'll leave it out of this PR. Also FYI, I noticed the original PR description was out of date. It said layout, generator version, and settings string had to match the saved one, but I've since updated it to force it back to the saved ones. |
|
I think I've covered everything persisting between sessions. Lmk if it behaves as you'd expect. |
tanjo3
left a comment
There was a problem hiding this comment.
Tested it out, seems to work as expected.
Adds a resume session button to the launcher. This allows users to close their tracker, and then pick up where they left off later. This includes items, dungeon rewards, reward labels, songs, keys, and completed checks. If random dungeon shortcuts or random MQ dungeons are turned on, it will also remember which dungeons were toggled as having shortcuts or MQ.
A new HINT_ENTRY reducer case is added to save text typed into hint boxes, including paths, barrens, and sometimes.
Dragged icons required a bit more work to support. On opening the launcher, icons are mapped to blob URLs, and these are not consistent whenever the launcher is opened. We already map icon name -> URL, so we create the inverse URL -> name map, and expose both to the tracker context. When icons are dragged, we save the names, and when resuming a session, we translate the names back to the current session's blob URLs.
The boss boxes in path hints use the same flow as clicking the receivers, but they aren't tagged as receivers, so they're given a new persistIcon property so we know to save those icons.
Resuming a session will force the current layout, generator version, and settings string back to the saved ones.