unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.77k stars 267 forks source link

Visual Namespace Diffs (in Share) #3368

Open ChrisPenner opened 2 years ago

ChrisPenner commented 2 years ago

I think it wouldn’t be too hard to build an online PR viewer that just showed the diff between two namespaces; even without the ability to leave comments or w/e it would be better than the current process haha. UCM could just build a link like share.unison-lang.org/diff?src=@chrispenner/prs.base.thing&dest=@unison/base.main

Once we have the bones of it , should be easy to integrate that work into any PR or projects workflow we add in the future.

hojberg commented 2 years ago

This is gonna be fun to jam on!

ChrisPenner commented 2 years ago

Yup definitely!

After a chat with @cody about it we realized it might not be quite as simple as I'd expected TBH;

there are many different types of changes users might care about, and we'll want to treat them differently, maybe with options to expand into more detail on some of them, e.g.

Maybe we want to have a collapsible definition browser alongside the diff view so users can keep whatever context they like alongside as they read through the diff?

Arya has requested a 3-way-diff if possible, which makes sense for merges, (though might not be part of the MVP); it'd be cool to be able to toggle between LCA <-> Left, LCA <-> Right, Left <-> Right and Left <-> LCA <-> Right, but getting all of that info crammed into a single UI is going to be tough!

ChrisPenner commented 2 years ago

I think for a first approach maybe we show a summary of all the namespace changes at the top, then provide simple line-level definition diffs over the terms as they appear pretty printed within the scope of their respective branches for all the adds and updates below?

Changes which came from a propagate would probably just show in the summary.