-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
refactor: move apps link out of menu & refactor nav menu data #34313
Conversation
WalkthroughThe recent updates focus on removing the Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Header as Header Component
participant Editor as Editor Component
participant NavigationHook as useNavigationMenuData
User->>Header: Clicks on Workspace name
Header->>Editor: Loads Workspace
Editor->>NavigationHook: Fetch Navigation Menu Data
NavigationHook-->>Editor: Returns Navigation Menu Data
Editor-->>Header: Displays updated menu
Header-->>User: Shows Workspace content
Assessment against linked issues
Poem
Warning Review ran into problemsProblems (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
app/client/src/pages/Editor/EditorHeader.tsx (1)
Line range hint
1-1
: Consider using React hooks for state management (useState
) and effects (useEffect
) consistently across the component to enhance readability and maintain the functional component conventions.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- app/client/src/pages/Editor/EditorHeader.tsx (2 hunks)
- app/client/src/pages/Editor/EditorName/index.tsx (5 hunks)
- app/client/src/pages/Editor/EditorName/useNavigationMenuData.ts (5 hunks)
- app/client/src/pages/Editor/IDE/Header/index.tsx (9 hunks)
Files skipped from review due to trivial changes (1)
- app/client/src/pages/Editor/EditorName/index.tsx
Additional comments not posted (13)
app/client/src/pages/Editor/EditorName/useNavigationMenuData.ts (7)
1-2
: Imports for React hooksuseCallback
anduseMemo
are correctly added to manage memoization and callback issues as per the PR description.
29-29
: The interfaceNavigationMenuDataProps
has been updated to remove theThemeProp
, aligning with the removal of theme-related imports and usage as noted in the AI-generated summary.
34-34
: The transformation ofGetNavigationMenuData
touseNavigationMenuData
is a significant improvement. It adheres to React custom hooks naming conventions (useXYZ
) and aligns with the functional programming style prevalent in React.
48-50
: Introduction ofhasDeletePermission
usinghasDeleteApplicationPermission
function is a good practice. It encapsulates permission logic, which enhances code readability and maintainability.
Line range hint
66-87
: TheexportAppAsJSON
function has been correctly refactored to useuseCallback
for better performance and fewer re-renders. The dependencies listed in the array are appropriate, ensuring that the callback is updated only when necessary.
Line range hint
89-103
: ThedeleteApplication
function is properly usinguseCallback
, ensuring that the function is not recreated unless its dependencies change. This is crucial for performance, especially in React components that could re-render often.
105-186
: TheuseMemo
hook is used effectively to derivenavigationMenuData
. This optimizes performance by memoizing the menu data only when its dependencies change. The dependencies array is comprehensive, covering all variables that determine the menu's output.app/client/src/pages/Editor/EditorHeader.tsx (2)
Line range hint
1-1
: All necessary imports are included, and the file adheres to the React functional component structure.
Line range hint
1-1
: ThehandleClickDeploy
function is refactored to useuseCallback
, which is good practice for functions that are passed as props or triggered on events in React components.app/client/src/pages/Editor/IDE/Header/index.tsx (4)
15-15
: The import forLink
from "design-system" is correctly added, likely used for navigation links within the IDE header.
Line range hint
169-204
: ThehandlePublish
function is refactored to useuseCallback
, which is correctly implemented. The dependencies are correctly identified, ensuring that the function is only re-created when one of these dependencies changes.
206-215
: ThehandleClickDeploy
function's refactoring to useuseCallback
is appropriate. It ensures that the function is not re-created unnecessarily, which can lead to performance improvements in React applications.
228-231
: The use of theLink
component to navigate back to the applications URL is a good UX enhancement, making it easier for users to navigate through the application.
/build-deploy-preview |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9575731265. |
Deploy-Preview-URL: https://ce-34313.dp.appsmith.com |
/build-deploy-preview |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9578220021. |
Deploy-Preview-URL: https://ce-34313.dp.appsmith.com |
## Description Reverted missed out code in #34367 ## Automation /ok-to-test tags="@tag.IDE" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9608916182> > Commit: a252566 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9608916182&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IDE` <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No
Description
Moved
Back to all apps
from dropdown menu directly to header.Additionally renamed
NavigationMenuData.ts
touseNavigationMenuData.ts
and fixed dependency related memoization issues.Fixes #32982
Automation
/ok-to-test tags="@tag.IDE"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9567752111
Commit: 824b2fe
Cypress dashboard.
Tags:
@tag.IDE
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
getNavigationMenu
prop fromEditorHeader
for streamlined navigation menu data retrieval.EditorName
to useuseNavigationMenuData
for navigation menu items.useNavigationMenuData
to useuseCallback
anduseMemo
for enhanced performance.IDE/Header
to useuseCallback
for better efficiency.