Skip to content

Commit 532768b

Browse files
florentcfricklerhandwerk
authored andcommitted
feat: Highlight the targeted suggestion when browsing to it
1 parent 6dbcc3a commit 532768b

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/website/webview/static/style.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@
361361
--error-suggestion: #ffabab;
362362
--affected: #ffabab;
363363
--unaffected: #bfb;
364+
--highlighted: #fcf9c4;
364365
}
365366

366367
body {
@@ -489,6 +490,18 @@ article .suggestion {
489490
flex-grow: 1;
490491
}
491492

493+
@keyframes suggestion-quick-highlight {
494+
0% {
495+
background: var(--highlighted);
496+
}
497+
100% {
498+
}
499+
}
500+
501+
article .suggestion:target {
502+
animation: suggestion-quick-highlight 3s;
503+
}
504+
492505
article .row1 {
493506
display: flex;
494507
flex-direction: row;

src/website/webview/templates/components/suggestion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% load viewutils %}
22

3-
<article class="suggestion" hx-target="this">
3+
<article class="suggestion" hx-target="this" id="suggestion-{{ cached_suggestion.pk }}">
44
<form
55
method="post"
66
action=""

src/website/webview/views.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,7 @@ def suggestion_view_context() -> dict:
684684
"title": cached_suggestion.payload["title"],
685685
"status": suggestion.status,
686686
"old_status": self.status_filter,
687-
"changed_suggestion_link": self.status_route_dict[
688-
suggestion.status
689-
],
687+
"changed_suggestion_link": f"{self.status_route_dict[suggestion.status]}#suggestion-{suggestion.pk}",
690688
"gh_issue_link": gh_issue_link,
691689
"csrf_token": get_token(request),
692690
},

0 commit comments

Comments
 (0)