SabakiHQ / Sabaki

An elegant Go board and SGF editor for a more civilized age.
https://sabaki.yichuanshen.de/
MIT License
2.4k stars 376 forks source link

Pasting between SGF files #751

Open krzhang opened 3 years ago

krzhang commented 3 years ago

Hi; I take many scattered Go notes that I would like to be able to merge / split etc., especially given notes on common positions. Being able to copy/paste a fork from one file to another would be very useful. I really like the current copy/paste functionality, so I hope this would be something you consider adding.

apetresc commented 3 years ago

How do you envision this working? You hit cut/copy on a branch in one window, and then paste it into another window that happens to have an identical base position? What if the base positions aren't identical? What if there's already a partial overlap with another branch? What if that branch already has comments?

The amount of conditions and tricky edge cases is mind-boggling and I struggle to think of many legitimate uses...

krzhang commented 1 year ago

(sorry for late reply!)

  1. Yeah from the UX perspective, I'm just thinking of cut/copy on a branch and paste into another window. There is already the functionality of pasting into positions in the same window.
  2. I was hoping to piggyback on what it means to paste into the same window already, just using a different window.
  3. If I understand the structure of current pasting, I believe it just treats a subtree as a bunch of individual state changes (like of like Git), so if you paste it to some position that has the rest of the board different, it will just play the same moves locally and not bother the rest of the board.
  4. Yes, I understand there can be weird boundary cases, but my argument is that if there are problems there, then those are already solved / buggy as of now when you paste into a different place in the same file. I think copy/pasting works pretty well as it is in one file, so I'm hoping doing the same thing to a different file isn't too much overhead)

Some thoughts on legitimate uses (both of which I use!)

  1. I keep a joseki dictionary of my own where I clip things that are interesting. I find an SGF that is about a particular branch, maybe with a trick move in it, and I want to join them together.
  2. I have a big SGF that's going out of control, I want to split them up. (I agree I can do this now by just killing most of my file and doing "save as", but it feels cleaner to just support copy/paste).

Thanks!