feat(tui): fork slash command for keyboard-friendly session forking (resolves #5599)
This PR adds a /fork slash command which pops a "Fork from message" modal dialog window resembling the existing timeline dialog window. Upon selection of a message in this window, the session is immediately forked upon that message, as if the user had clicked on the message and selected the fork option.
This command may also be bound to a key using the key command name session_fork if the user chooses to bind it in their opencode.json file (but is not bound to any key by default).
Note: I do think it is slightly awkward that this timeline includes ignored/synthatic messages from plugins in the list (the DCP messages shown in the screenshot), but filtering them out would make it inconsistent with the behaviour of the existing session timeline, and I do prefer consistency. Addressing this by making both of these timeline dialogs exclude these plugin methods is probably outside the scope of this particular PR, and so I'll leave that as something to consider for the future.
Resolves #5599.
Work is proceeding, this is coming along well so far. After I get some caffeine and some breakfast in me, I'm going to spend a couple more hours testing it to make sure everything is airtight and tidy before it comes out of draft.
LGTM now, let me know if you guys have any thoughts or concerns.
@rekram1-node Any concerns here?
/review
I think we may as well make the timeline not show synthetic or ignored ones and then do that here too like why not right?
@rekram1-node Great, will do. Just to filter them from /fork's timeline, or from the standard session_timeline as well? LMK and I'll take care of it presently. :)
prolly both?
@rekram1-node Done, ignored / synthetic messages are now filtered from both modals.
/review
lgtm