Thresh #
[badges]
Yet another TUI code review thingy, but this one tries to both present your diffs as well as it can and reduce them here and there so you spend a bit less time puzzling over and squinting at those infernal red and green squiggles >.>
It has what I think are the basics
- Syntax highlighting
- Split and unified views
- Long line wrapping
- Breakpoints to behave differently on constrained viewports (like mobile)
- Discussions
It has some really cool shit
- View a range change by change
- When a nice contributor has put thought into "right-sizing" their commits and ordering them in a reviewable way, reviewing them one by one and in that order is often so much nicer than lumping it all into one massive diff.
- Round-based review with interdiffs
- Review it once, leave feedback, contributor does some crazy rebase that completely rewrites history, then says it's ready for review round two. Usually, you have to read round 2 in full and mentally parse out what you've already seen and accepted vs what changed from round 1 to round 2 in response to your feedback. Thresh figures the diff between the diffs—the interdiff—out for you.
- Moved lined detection
- Diff viewers often just say a portion of code was removed from location A and a similar-looking portion was added to location B and you have to mentally parse out whether it's actually the same code just moved from A to B. Thresh finds those moved lines, adds a "Moved from line NN" label, and displays them slightly differently from lines that were added or removed.
- LLM-based diff abridging (it needs its own section)
And I intend it to have some even cooler shit later on
- Exchanging code review stuffs with external forges like GitHub, Forgejo,
Tangled, etc. so I can never use their individually-crappy-in-different-ways
UIs again
(I know Thresh will also be crappy in some ways, it's inevitable in all software, but it'll be consistent kinds of crappy I can fix or live with instead of 84 different ones, three-quarters of which are proprietary and all of those three-quarters are constantly changing for the worse!)
Warning
The code in this main branch is currently just
meat.dev with some light changes. I'm working on
Thresh in another branch and using it every day as I review
contributors', my, my bots', and my coworkers' code. Once I feel it's
"ready" for others to use, I'll merge that branch into main.
Abridging #
Thresh is for reviewing any kind of code, whether pecked out by fingers or generated by (G|C)PUs. Humans need to review code before it enters critical systems. But humans are already pretty great, and models are getting very good, at producing code; you might not need to review for style or nil-checks or imports, especially if you have good deterministic and stochastic systems in place to catch what they can before putting another human's eyes on that code.
Thresh uses an LLM to look through a diff and decide what does and doesn't need review, then presents the important bits first. Abridged regions are clearly marked and you can press e when on such a region to expand it and see the unabriged version.
The idea of using an LLM to abridge your code and cut down how much you have to read is from meat.dev. I forked it and made some light changes so it works better inside Thresh. If you don't like Thresh, maybe upstream meat will better fit your needs, or if not, you can also fork it and make it do whatever you like 😃
- Go 91%
- HTML 5%
- JavaScript 3%
- Python <1%