-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
chore: Update ADS button min width #37338
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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 (3)
app/client/src/ce/pages/Applications/index.tsx (3)
Line range hint
572-579
: Consider memoizing workspace filtering logicThe workspace filtering logic could benefit from memoization to prevent unnecessary recalculations on re-renders.
- const activeWorkspace = workspaces.find( - (workspace: Workspace) => workspace.id === activeWorkspaceId, - ); + const activeWorkspace = useMemo( + () => workspaces.find((workspace: Workspace) => workspace.id === activeWorkspaceId), + [workspaces, activeWorkspaceId] + );
Line range hint
1012-1016
: Add type safety to workspaces mappingThe
any
type usage could lead to runtime errors. Consider adding proper typing.- let workspaces: any; + let workspaces: Workspace[];
Line range hint
1034-1057
: Enhance error handling for workspace fetchingThe workspace fetching logic should include proper error handling for failed API calls.
useEffect(() => { + try { setActiveWorkspaceId( workspaceIdFromQueryParams ? workspaceIdFromQueryParams : workspaces[0]?.id, ); if ( activeWorkspaceId && fetchedWorkspaceId && fetchedWorkspaceId !== activeWorkspaceId ) { const activeWorkspace: Workspace = workspaces.find( (workspace: Workspace) => workspace.id === activeWorkspaceId, ); if (activeWorkspace) { dispatch({ type: ReduxActionTypes.SET_CURRENT_WORKSPACE, payload: { ...activeWorkspace }, }); dispatch( fetchEntitiesOfWorkspace({ workspaceId: activeWorkspaceId, }), ); } } + } catch (error) { + dispatch({ + type: ReduxActionTypes.FETCH_WORKSPACE_ERROR, + payload: { error }, + }); + } }, [workspaceIdFromQueryParams, fetchedWorkspaces, activeWorkspaceId]);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
app/client/src/ce/pages/Applications/index.tsx
(1 hunks)
🔇 Additional comments (1)
app/client/src/ce/pages/Applications/index.tsx (1)
321-321
: LGTM: Button prop addition aligns with requirements
The addition of isIconButton
prop helps distinguish icon-only buttons from regular buttons, supporting the min-width requirements.
## Description Sets the min width of an ADS button (expect icon buttons) to be 60px Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > 🔴 🔴 🔴 Some tests have failed. > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/11809774671> > Commit: 224483d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11809774671&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > Spec: > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/Widgets/ListV2/Childwigets/List_Inputs_spec.js</ol> > <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">List of identified flaky tests</a>. > <hr>Wed, 13 Nov 2024 04:12:40 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced button styles to include minimum width constraints: 60 pixels for small buttons and 80 pixels for medium buttons, improving layout consistency for non-icon buttons. - Introduced a new property `isIconButton` in the `Button` component to adjust button presentation. - Added functionality to refresh the workspace list immediately after creating a new workspace. - Implemented improved error handling by checking for `workspace.id` before rendering workspace items. - Added a new state variable to manage the visibility of the import application modal. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Sets the min width of an ADS button (expect icon buttons) to be 60px
Fixes #37367
Automation
/ok-to-test tags="@tag.All"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11809774671
Commit: 224483d
Cypress dashboard.
Tags:
@tag.All
Spec:
Wed, 13 Nov 2024 07:15:22 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
isIconButton
in theButton
component to adjust button presentation.workspace.id
before rendering workspace items.