← All posts

My first Zed contribution was a number that wasn't there

By ·

I use Zed every day, and every day I looked at the git panel while reviewing changes and wanted one thing that wasn't there: the total. Per-file additions and deletions were right in front of me. The sum of them was not.

So I added it. It was my first contribution to Zed.

The change

The panel already tracked per-entry diff stats. What it didn't do was accumulate them into a figure you could read at a glance while deciding whether a change was ten lines or a thousand. The work landed entirely in crates/git_ui/src/git_panel.rs — 50 lines added, 17 removed.

What I actually learned

The interesting part wasn't the arithmetic. It was reading enough of an unfamiliar Rust codebase to find where the panel's state lived, and understanding when it was recomputed so the total didn't drift out of sync with the entries feeding it.

That's the real skill in a first contribution to a large project: not writing the code, but building enough of a map to know where the code goes. The diff being small is the point. Small diffs in unfamiliar codebases still require reading a lot.

On going first

I opened this one with a note saying it was my first contribution, that I used Zed daily, and that I'd fix anything they flagged. That framing cost me nothing and made the review easier for everyone.

If you've been putting off a first contribution to something you use — the feature you keep wishing existed while you work is a genuinely good candidate. You already know the problem intimately. That's most of the work.

Merged as zed-industries/zed#58018.