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

[dev docs] Add recently viewed docs #195001

Merged
merged 13 commits into from
Oct 10, 2024
Merged

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Oct 4, 2024

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

Copy link
Member

@tsullivan tsullivan left a 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.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@Dosant Dosant changed the title add recently viewed docs [dev docs] Add recently viewed docs Oct 7, 2024
@Dosant Dosant added chore Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Oct 7, 2024
@Dosant Dosant marked this pull request as ready for review October 7, 2024 14:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Dosant
Copy link
Contributor Author

Dosant commented Oct 7, 2024

@elasticmachine merge upstream

@Dosant Dosant added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Oct 7, 2024
Copy link
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work here.


## 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Contributor

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?

Copy link
Contributor Author

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

@Dosant Dosant merged commit 129c0a1 into elastic:main Oct 10, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11275914275

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 10, 2024
## 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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 10, 2024
# 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) chore release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants