Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2130] Add highlight and scroll to group #2131

Merged
merged 24 commits into from
Apr 18, 2024
Merged
Changes from 11 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
437f318
Add highlight and scroll to repo
jonasongg Feb 19, 2024
9e8ce15
Fix indentation
jonasongg Feb 19, 2024
541c484
Fix indentation again
jonasongg Feb 19, 2024
dc79133
Set highlighted fields to null if chart is not found
jonasongg Mar 4, 2024
c1d0ddb
Change highlight colour
jonasongg Mar 11, 2024
d039787
Merge remote-tracking branch 'upstream/master' into add-highlight-scr…
jonasongg Mar 11, 2024
b34c0bb
Change logic of highlighting repo
jonasongg Mar 11, 2024
cf9cc37
remove unused code
jonasongg Mar 11, 2024
3ecb81a
remove unused highlighter icon
jonasongg Mar 11, 2024
3312c75
fix lint error
jonasongg Mar 11, 2024
2c06a41
clarify selectedChart id
jonasongg Mar 14, 2024
de0db3f
add cypress test for scroll to highlighted repo
jonasongg Mar 15, 2024
da74dd6
add retries to flaky scroll to test
jonasongg Mar 16, 2024
8693bff
finetune the retry options for flaky scroll test
jonasongg Mar 16, 2024
cd57797
add scrollIntoView for initial click for scroll test
jonasongg Mar 16, 2024
b2a4126
Merge remote-tracking branch 'upstream/master' into add-highlight-scr…
jonasongg Mar 16, 2024
e901c4b
fix failing scroll test
jonasongg Mar 16, 2024
3fb8773
Merge branch 'master' into add-highlight-scroll-to-group
ckcherry23 Mar 27, 2024
4aef6ee
Merge branch 'master' into add-highlight-scroll-to-group
jonasongg Mar 31, 2024
7f0f742
remove smooth scrolling from highlight scroll to group
jonasongg Apr 1, 2024
040a5b6
Merge remote-tracking branch 'refs/remotes/origin/add-highlight-scrol…
jonasongg Apr 1, 2024
9b30a73
Merge branch 'master' into add-highlight-scroll-to-group
jonasongg Apr 5, 2024
c2328ae
Merge branch 'master' into add-highlight-scroll-to-group
ckcherry23 Apr 13, 2024
cd8c09a
Merge branch 'master' into add-highlight-scroll-to-group
jonasongg Apr 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion frontend/src/components/c-summary-charts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
.summary-chart(
v-for="(user, j) in getRepo(repo)",
v-bind:style="isChartGroupWidgetMode && j === getRepo(repo).length - 1 ? {'marginBottom': 0} : {}",
v-bind:ref="'summary-chart-' + j"
v-bind:ref="'summary-chart-' + j",
v-bind:id="user.name === activeUser && user.repoName === activeRepo ? 'selectedChart' : null"
)
.summary-chart__title(
v-if="!isGroupMerged(getGroupName(repo))",
Expand Down Expand Up @@ -422,6 +423,15 @@ export default defineComponent({
this.removeSelectedTab();
}
},

// watching so highlighted only when summary charts are rendered
filteredRepos() {
this.$nextTick(() => {
if (this.activeRepo !== null && this.activeUser !== null) {
this.scrollToActiveRepo();
}
});
},
},
created() {
this.retrieveSelectedTabHash();
Expand Down Expand Up @@ -823,6 +833,8 @@ export default defineComponent({

this.activeTabType = tabType;
window.encodeHash();

this.$nextTick(() => this.scrollToActiveRepo());
},

removeSelectedTab(): void {
Expand Down Expand Up @@ -875,6 +887,13 @@ export default defineComponent({

return totalContribution / totalCommits;
},

scrollToActiveRepo(): void {
const chart = document.getElementById('selectedChart');
if (chart) {
jonasongg marked this conversation as resolved.
Show resolved Hide resolved
chart.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
}
},
},
});
</script>
Loading