Skip to content

fix(webview): highlighting labels (including scoped)

Tomas Vik requested to merge 253-display-labels into main

This MR is finishing refactoring from !150 (merged). It also prepares the ground for #257 (closed).

The only observable change of this MR is rendering of the labels as shown in the following table:

scenario before after
GitLab Bot Add_some_tests______gitlab-vscode-extension Extension_Development_Host_-_Add_some_tests______gitlab-vscode-extension-TEST
Normal label Screenshot_17_12_2020__16_48 Extension_Development_Host_-_Add_some_tests______gitlab-vscode-extension-TEST
Scoped label Add_some_tests______gitlab-vscode-extension Extension_Development_Host_-_Add_some_tests______gitlab-vscode-extension-TEST

All labels now show the description on hover:

Screenshot_2021-01-04_at_19.19.06

How to review

This MR contains only three types of changes and even though it changes +289 -100 lines, it can be reviewed quite easily if you keep the types of changes in mind:

  1. All discussion and label events fetching has been moved from gitlab_service.ts to gitlab_new_service.ts (finishing after !150 (merged)) (this logic is poorly tested by one integration test, there are no new tests for this logic added in this MR 🙁)
  2. This MR simplifies how to create GitLabNewService (which causes small change to many files)
  3. And the main change is changing and testing LabelNote.vue component to render the (scoped) labels. It removes calls to NoteBody component which was making API calls to render Markdown (explained in !150 (merged)). Here I would especially appreciate any suggestions for the CSS.

Labels now don't open web search

With this change, none of the labels links to the web search. Previously some labels (I think non-scoped one-word labels) could be clicked and VS Code would open a web search with the given label. E.g. https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?label_name=feature. This won't be possible after the change. However, it would be easy (frontend-weight1) to implement.

before after
Commenting_on_MR_rev______gitlab-vscode-extension Extension_Development_Host_-_Commenting_on_MR_rev______gitlab-vscode-extension-TEST

Related to #253 (closed)

Edited by Tomas Vik

Merge request reports