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

Add "recently accessed" to Kibana Home #16556

Merged
merged 28 commits into from
Mar 8, 2018
Merged

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Feb 6, 2018

fixes #16280

screen shot 2018-02-13 at 10 39 47 am

Had to bump enzyme-to-json to 3.3.0 for React.Fragment enzyme support

cc @alexfrancoeur @elastic/kibana-design

@nreese
Copy link
Contributor Author

nreese commented Feb 6, 2018

@formgeist The mockups had the accessed list only showing a couple of values that fit on a single line. What is the best way to calculate what will fit? And to know when the rest need to be displayed in a drop down?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@formgeist
Copy link
Contributor

@nreese I believe the idea was to have max. 5 before moving the rest into a dropdown. I suppose the truncation you have now doesn't work if each link has percentage width, so it'll be fluid if the screensize is smaller. Probably should have a breakpoint where the items just line up in a list instead, still max. 5 before a dropdown.

Noticed that when I saved a query it created a "New saved search" item as well, but it seems to be discarded when I try to load it. The proper saved search with my long name works.

screenshot 2018-02-07 11 41 57

@snide Do you have any tricks to calculate the sizing responsively like described? ^

@cchaos
Copy link
Contributor

cchaos commented Feb 7, 2018

You should be able to use Flexbox and if you only give the last item (the +5 dropdown) a set width, the others should fill in the rest equally with flex: 1. Just ensure the link doesn't line-wrap to allow for truncation.

@nreese
Copy link
Contributor Author

nreese commented Feb 7, 2018

@cchaos So I should not be truncating the labels in Javascript, but instead letting CSS do it?

@cchaos
Copy link
Contributor

cchaos commented Feb 7, 2018

That would be the most flexible option.

@nreese
Copy link
Contributor Author

nreese commented Feb 7, 2018

@cchaos Thanks for the help. The recently accessed section now exists on a single line and CSS is use to shorten the link text.

@formgeist Thanks for finding the "New Saved Search" getting added to the history. I have added logic to avoid pushing searches without ids onto the history.

@alexfrancoeur
Copy link

alexfrancoeur commented Feb 7, 2018

Pretty awesome @nreese!

I'm wondering what the best approach to handling < 5 saved objects are. Right now, it seems that we're consuming the entire space. Would it be better to align left? Looking for design input here. @cchaos @formgeist

screen shot 2018-02-07 at 3 56 21 pm

>5 saved objects look good! Are we truncating the name here as well if it is greater than a certain amount of characters?

screen shot 2018-02-07 at 3 56 46 pm

A few other quick questions.

What did we decide upon for "separating" these links. At first it was >, we discussed potential icons. Right now it's just spacing, is that where we landed? @cchaos @formgeist

@nreese I imagine that after we introduce this feature, users are going to wonder why they're recently visited ML jobs or APM applications aren't in the list. Thoughts on the scope of work there? Are we building in a way that accommodate these plugins as well?

@cchaos
Copy link
Contributor

cchaos commented Feb 7, 2018

Yeah, it would be best to left align, though that gets harder to manage when you're trying to truncate... Somewhat of a complex grid layout here. I don't know the final solution for that.

I believe @formgeist was coming up with a solution for separating items that included dots and/or icons?

@nreese
Copy link
Contributor Author

nreese commented Feb 7, 2018

@alexfrancoeur Plugin authors will just have to do the following to add items to the history

import { recentlyAccessed } from 'ui/persisted_log';

recentlyAccessed.add('item link', 'item label');

@alexfrancoeur
Copy link

Thanks @nreese, I'll reach out to a few different teams.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@formgeist
Copy link
Contributor

Been playing around with some layout changes to clean up everything. If we're putting the each of the Add data panels inside the big 100% panel, we should remove the borders. I think we have a general consensus around not doing panel in panel. I've also just adjusted how we display the "Data already in Elasticsearch? Set up index patterns" option so it flows a little better.

Beyond the separator between each item in the Recently Accessed panel, we discussed using the dot icon with its colour subdued, much like how it's presented in the following screenshot. In my screen the items flow nicely, since they're not a fixed width, but rather size whatever the text is. I understand this might be problematic when truncating with CSS like we do, so maybe we can agree a max-width that looks good, and put the dot between each item?

image

@cchaos
Copy link
Contributor

cchaos commented Feb 8, 2018

@nreese This is a quick and dirty solution for inline truncation. You'd just need to figure out a way to update the more dropdown to say and show whatever is not visible.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cjcenizal cjcenizal removed their request for review February 8, 2018 16:52
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese
Copy link
Contributor Author

nreese commented Feb 8, 2018

@alexfrancoeur Try out the latest. The CSS has changed to fix the justification problem. The flex items no longer grow to fill the space and the min-width is getting dynamically set to avoid shrinking really small names to much.

Maybe a max-width should be set so really long names don't hog all the space?

screen shot 2018-02-08 at 1 21 40 pm

screen shot 2018-02-08 at 1 22 06 pm

screen shot 2018-02-08 at 1 22 40 pm

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@cjcenizal
Copy link
Contributor

I encountered an odd bug. Steps to repro:

  1. Open an existing visualization.
  2. Save it with a new name.
  3. Go to Home. You won't see the new visualization in the list of "Recently accessed".

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese
Copy link
Contributor Author

nreese commented Mar 7, 2018

@stacey-gammon Do you want to take another look at this before merging?

@stacey-gammon
Copy link
Contributor

Looks good!

@nreese nreese merged commit 945558b into elastic:master Mar 8, 2018
nreese added a commit to nreese/kibana that referenced this pull request Mar 8, 2018
* kbn history

* put Add Data section in panel and move to seperate component

* RecentlyAccessed component

* complete circle with recently accessed dashboards

* record visualizations in recent accessed history

* render recently accessed

* do not show recently accessed panel when no recently accessed history

* add test cases for home feature panels

* render dropdown when more than 5 items

* only add saved search when id is provided

* remove border around add data cards, move set up index patterns to under cards

* add dot icon to seperate recently accessed items

* fix white space issues

* add timelion sheet to recently accessed

* fix spelling errors, better name space styles, enhance dropdown label

* avoid cutting off bottom of letters, do not display separators with small screen

* wrap separator (EuiIcon) in EuiText component so it is even link text

* track history by object id to avoid duplicate entries when saved object is renamed

* align link dropdown on right side

* shift popover placement for small screens

* update recently_accessed tests to look for nodes insted of using snapshots

* move id to variable

* change 'Recently accessed' to 'Recently viewed'

* change more dropdown label

* add max-width to flex item

* include /app in link path, use arrow functions to remove bind in react props

* add to recently accessed when saved object is saved

* address cjcenizal's comments on test assertion order and react imports
nreese added a commit that referenced this pull request Mar 8, 2018
* kbn history

* put Add Data section in panel and move to seperate component

* RecentlyAccessed component

* complete circle with recently accessed dashboards

* record visualizations in recent accessed history

* render recently accessed

* do not show recently accessed panel when no recently accessed history

* add test cases for home feature panels

* render dropdown when more than 5 items

* only add saved search when id is provided

* remove border around add data cards, move set up index patterns to under cards

* add dot icon to seperate recently accessed items

* fix white space issues

* add timelion sheet to recently accessed

* fix spelling errors, better name space styles, enhance dropdown label

* avoid cutting off bottom of letters, do not display separators with small screen

* wrap separator (EuiIcon) in EuiText component so it is even link text

* track history by object id to avoid duplicate entries when saved object is renamed

* align link dropdown on right side

* shift popover placement for small screens

* update recently_accessed tests to look for nodes insted of using snapshots

* move id to variable

* change 'Recently accessed' to 'Recently viewed'

* change more dropdown label

* add max-width to flex item

* include /app in link path, use arrow functions to remove bind in react props

* add to recently accessed when saved object is saved

* address cjcenizal's comments on test assertion order and react imports
@tsullivan tsullivan mentioned this pull request Aug 14, 2018
@alexfrancoeur alexfrancoeur mentioned this pull request May 4, 2020
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "recently accessed" to Kibana Home
9 participants