Skip to content

Commit

Permalink
[ES|QL] Vertical align expand icon in history component (elastic#207042)
Browse files Browse the repository at this point in the history
## Summary

Closes elastic#204072

Aligns in top the expandable icon in the history component

<img width="1675" alt="image"
src="https://github.com/user-attachments/assets/0a2a98ae-759f-408e-9a30-dd0c7f884153"
/>


It also fixes a small bug. When the query was expanded and the user
resized the window, the icon was vanished.
  • Loading branch information
stratoula authored and viduni94 committed Jan 23, 2025
1 parent 8fe615c commit 1635d59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('Starred and History queries components', () => {
field: 'queryString',
name: 'Query',
render: expect.anything(),
css: expect.anything(),
},
{
'data-test-subj': 'timeRan',
Expand Down Expand Up @@ -120,6 +121,7 @@ describe('Starred and History queries components', () => {
field: 'queryString',
name: 'Query',
render: expect.anything(),
css: expect.anything(),
},
{
'data-test-subj': 'timeRan',
Expand Down Expand Up @@ -171,6 +173,7 @@ describe('Starred and History queries components', () => {
field: 'queryString',
name: 'Query',
render: expect.anything(),
css: expect.anything(),
},
{
actions: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ export const getTableColumns = (
name: i18n.translate('esqlEditor.query.recentQueriesColumnLabel', {
defaultMessage: 'Query',
}),
css: css`
.euiTableCellContent {
align-items: flex-start;
}
`,
render: (queryString: QueryHistoryItem['queryString']) => (
<QueryColumn
queryString={queryString}
Expand Down Expand Up @@ -408,9 +413,9 @@ export function QueryColumn({
useEffect(() => {
if (containerRef.current) {
const textIsOverlapping = containerRef.current.offsetWidth < containerRef.current.scrollWidth;
setIsExpandable(textIsOverlapping);
setIsExpandable(textIsOverlapping || isRowExpanded);
}
}, [containerWidth]);
}, [containerWidth, isRowExpanded, queryString]);

return (
<>
Expand Down

0 comments on commit 1635d59

Please sign in to comment.