-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: add command menu item to layout customization #18764
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
Open
ehconitin
wants to merge
57
commits into
main
Choose a base branch
from
command-menu-item-edition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 42 commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
984bf6e
feat: integrate EditActionsButton into RecordIndex and RecordShow com…
ehconitin a7bb9b0
Merge remote-tracking branch 'upstream/main' into command-menu-item-e…
ehconitin 9a9cc0c
feat: enhance command menus with feature flag support and new components
ehconitin 047e2ae
feat: integrate feature flag for command menu items in metadata loading
ehconitin e08c292
refactor: update side panel navigation to use CommandMenuDisplay and …
ehconitin e722f5c
chore: code path seperatiopn
ehconitin 539f182
refactor: new pin icon
ehconitin 320c84c
refactor: consolidate all flag-ON command menu code under server-items/
ehconitin 74ca958
refactor: remove standard command menu item defaults constants
ehconitin 2e5bdab
Merge remote-tracking branch 'upstream/main' into command-menu-item-e…
ehconitin b3a532e
refactor: remove unused state in SidePanelCommandMenuItemEditPage
ehconitin f692427
feat: enhance EditActionsButton with copy context functionality and u…
ehconitin c0e5923
chore: rename
ehconitin f372306
chore: lint
ehconitin 3588f7c
refactor: remove isAllowedDuringGlobalLayoutCustomization from comman…
ehconitin 239cb7f
review
ehconitin bd8c9dc
refactor: remove id prop from CommandMenuItemDraggable and update ref…
ehconitin 2d30f24
refactor: /display folder
ehconitin 6c46478
feat: enhance CommandMenuEditRecordSelectionDropdown with single and …
ehconitin eb937a9
feat: update CommandMenuContextProviderServerItems and related compon…
ehconitin f95f1a9
feat: refactor command menu components
ehconitin 3b77d8e
refactor: lint + shuffle
ehconitin 3c205de
cleanup
ehconitin 393bf2b
feat: add data attribute for click outside functionality in SidePanel…
ehconitin 7c90b2c
refactor: unify command menu context handling and improve item select…
ehconitin 442c28d
refactor: streamline command menu context API and enhance record sele…
ehconitin b1ea211
refactor: update CommandMenuItemOptionsDropdown to use CommandMenuIte…
ehconitin 550b51e
refactor: improve position calculation for reordering command menu it…
ehconitin bf5b034
refactor: normalize short label handling in CommandMenuItemOptionsDro…
ehconitin 42cb345
chore: lint
ehconitin 9d88056
Merge remote-tracking branch 'upstream/main' into command-menu-item-e…
ehconitin f09ef69
refactor: streamline command menu context API and display overflow
ehconitin 6e36176
chore: lint
ehconitin c54e981
refactor: optimize search functionality in SidePanelCommandMenuItemEd…
ehconitin 2c121b9
Merge remote-tracking branch 'upstream/main' into command-menu-item-e…
ehconitin 7a9ab4f
revert: revert seed
ehconitin 705b637
Merge remote-tracking branch 'origin/main' into command-menu-item-edi…
charlesBochet a8e68c0
revert: bad conflict resolution
ehconitin f2a4352
refactor: address PR review feedback batch 1
ehconitin e90865d
refactor: address PR review feedback batch 2
ehconitin 7ab77f0
refactor: split context API into composable hooks and separate displa…
ehconitin d0ed3b7
refactor(twenty-front): centralize command-menu context instance wiring
ehconitin 35e4109
refactor: simplify conditional rendering in SidePanelCommandMenu comp…
ehconitin 2181df3
Merge remote-tracking branch 'upstream/main' into command-menu-item-e…
ehconitin 0d30f1e
lint
ehconitin cab2fd0
feat(command-menu): add overrides default-values flow and resolved me…
ehconitin 6dc63a7
chore: regenerate the migration file and some fixes
ehconitin b34acd7
Merge remote-tracking branch 'upstream/main' into command-menu-item-e…
ehconitin d35e071
fix: typecheck
ehconitin b8cd83c
chore: lint
ehconitin 429307a
twenty-sdk: generate metadata
ehconitin 62888ed
chore: lint
ehconitin 839ad0f
Merge remote-tracking branch 'upstream/main' into command-menu-item-e…
ehconitin 89a2b16
Merge upstream/main into command-menu-item-edition
ehconitin 850354f
review: refactor + new provider
ehconitin c3d4708
fix
ehconitin 4ea0b94
cleanup: unused file + fix
ehconitin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
packages/twenty-front/src/modules/command-menu-item/components/AnimatedIconCrossfade.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| import { styled } from '@linaria/react'; | ||
| import { motion } from 'framer-motion'; | ||
| import { useContext } from 'react'; | ||
| import { type IconComponent } from 'twenty-ui/display'; | ||
| import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; | ||
|
|
||
| type AnimatedIconCrossfadeProps = { | ||
| isToggled: boolean; | ||
| DefaultIcon: IconComponent; | ||
| ToggledIcon: IconComponent; | ||
| }; | ||
|
|
||
| const StyledContainer = styled.div` | ||
| height: calc(${themeCssVariables.icon.size.sm} * 1px); | ||
| overflow: hidden; | ||
| position: relative; | ||
| width: calc(${themeCssVariables.icon.size.sm} * 1px); | ||
| `; | ||
|
|
||
| const StyledLayer = styled(motion.div)` | ||
| align-items: center; | ||
| display: flex; | ||
| inset: 0; | ||
| justify-content: center; | ||
| position: absolute; | ||
| `; | ||
|
|
||
| export const AnimatedIconCrossfade = ({ | ||
| isToggled, | ||
| DefaultIcon, | ||
| ToggledIcon, | ||
| }: AnimatedIconCrossfadeProps) => { | ||
| const { theme } = useContext(ThemeContext); | ||
|
|
||
| return ( | ||
| <StyledContainer> | ||
| <StyledLayer | ||
| initial={false} | ||
| animate={{ | ||
| opacity: isToggled ? 0 : 1, | ||
| scale: isToggled ? 0.85 : 1, | ||
| }} | ||
| transition={{ | ||
| duration: theme.animation.duration.fast, | ||
| ease: 'easeInOut', | ||
| }} | ||
| > | ||
| <DefaultIcon size={theme.icon.size.sm} /> | ||
| </StyledLayer> | ||
| <StyledLayer | ||
| initial={false} | ||
| animate={{ | ||
| opacity: isToggled ? 1 : 0, | ||
| scale: isToggled ? 1 : 0.85, | ||
| }} | ||
| transition={{ | ||
| duration: theme.animation.duration.fast, | ||
| ease: 'easeInOut', | ||
| }} | ||
| > | ||
| <ToggledIcon size={theme.icon.size.sm} /> | ||
| </StyledLayer> | ||
| </StyledContainer> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...enty-front/src/modules/command-menu-item/contexts/useCommandMenuContextStoreInstanceId.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { CommandMenuContext } from '@/command-menu-item/contexts/CommandMenuContext'; | ||
| import { useContext } from 'react'; | ||
|
|
||
| export const useCommandMenuContextStoreInstanceId = () => | ||
ehconitin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| useContext(CommandMenuContext).contextStoreInstanceId; | ||
54 changes: 54 additions & 0 deletions
54
...ules/command-menu-item/server-items/common/components/SidePanelCommandMenuPageEntries.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| import { CommandMenuContextProvider } from '@/command-menu-item/contexts/CommandMenuContextProvider'; | ||
| import { SidePanelCommandMenuItemEditPage } from '@/command-menu-item/server-items/edit/components/SidePanelCommandMenuItemEditPage'; | ||
| import { SidePanelCommandMenuItemDisplayPage } from '@/command-menu-item/server-items/display/components/SidePanelCommandMenuItemDisplayPage'; | ||
| import { MAIN_CONTEXT_STORE_INSTANCE_ID } from '@/context-store/constants/MainContextStoreInstanceId'; | ||
| import { SidePanelRootPage } from '@/side-panel/pages/root/components/SidePanelRootPage'; | ||
| import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; | ||
| import { FeatureFlagKey } from '~/generated-metadata/graphql'; | ||
|
|
||
| const SidePanelCommandMenuPageWithMainContext = ({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) => ( | ||
| <CommandMenuContextProvider | ||
| isInSidePanel={true} | ||
| displayType="listItem" | ||
| containerType="command-menu-list" | ||
| contextStoreInstanceId={MAIN_CONTEXT_STORE_INSTANCE_ID} | ||
| > | ||
| {children} | ||
| </CommandMenuContextProvider> | ||
| ); | ||
|
|
||
| export const SidePanelCommandMenuDisplayPageEntry = () => { | ||
ehconitin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const isCommandMenuItemEnabled = useIsFeatureEnabled( | ||
| FeatureFlagKey.IS_COMMAND_MENU_ITEM_ENABLED, | ||
| ); | ||
|
|
||
| if (!isCommandMenuItemEnabled) { | ||
| return <SidePanelRootPage />; | ||
| } | ||
|
|
||
| return ( | ||
| <SidePanelCommandMenuPageWithMainContext> | ||
| <SidePanelCommandMenuItemDisplayPage /> | ||
| </SidePanelCommandMenuPageWithMainContext> | ||
| ); | ||
| }; | ||
|
|
||
| export const SidePanelCommandMenuEditPageEntry = () => { | ||
| const isCommandMenuItemEnabled = useIsFeatureEnabled( | ||
| FeatureFlagKey.IS_COMMAND_MENU_ITEM_ENABLED, | ||
| ); | ||
|
|
||
| if (!isCommandMenuItemEnabled) { | ||
| return <SidePanelRootPage />; | ||
| } | ||
|
|
||
| return ( | ||
| <SidePanelCommandMenuPageWithMainContext> | ||
| <SidePanelCommandMenuItemEditPage /> | ||
| </SidePanelCommandMenuPageWithMainContext> | ||
| ); | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.