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
Logs: Add permalink to log lines #69464
Conversation
Backend code coverage report for PR #69464 |
Frontend code coverage report for PR #69464
|
One thing that I noticed and I am unsure about the correct solution: Screen.Recording.2023-06-02.at.15.59.58.movBasically, if a user is coming from a permalink the UI scrolls to that logline. That's fine. Let's say users then run different queries with results not containing the logline, that's also fine. But then users run a query with results containing the permalinked logline, the visualisation will now also scroll to that logline. I kind of like this, but it can also be super distracting if people aren't interested in the linked logline anymore. |
@svennergr Regarding your last comment, I think after using the permalink and getting to the linked line, the "permalinked" state should be gone, i.e., even if they run the same query again, they should not be scrolled again. The only way to return to the linked log line should be by browsing the link again. That is how, IMO, links usually work, and feels like the expected UX for it. |
Just to clarify, you wouldn't remove highlighting from the logline, would you? |
I would. I don't think I would expect to see the line highlighted again after changing the query or re-executing it. Another thing that stands out to me is that I think we should highlight the permalinked line a little bit more, because as it currently is it can be easily missed. One big reason for this is accessibility, where slight contrast changes might not be noticeable for some people. |
Yea, I talked about that with @niat22 already. It won't be part of this PR though. Thanks for your feedback - much appreciated! |
54eb0fc
to
68ec5cf
Compare
6c2d8ff
to
4052cd9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THIS IS SO GOOD 🔥! Left some feedback/questions bellow.
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left couple more feedback mostly related to details, nothing big
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* create explore panel state for logs * add props to LogRows and unify * pass properties from explore to logs * add css * implement button and scrolling * export and use `getUrlStateFromPaneState` * make `scrollIntoView` optional * change state handling for permalinks * change link icon * removed unused state * add tests for `LogRowMessage` * remove unused prop * fix name * reorg component * add `LogRow` tests * add test for `Logs` * Update public/app/features/logs/components/LogRow.test.tsx Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> * Update public/app/features/explore/Logs/Logs.test.tsx Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> * improve types in test * fix props export in Logs.tsx * fix props export in LogRowMessage.tsx * fix props export in LogRow.tsx * fixed import * fix theme import * remove hidden style * add better test names * change to `log line` rather logline Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> * fix tooltips * remove unused css --------- Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
What is this feature?
This feature add the log line permalinking functionality to Grafana. Users in Explore can use a button to generate a shortlink pointing to one exact logline.
Who is this feature for?
Grafana Logs users.
Which issue(s) does this PR fix?:
Fixes #67379
Special notes for your reviewer:
Currently this works only without the
exploreScrollableLogsContainer
feature toggle. I'll work on a fix for that in a separate PR.make devenv sources=loki