-
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
fix: add max length to js run function name #38363
fix: add max length to js run function name #38363
Conversation
WalkthroughThe pull request addresses a UI issue in the JavaScript Editor Toolbar where long function names cause the Run button to extend beyond the current view. The changes introduce a constant Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12491947765. |
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
🧹 Nitpick comments (1)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx (1)
71-73
: Concise truncation logic.
Truncating the function label ensures the UI remains tidy. Consider whether a tooltip or ellipsis might further improve clarity for users when names are cut short.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.test.tsx
(2 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx
(3 hunks)app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/constants.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/constants.ts
🔇 Additional comments (5)
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.tsx (2)
2-2
: Good use of lodash truncate
.
This is a straightforward approach for limiting the displayed length of a string.
20-20
: Clear separation of constants.
Importing the maximum length constant from a dedicated file improves maintainability and consistency.
app/client/src/pages/Editor/JSEditor/JSEditorToolbar/components/JSFunctionRun.test.tsx (3)
6-6
: Imported utility ensures consistency across tests.
Centralizing action parsing into a single utility function makes the tests more reliable.
8-9
: Aligned import order with usage.
These imports keep the test’s purpose clear and reflect the production component setup.
85-106
: Robust test for truncation logic.
Verifying the label length in the rendered component ensures that the UI constraint is reliably enforced. This test effectively checks real-world usage scenarios.
Deploy-Preview-URL: https://ce-38363.dp.appsmith.com |
## Description Fixes issue where JS run function name can take up too much space in toolbar. Fixes #38150 ## 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/12491948782> > Commit: c11b60d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12491948782&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IDE` > Spec: > <hr>Wed, 25 Dec 2024 10:35:52 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** - Introduced a character limit for function names in the `JSFunctionRun` component, ensuring names are truncated to a maximum of 30 characters for improved UI consistency. - **Bug Fixes** - Added a test case to verify that function names exceeding the character limit are correctly truncated. - **Documentation** - Updated constants to define the maximum length for function names. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description Fixes issue where JS run function name can take up too much space in toolbar. Fixes appsmithorg#38150 ## 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/12491948782> > Commit: c11b60d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12491948782&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.IDE` > Spec: > <hr>Wed, 25 Dec 2024 10:35:52 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** - Introduced a character limit for function names in the `JSFunctionRun` component, ensuring names are truncated to a maximum of 30 characters for improved UI consistency. - **Bug Fixes** - Added a test case to verify that function names exceeding the character limit are correctly truncated. - **Documentation** - Updated constants to define the maximum length for function names. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Fixes issue where JS run function name can take up too much space in toolbar.
Fixes #38150
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/12491948782
Commit: c11b60d
Cypress dashboard.
Tags:
@tag.IDE
Spec:
Wed, 25 Dec 2024 10:35:52 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
JSFunctionRun
component, ensuring names are truncated to a maximum of 30 characters for improved UI consistency.Bug Fixes
Documentation