mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-10 08:43:34 +08:00
Merge pull request #682 from AutumnNazi/fix/query-editor-find-blank-space
This commit is contained in:
@@ -4566,7 +4566,7 @@ describe('QueryEditor external SQL save', () => {
|
||||
expect(initialOptions).toMatchObject({
|
||||
fixedOverflowWidgets: true,
|
||||
find: {
|
||||
addExtraSpaceOnTop: true,
|
||||
addExtraSpaceOnTop: false,
|
||||
},
|
||||
hover: {
|
||||
enabled: true,
|
||||
@@ -11272,14 +11272,13 @@ describe('QueryEditor external SQL save', () => {
|
||||
expect(css).toContain('body[data-ui-version="v2"] .gn-v2-query-results .query-result-tab-text {');
|
||||
});
|
||||
|
||||
it('keeps Monaco find widget spacing scoped to the v2 query editor shell', () => {
|
||||
it('does not reserve vertical space for the Monaco find widget in the v2 query editor', () => {
|
||||
const source = readFileSync(new URL('./QueryEditor.tsx', import.meta.url), 'utf8');
|
||||
const css = readV2ThemeCss();
|
||||
|
||||
expect(source).toContain('addExtraSpaceOnTop: true');
|
||||
expect(css).toContain('body[data-ui-version="v2"] .gn-v2-query-monaco-stage:has(.monaco-editor .find-widget.visible:not(.hiddenEditor)) {');
|
||||
expect(css).toContain('padding-top: 24px;');
|
||||
expect(css).toContain('overflow: visible;');
|
||||
expect(source).not.toContain('addExtraSpaceOnTop: true');
|
||||
expect(css).not.toContain('body[data-ui-version="v2"] .gn-v2-query-monaco-stage:has(.monaco-editor .find-widget.visible:not(.hiddenEditor)) {');
|
||||
expect(css).not.toContain('padding-top: 24px;');
|
||||
expect(css).not.toContain('body[data-ui-version="v2"] .gn-v2-query-monaco-stage .monaco-editor .find-widget {');
|
||||
});
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('QueryEditor i18n source guards', () => {
|
||||
expect(queryEditorSource).toContain('query_editor.action.find_in_editor');
|
||||
expect(queryEditorSource).toContain('gonavi:find-active-query');
|
||||
expect(queryEditorSource).toContain("editor.getAction?.('actions.find')");
|
||||
expect(queryEditorSource).toContain('addExtraSpaceOnTop: true');
|
||||
expect(queryEditorSource).toContain('addExtraSpaceOnTop: false');
|
||||
});
|
||||
|
||||
it('uses a localized wrapper for save query failures', () => {
|
||||
|
||||
@@ -213,9 +213,6 @@ export {
|
||||
const buildQueryEditorMonacoActionLabel = (key: string): string =>
|
||||
`GoNavi: ${translate(key)}`;
|
||||
|
||||
const QUERY_EDITOR_MONACO_FIND_OPTIONS = {
|
||||
addExtraSpaceOnTop: true,
|
||||
} as const;
|
||||
const QUERY_EDITOR_NATIVE_SELECT_CURRENT_LINE_EVENT = 'gonavi:native-select-current-line';
|
||||
const QUERY_EDITOR_MAC_FIND_WITH_SELECTION_COMBO = 'Meta+E';
|
||||
const QUERY_EDITOR_MAC_FIND_WITH_SELECTION_GUARD_ACTION_ID = 'gonavi.suppressMacFindWithSelection';
|
||||
@@ -320,7 +317,10 @@ const buildQueryEditorMonacoOptions = (isObjectEditQueryTab: boolean, wordWrapEn
|
||||
automaticLayout: true,
|
||||
fixedOverflowWidgets: true,
|
||||
wordWrap: wordWrapEnabled ? ('on' as const) : ('off' as const),
|
||||
find: QUERY_EDITOR_MONACO_FIND_OPTIONS,
|
||||
// Keep the find widget as an overlay; Monaco's default top spacer creates a blank band.
|
||||
find: {
|
||||
addExtraSpaceOnTop: false,
|
||||
},
|
||||
hover: {
|
||||
enabled: true,
|
||||
delay: QUERY_EDITOR_HOVER_DELAY_MS,
|
||||
|
||||
@@ -314,11 +314,6 @@ body[data-ui-version="v2"] .gn-v2-query-monaco-stage {
|
||||
background: var(--gn-bg-panel);
|
||||
}
|
||||
|
||||
body[data-ui-version="v2"] .gn-v2-query-monaco-stage:has(.monaco-editor .find-widget.visible:not(.hiddenEditor)) {
|
||||
padding-top: 24px;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
body[data-ui-version="v2"] .gn-v2-query-monaco-shell {
|
||||
min-height: 0;
|
||||
overflow: visible;
|
||||
|
||||
Reference in New Issue
Block a user