[Discover] [Metrics Experience] Hide the main table when the metrics profile resolves#260607
Conversation
| const getTableButton = ({ | ||
| isHidden, | ||
| toggleTable, | ||
| isDisabled, | ||
| }: { | ||
| isHidden: boolean; | ||
| toggleTable: () => void; | ||
| isDisabled?: boolean; | ||
| }) => { | ||
| const label = isHidden | ||
| ? i18n.translate('discover.panelsToggle.showTableButton', { | ||
| defaultMessage: 'Show results table', | ||
| }) | ||
| : i18n.translate('discover.panelsToggle.hideTableButton', { | ||
| defaultMessage: 'Hide results table', | ||
| }); | ||
|
|
||
| return { | ||
| label, | ||
| iconType: isHidden ? temporaryCollapseTableIcon : temporaryExpandTableIcon, | ||
| 'data-test-subj': isHidden ? 'dscShowTableButton' : 'dscHideTableButton', | ||
| 'aria-expanded': !isHidden, | ||
| isDisabled, | ||
| toolTipContent: isDisabled ? disabledCollapsingTooltip : label, | ||
| onClick: toggleTable, | ||
| }; | ||
| }; |
There was a problem hiding this comment.
🟠 High panels_toggle/panels_toggle.tsx:124
The iconType logic in getTableButton is inverted: when isHidden is true, it displays temporaryCollapseTableIcon instead of temporaryExpandTableIcon. This shows the wrong icon — users see a collapse icon when the table is already hidden and clicking will expand it. Swap the icons so isHidden maps to temporaryExpandTableIcon.
- iconType: isHidden ? temporaryCollapseTableIcon : temporaryExpandTableIcon,
+ iconType: isHidden ? temporaryExpandTableIcon : temporaryCollapseTableIcon,🤖 Copy this AI Prompt to have your agent fix this:
In file src/platform/plugins/shared/discover/public/components/panels_toggle/panels_toggle.tsx around lines 124-150:
The `iconType` logic in `getTableButton` is inverted: when `isHidden` is true, it displays `temporaryCollapseTableIcon` instead of `temporaryExpandTableIcon`. This shows the wrong icon — users see a collapse icon when the table is already hidden and clicking will expand it. Swap the icons so `isHidden` maps to `temporaryExpandTableIcon`.
Evidence trail:
src/platform/plugins/shared/discover/public/components/panels_toggle/panels_toggle.tsx lines 39-67 (icon definitions), line 143 (iconType logic showing `isHidden ? temporaryCollapseTableIcon : temporaryExpandTableIcon`), lines 132-137 (label logic showing correct behavior: `isHidden ? 'Show results table' : 'Hide results table'`), line 144 (data-test-subj showing correct behavior: `isHidden ? 'dscShowTableButton' : 'dscHideTableButton'`). The icon logic at line 143 is inverted compared to the label and test subject logic.
There was a problem hiding this comment.
That's not entirely true, the icon visually is aligned with the action, what's inverted is naming of the SVG, which I must have confused in the previous PR and we didn't catch it. That being said, it'll be replaced by EUI icons soon, so I'm not sure if another CI run is worth the change of the variable name
There was a problem hiding this comment.
You're right — I misread the icon semantics. The upward arrow for expanding the table (pulling it into view) and downward arrow for collapsing it (pushing it away) are visually correct for the actions. The variable names are swapped, but since these will be replaced by EUI icons soon, it makes sense to leave as-is. Thanks for the clarification!
There was a problem hiding this comment.
I'd appreciate a human reviewer input too before resolving 😁
I'm open for changing it, not sure if it's worth it though
b0da51f to
ff73464
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
cc @davismcphee |
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
justinkambic
left a comment
There was a problem hiding this comment.
This is awesome! Exploration code LGTM!
That said, one thing worth considering here is that the new behavior for all ES|QL is going to be a loading spinner replacing the old visualization, whether it is a TS metrics-* or a FROM logs-*.
Since there should be no delta for users that are writing FROM queries against logs data streams, this could be jarring for them. I am running against a local cluster, so it happens super fast, but you can imagine if the user is waiting a long time for their query to come back this could be annoying. Example:
main
this branch
…ile change" This reverts commit ff73464.
|
@justinkambic That's true, I reverted it in a690be6. We used to have a full screen loader prior to #253510 too, but I removed it since I also didn't like it. I re-added it here because there's some layout flickering when transitioning between profiles that we won't have time to look into for 9.4: transition.mp4But I think the alternative is worse since it will happen for all searches like you mentioned. Better a bit of flickering for now until we get a chance to look into it. |
MiloszRadzynski
left a comment
There was a problem hiding this comment.
LGTM! Great Work! 🚀
…scover (#5845) (#6004) ## Summary This PR addresses #5845 with the following changes: - **`solutions/observability/infra-and-hosts/discover-metrics.md`**: Added a sentence to the intro paragraph noting that the documents table is collapsed by default when the metrics profile is active, and that users can expand it at any time. This reflects the behavior introduced in elastic/kibana#260607, which sets `hideTable: true` as the default app state for the metrics data source profile. Note: I didn't add applies_to because the page already has the right values, so no need to repeat inline ## Resolves Closes #5845 --- > **AI-generated draft** — created with Claude Sonnet 4.6. > Review all generated content for factual accuracy before merging.


Summary
Closes #260680
This pull request provides collapsed table by default for the metrics profile.
A-la-carte
Screen.Recording.2026-04-02.at.12.46.03.mov
Checklist
release_note:*label is applied per the guidelinesbackport:*labels.