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

[Discover][DocViewer] Adjust bottom margin in flyout #183478

Merged
merged 6 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import { monaco } from '@kbn/monaco';
import { getHeight } from './get_height';
import { MARGIN_BOTTOM } from './source';

describe('getHeight', () => {
Object.defineProperty(window, 'innerHeight', { writable: true, configurable: true, value: 500 });
Expand All @@ -32,7 +33,7 @@ describe('getHeight', () => {
const monacoMock = getMonacoMock(500, 0);

const height = getHeight(monacoMock, true);
expect(height).toBe(475);
expect(height).toBe(500 - MARGIN_BOTTOM);
});

test('when using document explorer, returning the available height in the flyout has a minimun guarenteed height', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface SourceViewerProps {
// inline limitation was necessary to enable virtualized scrolling, which improves performance
export const MAX_LINES_CLASSIC_TABLE = 500;
// Displayed margin of the code editor to the window bottom when rendered in the document explorer flyout
export const MARGIN_BOTTOM = 25;
export const MARGIN_BOTTOM = 80; // DocViewer flyout has a footer
// Minimum height for the source content to guarantee minimum space when the flyout is scrollable.
export const MIN_HEIGHT = 400;

Expand Down