-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[dev docs] Add recently viewed docs #195001
Conversation
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 some minor comments.
dev_docs/shared_ux/chrome_recently_accessed/chrome_recently_accessed.mdx
Outdated
Show resolved
Hide resolved
dev_docs/shared_ux/chrome_recently_accessed/chrome_recently_accessed.mdx
Outdated
Show resolved
Hide resolved
…cessed.mdx Co-authored-by: Tim Sullivan <[email protected]>
…cessed.mdx Co-authored-by: Tim Sullivan <[email protected]>
💚 Build Succeeded
History
To update your PR or re-run it, just comment with: |
Pinging @elastic/appex-sharedux (Team:SharedUX) |
@elasticmachine merge upstream |
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.
Great work here.
dev_docs/shared_ux/chrome_recently_accessed/chrome_recently_accessed.mdx
Outdated
Show resolved
Hide resolved
dev_docs/shared_ux/chrome_recently_accessed/chrome_recently_accessed.mdx
Outdated
Show resolved
Hide resolved
dev_docs/shared_ux/chrome_recently_accessed/chrome_recently_accessed.mdx
Show resolved
Hide resolved
dev_docs/shared_ux/chrome_recently_accessed/chrome_recently_accessed.mdx
Outdated
Show resolved
Hide resolved
|
||
## Implementation details | ||
|
||
The `ChromeRecentlyAccessed` services is based on <DocLink id="kibKbnRecentlyAccessedPluginApi" text="@kbn/recently-accessed"/> package. This package provides a `RecentlyAccessedService` that uses browser local storage to manage records of recently accessed objects. Internally it implements the queue with a maximum length of 20 items. When the queue is full, the oldest item is removed. |
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.
In this part, can you explain why ChromeRecentlyAccessed
is necessary? Is it because it's used in the Left Nav of the Kibana Chrome?
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.
Yes ChromeRecentlyAccessed
is a service on core.chrome.recentlyAccessed
## Implementation details | ||
|
||
The `ChromeRecentlyAccessed` services is based on <DocLink id="kibKbnRecentlyAccessedPluginApi" text="@kbn/recently-accessed"/> package. This package provides a `RecentlyAccessedService` that uses browser local storage to manage records of recently accessed objects. Internally it implements the queue with a maximum length of 20 items. When the queue is full, the oldest item is removed. | ||
Applications can create their own instance of `RecentlyAccessedService` to manage their own list of recently accessed items scoped to their application. |
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.
How do they scope their items? Extend and access and display within their application? How can they do that?
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.
they create their own instance of RecentlyAccessedService and use it for their own "recently viewed" piece of UI
so:
core.chrome.recentlyAccessed.add - add item to sidenav / chrome
but also:
import { RecentlyAccessedService } from '@kbn/recently-accessed'
const myOwnRecentlyAccessedService = new RecentlyAccessedService();
myOwnRecentlyAccessedService.add()
myOwnRecentlyAccessedService.get$()
this part goes outside of chrome's recently accessed nav and should be better documented in README of that package that we link to
…cessed.mdx Co-authored-by: Clint Andrew Hall <[email protected]>
…cessed.mdx Co-authored-by: Clint Andrew Hall <[email protected]>
…cessed.mdx Co-authored-by: Clint Andrew Hall <[email protected]>
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11275914275 |
## Summary Add Recently Viewed dev docs --------- Co-authored-by: Tim Sullivan <[email protected]> Co-authored-by: Clint Andrew Hall <[email protected]> (cherry picked from commit 129c0a1)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[dev docs] Add recently viewed docs (#195001)](#195001) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Anton Dosov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-10T14:16:52Z","message":"[dev docs] Add recently viewed docs (#195001)\n\n## Summary\r\n\r\nAdd Recently Viewed dev docs\r\n\r\n---------\r\n\r\nCo-authored-by: Tim Sullivan <[email protected]>\r\nCo-authored-by: Clint Andrew Hall <[email protected]>","sha":"129c0a1e7f716985deffef68371d21a52c8f1c3c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["chore","release_note:skip","v9.0.0","Team:SharedUX","backport:prev-minor"],"title":"[dev docs] Add recently viewed docs","number":195001,"url":"https://github.com/elastic/kibana/pull/195001","mergeCommit":{"message":"[dev docs] Add recently viewed docs (#195001)\n\n## Summary\r\n\r\nAdd Recently Viewed dev docs\r\n\r\n---------\r\n\r\nCo-authored-by: Tim Sullivan <[email protected]>\r\nCo-authored-by: Clint Andrew Hall <[email protected]>","sha":"129c0a1e7f716985deffef68371d21a52c8f1c3c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195001","number":195001,"mergeCommit":{"message":"[dev docs] Add recently viewed docs (#195001)\n\n## Summary\r\n\r\nAdd Recently Viewed dev docs\r\n\r\n---------\r\n\r\nCo-authored-by: Tim Sullivan <[email protected]>\r\nCo-authored-by: Clint Andrew Hall <[email protected]>","sha":"129c0a1e7f716985deffef68371d21a52c8f1c3c"}}]}] BACKPORT--> Co-authored-by: Anton Dosov <[email protected]>
Summary
Add Recently Viewed dev docs
@clintandrewhall, I came up with the "guidance" myself . please take a look or suggest who else should take a look