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

[Console] Add support to remotely open Embeddable Console #176017

Conversation

TattdCodeMonkey
Copy link
Contributor

@TattdCodeMonkey TattdCodeMonkey commented Jan 31, 2024

Summary

Updated the embeddable console and console start to allow triggering the Console open from the ConsolePluginStart object with or without specific content to be pre-loaded.

Checklist

@TattdCodeMonkey TattdCodeMonkey added release_note:skip Skip the PR/issue when compiling release notes Team:Search v8.13.0 labels Jan 31, 2024
Updated the console console plugin start and the embeddable console to
allow it to be opened remote if it's currently rendered on the page.
This is so that plugins using the embeddable console can trigger it open
from within their components.
Updated the embeddable console to support pre-loading specific content
when it opens. The legacy console already supported loading content from
the load_from query parameter so we decided to re-use that to load
desired content into the embeddable console as well.
Updated how we read the load_from parameter to fallback to checking the
location.search key if there is not a location.hash. This is a fix for
reading the load from with the embeddable console on pages that do not
use a hash route.
@TattdCodeMonkey TattdCodeMonkey force-pushed the rnorris/console/allow-opening-remotely branch from 6030f2f to 8b9e4d6 Compare February 6, 2024 15:39
@TattdCodeMonkey TattdCodeMonkey marked this pull request as ready for review February 6, 2024 15:40
@TattdCodeMonkey TattdCodeMonkey requested a review from a team February 6, 2024 15:40
@TattdCodeMonkey TattdCodeMonkey requested a review from a team as a code owner February 6, 2024 15:40
Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

@TattdCodeMonkey I tried testing locally on a serverless search project and the "Try in Console" button opens a new tab on the first click. Only after I interact with the code block does that embeddable console opens from the bottom panel. Attaching a video below to demonstrate

Screen.Recording.2024-02-06.at.17.29.00.mov

@TattdCodeMonkey
Copy link
Contributor Author

TattdCodeMonkey commented Feb 6, 2024

@yuliacech let me check this is serverless. I bet I missed passing a consolePlugin reference down to the right components.

:( its a rendering race condition, not sure why it didn't happen when I was testing in stack. I'm going to have to refactor how I determine if the console is available in the try in console button to check when you click :/

@TattdCodeMonkey
Copy link
Contributor Author

@yuliacech thanks for testing, I fixed the race condition and the try in console button should work regardless of the render order now.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
console 228 231 +3

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/search-api-panels 75 76 +1
console 23 24 +1
total +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 427.5KB 428.9KB +1.4KB
enterpriseSearch 2.7MB 2.7MB +312.0B
indexManagement 593.3KB 593.5KB +264.0B
serverlessSearch 421.9KB 422.2KB +328.0B
total +2.2KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
console 29.8KB 30.4KB +604.0B
Unknown metric groups

API count

id before after diff
@kbn/search-api-panels 75 76 +1
console 29 32 +3
total +4

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

Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

@TattdCodeMonkey Thanks, the fix worked! I re-tested locally and the button works as expected, changes in Console LGTM 👍

@TattdCodeMonkey TattdCodeMonkey merged commit bf4bb62 into elastic:main Feb 8, 2024
17 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 8, 2024
@TattdCodeMonkey TattdCodeMonkey deleted the rnorris/console/allow-opening-remotely branch February 8, 2024 14:32
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
…6017)

## Summary

Updated the embeddable console and console start to allow triggering the
Console open from the ConsolePluginStart object with or without specific
content to be pre-loaded.

### Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…6017)

## Summary

Updated the embeddable console and console start to allow triggering the
Console open from the ConsolePluginStart object with or without specific
content to be pre-loaded.

### Checklist

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Search v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants