editor: Reduce redundant invalidations (#56234)

So, I am building the "GPUI re-render devtools" in [this
branch](https://github.com/zed-industries/zed/pull/55825)

And while running the new devtools I found a few low-risk
over-invalidation sources and included the easy fixes here:

- Avoid notifying for sticky headers when the computed sticky header
result has not changed.
- Avoid repeated `cx.notify()` calls while overscrolling at the top of
the editor when the scroll position is clamped.
- Give `Button::loading` a keyed animation id so repeat animation frame
requests can be attributed to the concrete loading button instance.

The attached video shows the workflow I used to find these with the new
devtools.


https://github.com/user-attachments/assets/852c64a9-ae91-4878-bbf8-21cc23763c42


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
593a78d3ffMikhail Pertsev committed on 6/2/2026, 6:26:18 PM· committed by GitHubparent89cac49
4 files changedLine totals unavailable