refactor(sqllab): Separate left panel outside of tab container (#36360)

This commit is contained in:
JUST.in DO IT
2025-12-08 11:44:31 -08:00
committed by GitHub
parent 8a00badf45
commit 8d04c33adf
22 changed files with 819 additions and 463 deletions

View File

@@ -30,7 +30,10 @@ export default function useQueryEditor<T extends keyof QueryEditor>(
shallowEqual,
);
const queryEditorsById = useMemo(
() => Object.fromEntries(queryEditors.map(editor => [editor.id, editor])),
() =>
Object.fromEntries(
queryEditors.map((editor, index) => [editor.id, index]),
),
[queryEditors.map(({ id }) => id).join(',')],
);
@@ -38,7 +41,7 @@ export default function useQueryEditor<T extends keyof QueryEditor>(
({ sqlLab: { unsavedQueryEditor } }) =>
pick(
{
...queryEditorsById[sqlEditorId],
...queryEditors[queryEditorsById[sqlEditorId]],
...(sqlEditorId === unsavedQueryEditor?.id && unsavedQueryEditor),
},
['id'].concat(attributes),