extensions: update git blame UI according to design
Created by: taras-yemets
Second iteration on https://github.com/sourcegraph/sourcegraph/issues/38377 (first https://github.com/sourcegraph/sourcegraph/pull/39133)
Loom (see also this comment)
Changes
- Removes blame decorations from the file diff and commit views (context).
- Removes extensions decorations column view support (https://github.com/sourcegraph/sourcegraph/pull/36007). Column decorations (if any) will be rendered as inline decorations. We don't expect to have any column decorations as previously only git-extras extension contributed with column decorations (https://github.com/sourcegraph/sourcegraph-git-extras/pull/276), and now it's been migrated to the core workflow (https://github.com/sourcegraph/sourcegraph/pull/39133).
- As a result of №2 References panel (client/web/src/codeintel/ReferencesPanel.tsx) has decorations disabled by default.
- Refactors blame visibility state management: get rid of React context in favor of rxjs' BehaviorSubject (not to rerender the whole component tree when the value changes).
- As we don't support extensions decorations column view (see №2), refactors
ColumnDecorator
component to be git-blame-specific (and rename it toBlameColumn
). - Extracts
BlameDecoration
into a separate file. It's used by both blob editors (viewers): Monaco and CodeMirror. - Refacors blame decorations from
TextDocumentDecoration
interface toBlameHunk
interface. Wo no longer treat blame decorations as extensions decorations so there's no need to implement the same interface. - Because of №2 and №7, refactors CodeMirror blob decorations to handle inline decorations contributed by Sourcegraph extensions and git blame decorations separately.
Not implemented
- Git blame icon will be moved to the vertical sidebar (thread) in a separate PR to avoid conflicts with the ongoing work on https://github.com/sourcegraph/sourcegraph/issues/38378
- Extensions decoration column display support (as an experimental feature) will be removed in a separate PR.
Test plan
sg start web-standalone
- ensure git blame works as expected in Monaco and CodeMirror blob viewers (to use the latter, one needs to enable
enableCodeMirrorFileView
experimental feature in user settings) - ensure extensions decorations are displayed in both editors (viewers) if
enableLegacyExtensions
experimental feature is enabled in sit config
App preview:
Check out the client app preview documentation to learn more.