feat: add command menu item to layout customization (#18764)
figma https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=93630-365000&t=QesAkY3JOyI9D3UU-0 https://github.com/user-attachments/assets/cf3b354d-0b08-41ae-91ae-386054b5cb2e https://github.com/user-attachments/assets/73bfd676-f823-44c9-a70d-107c20523664 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ const meta: Meta<typeof SidePanelRootPage> = {
|
||||
});
|
||||
jotaiStore.set(sidePanelNavigationStackState.atom, [
|
||||
{
|
||||
page: SidePanelPages.Root,
|
||||
page: SidePanelPages.CommandMenuDisplay,
|
||||
pageTitle: 'Command Menu',
|
||||
pageIcon: IconDotsVertical,
|
||||
pageId: '1',
|
||||
|
||||
+8
-4
@@ -83,14 +83,16 @@ describe('useSidePanelMenu', () => {
|
||||
|
||||
act(() => {
|
||||
result.current.commandMenu.navigateSidePanelMenu({
|
||||
page: SidePanelPages.Root,
|
||||
page: SidePanelPages.CommandMenuDisplay,
|
||||
pageTitle: 'First Page',
|
||||
pageIcon: IconDotsVertical,
|
||||
resetNavigationStack: false,
|
||||
});
|
||||
});
|
||||
|
||||
expect(jotaiStore.get(sidePanelPageState.atom)).toBe(SidePanelPages.Root);
|
||||
expect(jotaiStore.get(sidePanelPageState.atom)).toBe(
|
||||
SidePanelPages.CommandMenuDisplay,
|
||||
);
|
||||
expect(jotaiStore.get(sidePanelPageInfoState.atom).title).toBe(
|
||||
'First Page',
|
||||
);
|
||||
@@ -109,14 +111,16 @@ describe('useSidePanelMenu', () => {
|
||||
|
||||
act(() => {
|
||||
result.current.commandMenu.navigateSidePanelMenu({
|
||||
page: SidePanelPages.Root,
|
||||
page: SidePanelPages.CommandMenuDisplay,
|
||||
pageTitle: 'Reset Page',
|
||||
pageIcon: IconDotsVertical,
|
||||
resetNavigationStack: true,
|
||||
});
|
||||
});
|
||||
|
||||
expect(jotaiStore.get(sidePanelPageState.atom)).toBe(SidePanelPages.Root);
|
||||
expect(jotaiStore.get(sidePanelPageState.atom)).toBe(
|
||||
SidePanelPages.CommandMenuDisplay,
|
||||
);
|
||||
expect(jotaiStore.get(sidePanelPageInfoState.atom).title).toBe(
|
||||
'Reset Page',
|
||||
);
|
||||
|
||||
@@ -100,7 +100,7 @@ export const useCommandMenuHotKeys = () => {
|
||||
}
|
||||
|
||||
if (
|
||||
sidePanelPage === SidePanelPages.Root &&
|
||||
sidePanelPage === SidePanelPages.CommandMenuDisplay &&
|
||||
!(
|
||||
contextStoreTargetedRecordsRule.mode === 'selection' &&
|
||||
contextStoreTargetedRecordsRule.selectedRecordIds.length === 0
|
||||
@@ -108,7 +108,7 @@ export const useCommandMenuHotKeys = () => {
|
||||
) {
|
||||
setGlobalCommandMenuContext();
|
||||
}
|
||||
if (sidePanelPage !== SidePanelPages.Root) {
|
||||
if (sidePanelPage !== SidePanelPages.CommandMenuDisplay) {
|
||||
goBackOneSubPageOrMainPage();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user