Skip to content

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Nov 4, 2024

Description

Updates the padding and fixes the unnecessary scrolls renders in the new Plugin Action Editor flow

Fixes #31573
Fixes #37214

Automation

/ok-to-test tags="@tag.Datasource"

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11683203062
Commit: 73474fd
Cypress dashboard.
Tags: @tag.Datasource
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Tue, 05 Nov 2024 11:39:16 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a new TabbedViewContainer for improved layout in the CommonEditorForm.
    • Added support for binary file uploads in the PostBodyData component.
  • Improvements

    • Enhanced padding and border behavior in the Section component based on the new withoutPadding attribute.
    • Adjusted minimum height for the .CodeMirror class in the PostBodyData component.
    • Improved layout and styling in the InfoFields component with new styled components.
    • Updated tooltip content handling in the DatasourceConfig component for better clarity on invalid entries.
    • Enhanced layout in the EmbeddedDatasourcePathField component with updated styling.
    • Refined layout behavior in the CommonEditorForm with the addition of the TabbedViewContainer.
    • Adjusted layout behavior in the Flex component of the JSEditorForm for better scrolling control.
  • Bug Fixes

    • No new bug fixes reported.
  • Refactor

    • Streamlined the RequestTabs component by integrating styles directly into the Tabs component.
    • Refined handling of datasource URLs in the EmbeddedDatasourcePathField component.
    • Updated styling and structure in the KeyValueFieldArray component for improved layout.

Copy link
Contributor

coderabbitai bot commented Nov 4, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The changes in this pull request primarily involve updates to several components within the Plugin Action Editor. Key modifications include the replacement of the isStandalone property with withoutPadding in the Section component, adjustments to CSS styles for padding and borders based on the new attribute, and enhancements to the PostBodyData component to support binary data uploads. Additionally, the layout of the CommonEditorForm and RequestTabs components has been refined, streamlining their structure and improving the overall user interface.

Changes

File Change Summary
app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/index.tsx Updated SectionProps to replace isStandalone with withoutPadding; adjusted rendering logic.
app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/styles.module.css Modified styles for .section class to use data-withoutPadding; updated padding and border rules.
app/client/src/PluginActionEditor/components/PluginActionForm/components/ApiEditor/PostBodyData.tsx Removed padding from PostBodyContainer; added support for binary data uploads in tabComponentsMap.
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/CommonEditorForm.tsx Updated Flex component properties to include flex="1" and overflow="hidden".
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/RequestTabs.tsx Removed TabsListWrapper; integrated its functionality into Tabs with updated overflow behavior.
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/components/DatasourceConfig.tsx Altered KeyValueFlexContainer styling; updated tooltip logic based on isInvalid property.
app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/PostBodyData.tsx Adjusted minimum height for .CodeMirror; included withoutPadding prop in Section.
app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx Introduced new TabbedViewContainer styled component for improved layout.

Assessment against linked issues

Objective Addressed Explanation
Fix paddings at various places (#37214)
Address unnecessary scroll in split panes (#31573) No specific changes to scrolling behavior noted.

Possibly related PRs

"In the realm of code where changes flow,
New properties shine, and styles aglow.
Padding adjusted, layouts refined,
A user-friendly interface, perfectly aligned.
With each component, we craft and we mold,
A seamless experience, a joy to behold!" 🎉


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Bug Something isn't working label Nov 4, 2024
@github-actions github-actions bot added IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage Production UI Improvement labels Nov 5, 2024
@hetunandu hetunandu added the ok-to-test Required label for CI label Nov 5, 2024
@github-actions github-actions bot added the Task A simple Todo label Nov 5, 2024
@hetunandu hetunandu marked this pull request as ready for review November 5, 2024 06:37
@hetunandu hetunandu requested a review from ayushpahwa as a code owner November 5, 2024 06:37
@hetunandu hetunandu requested review from albinAppsmith and removed request for ayushpahwa November 5, 2024 06:37
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (9)
app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/styles.module.css (1)

13-16: Consider adding a CSS custom property for consistent spacing.

While the implementation is correct, the magic number --ads-v2-spaces-6 is used in multiple places. Consider extracting it to a semantic custom property like --section-vertical-spacing for better maintainability.

+ :root {
+   --section-vertical-spacing: var(--ads-v2-spaces-6);
+ }
  &[data-withoutPadding="false"]:first-child {
-   padding-bottom: var(--ads-v2-spaces-6);
+   padding-bottom: var(--section-vertical-spacing);
  }
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/RequestTabs.tsx (2)

62-66: Move inline styles to a styled component

Inline styles make it harder to maintain consistent padding and styling across components. Consider moving these styles to a styled component for better maintainability.

const StyledTabs = styled(Tabs)`
  height: calc(100% - 36px);
  overflow: hidden;
  max-height: unset;
`;

78-84: Simplify comparison operators in notificationCount

While the tab rendering logic will be extracted in a future PR, we can make a minor improvement to the comparison operators.

  notificationCount={
-   tab == "HEADERS"
+   tab === API_EDITOR_TABS.HEADERS
      ? headersCount
-     : tab == "PARAMS"
+     : tab === API_EDITOR_TABS.PARAMS
          ? paramsCount
          : undefined
  }
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/components/DatasourceConfig.tsx (5)

96-96: Consider using a prop for flexible padding control.

Empty styled component might lead to inconsistent spacing. Consider using a prop to control padding instead of removing it entirely.

-const KeyValueFlexContainer = styled.div``;
+const KeyValueFlexContainer = styled.div<{ withPadding?: boolean }>`
+  padding: ${({ withPadding = false }) => withPadding ? "var(--ads-v2-spaces-3)" : "0"};
+`;

Line range hint 115-116: Remove TODO comments and fix eslint issues.

Consider addressing the eslint issues now rather than postponing them.

-  {/* TODO: Fix this the next time the file is edited */}
-  {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
+  {props.datas.map((data: KeyValuePair, index: number) => {

Add this type definition at the top of the file:

interface KeyValuePair {
  key: string;
  value: string;
  isInvalid?: boolean;
}

Line range hint 119-134: Simplify tooltip content logic.

The tooltip content logic can be simplified using a more declarative approach.

-        let tooltipContentValue = data?.value;
-        let tooltipContentKey = data?.key;
-
-        if ("isInvalid" in data) {
-          if (data?.isInvalid) {
-            tooltipContentValue = createMessage(
-              API_PANE_DUPLICATE_HEADER,
-              data?.key,
-            );
-            tooltipContentKey = createMessage(
-              API_PANE_DUPLICATE_HEADER,
-              data?.key,
-            );
-          } else {
-            tooltipContentValue = "";
-            tooltipContentKey = "";
-          }
-        }
+        const tooltipContent = data?.isInvalid 
+          ? createMessage(API_PANE_DUPLICATE_HEADER, data.key)
+          : "";

Line range hint 182-191: Add proper typing for onClick handler.

The onClick handler should have proper TypeScript typing.

-  onClick: any,
+  onClick: (show: boolean) => void,

Line range hint 209-227: Clean up commented code and add proper typing.

The component has commented-out code and uses any types. Consider cleaning this up now.

-  // TODO: Fix this the next time the file is edited
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  data: any;
-  // TODO: Fix this the next time the file is edited
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  autogeneratedHeaders?: any;
+  data: KeyValuePair[];
+  autogeneratedHeaders?: KeyValuePair[];
   attributeName: string;
 }) {
   const [showDatas, toggleDatas] = useState(false);

-  // commenting this out for whenever we decide to add a button to toggle auto-generated headers
-  // const [showAutoGeneratedHeader, toggleAutoGeneratedHeaders] = useState(true);

Also, remove the commented-out code block for auto-generated headers toggle (lines 255-266) as it's not currently used.

app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx (1)

Line range hint 119-123: Remove commented padding style

The commented padding style in MainContainer should be removed since it's no longer needed and the padding is now handled by child components.

const MainContainer = styled.div`
  display: flex;
  position: relative;
  height: 100%;
  flex-direction: column;
-  /* padding: var(--ads-v2-spaces-7); */
`;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6dc6194 and efcc7ef.

📒 Files selected for processing (8)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/index.tsx (2 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/styles.module.css (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/ApiEditor/PostBodyData.tsx (0 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/CommonEditorForm.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/RequestTabs.tsx (2 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/components/DatasourceConfig.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/PostBodyData.tsx (2 hunks)
  • app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/ApiEditor/PostBodyData.tsx
🧰 Additional context used
📓 Learnings (1)
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/RequestTabs.tsx (2)
Learnt from: hetunandu
PR: appsmithorg/appsmith#36380
File: app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/RequestTabs.tsx:32-58
Timestamp: 2024-09-19T10:42:56.559Z
Learning: The tab rendering logic of the `RequestTabs` component will be extracted into separate components in a future PR.
Learnt from: hetunandu
PR: appsmithorg/appsmith#36380
File: app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/RequestTabs.tsx:32-58
Timestamp: 2024-10-08T15:32:34.115Z
Learning: The tab rendering logic of the `RequestTabs` component will be extracted into separate components in a future PR.
🔇 Additional comments (11)
app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/index.tsx (3)

15-15: LGTM! Default value is correctly maintained.

The default value of false aligns with the previous behavior, ensuring backward compatibility.


7-7: Verify the impact of prop renaming across the codebase.

The renaming from isStandalone to withoutPadding is more semantically clear, but we should ensure all usages are updated.

#!/bin/bash
# Search for any remaining usages of isStandalone prop
rg 'isStandalone={' 

# Search for new withoutPadding prop usage
rg 'withoutPadding={'

24-24: LGTM! Data attribute updated consistently.

The data attribute change from data-standalone to data-withoutPadding matches the prop name change.

✅ Verification successful

CSS selectors and data attributes are properly aligned

The CSS module correctly uses the new data-withoutPadding attribute in its selectors, and the attribute is consistently used in the component. The data-standalone found in LocationSearchControl is unrelated as it's a different component with a different purpose (data-standalone-searchbox).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify CSS selectors are updated to match the new data attribute
rg '\[data-standalone' 
rg '\[data-withoutPadding'

Length of output: 233


Script:

#!/bin/bash
# Search for CSS selectors with escaped square brackets
rg '\\\[data-standalone'
rg '\\\[data-withoutPadding'

# Search in CSS/SCSS files for data attributes
fd -e css -e scss -x rg -l 'data-standalone|data-withoutPadding' {}

# Search for the attribute usage in TSX/JSX files
fd -e tsx -e jsx -x rg -l 'data-standalone|data-withoutPadding' {}

# Look for styled-components usage with these attributes
rg 'attr\(["\']data-standalone'
rg 'attr\(["\']data-withoutPadding'

Length of output: 582


Script:

#!/bin/bash
# Check the CSS file content to verify selector updates
cat "./app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/styles.module.css"

# Check both TSX files for the data attribute usage context
rg -A 2 -B 2 'data-standalone|data-withoutPadding' "./app/client/src/components/propertyControls/LocationSearchControl.tsx"
rg -A 2 -B 2 'data-standalone|data-withoutPadding' "./app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/index.tsx"

Length of output: 1421

app/client/src/PluginActionEditor/components/PluginActionForm/components/ActionForm/Section/styles.module.css (2)

9-11: LGTM: Clean implementation of the base padding control.

The selector is specific and the implementation is straightforward.


18-20: Verify the visual separation between sections.

The combination of padding and border creates visual separation between sections. Please ensure this matches the design specs from Issue #37214.

Run this script to check for consistent usage across the codebase:

Also applies to: 23-25

app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/CommonEditorForm.tsx (2)

32-38: LGTM! Layout changes align with PR objectives.

The Flex container modifications effectively address the unnecessary scroll issues mentioned in #31573.


32-38: Verify content visibility with overflow hidden.

While overflow="hidden" prevents unnecessary scrolling, please verify that no essential content is being clipped, especially in the RequestTabs section.

✅ Verification successful

Based on the search results, I can provide a final response as the overflow behavior is well-defined throughout the component hierarchy:

Overflow handling is properly implemented across the component tree

The overflow="hidden" in CommonEditorForm is safe because:

  • RequestTabs component explicitly handles scrolling with overflow: scroll
  • Parent PluginActionForm maintains proper content flow with overflow="hidden"
  • Child components like UQIEditorForm handle vertical scrolling with overflowY="scroll"
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for potential scroll or overflow handling in RequestTabs
ast-grep --pattern 'overflow: $value' 
rg -A 2 'overflow' app/client/src/PluginActionEditor

Length of output: 11666

app/client/src/PluginActionEditor/components/PluginActionForm/components/GraphQLEditor/PostBodyData.tsx (2)

46-46: LGTM: Improved prop naming from isStandalone to withoutPadding.

The new prop name better reflects its purpose in controlling padding.


18-18: LGTM: CodeMirror height adjustment addresses scroll issues.

The reduction in minimum height should help eliminate unnecessary vertical space.

✅ Verification successful

Let me analyze the min-height changes in the codebase to verify if this change is consistent with other similar editors.


LGTM: The min-height reduction aligns with other editors in the codebase

The change from 250px to 150px for CodeMirror min-height is consistent with similar editor components:

  • GraphQL editor: 150px
  • TinyMCE editor: 150px
  • Other form editors: 150px-200px range
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify if this height adjustment is consistent across other similar editors
rg -l "CodeMirror.*min-height" | xargs rg "min-height:\s*[0-9]+px"

Length of output: 123134


Script:

#!/bin/bash
# Search for CodeMirror editor components with min-height
rg -l "CodeMirror.*editor" | xargs rg "min-height:\s*[0-9]+px"

# Search for editor-related components with min-height
rg -l "editor|Editor" | xargs rg "min-height:\s*[0-9]+px"

Length of output: 95913

app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/components/DatasourceConfig.tsx (1)

Line range hint 1-304: Overall implementation aligns with PR objectives.

The changes successfully address the padding issues mentioned in the PR objectives. However, consider implementing the suggested improvements to enhance code quality and maintainability:

  1. Add proper TypeScript types
  2. Clean up TODO comments and unused code
  3. Improve padding control with props
app/client/src/pages/Editor/APIEditor/CommonEditorForm.tsx (1)

103-106: LGTM: Padding and scroll fixes align with design system

The new TabbedViewContainer correctly uses design system spacing variables and handles overflow appropriately.

@ankitakinger
Copy link
Contributor

/build-deploy-preview skip-tests=true

Copy link

github-actions bot commented Nov 5, 2024

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/11679001273.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 37203.
recreate: .

Copy link

github-actions bot commented Nov 5, 2024

Deploy-Preview-URL: https://ce-37203.dp.appsmith.com

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (4)
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/styles.ts (1)

3-8: Consider using design system tokens and responsive width.

The fixed width might cause issues on different screen sizes. Consider:

  1. Using design system tokens for width values
  2. Making the width responsive or relative
 export const RequestMethodSelectContainer = styled.div`
-  width: 100px;
+  width: ${({ theme }) => theme.spaces.methodSelect || '100px'};
   .ads-v2-select > .rc-select-selector {
-    min-width: 100px;
+    min-width: ${({ theme }) => theme.spaces.methodSelect || '100px'};
   }
 `;
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/InfoFields.tsx (1)

Line range hint 31-41: Consider adding data-testid for E2E tests

While the className for E2E testing is present, consider adding a data-testid attribute to DatasourcePathFieldContainer for more reliable testing.

-      <Styled.DatasourcePathFieldContainer className="t--dataSourceField">
+      <Styled.DatasourcePathFieldContainer 
+        className="t--dataSourceField"
+        data-testid="datasource-path-container">
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/components/EmbeddedDatasourcePathField.tsx (2)

Line range hint 269-270: Clean up technical debt: Remove TODO and eslint-disable comments

The code contains multiple TODOs and eslint-disable comments that should be addressed:

  1. Type safety for event handlers
  2. Component update logic

Consider:

  1. Properly typing the event handlers instead of using any
  2. Implementing proper type checks in shouldComponentUpdate
- // TODO: Fix this the next time the file is edited
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
- handleOnChange = (valueOrEvent: ChangeEvent<any> | string) => {
+ handleOnChange = (valueOrEvent: ChangeEvent<HTMLInputElement> | string) => {

Also applies to: 391-392, 516-517


Line range hint 516-528: Consider breaking down the component for better maintainability

The component has grown complex with multiple responsibilities:

  • URL parsing
  • Datasource management
  • UI rendering
  • State management

Consider splitting this into smaller, focused components:

  1. DatasourceUrlParser
  2. DatasourceManager
  3. EmbeddedDatasourcePathUI
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between efcc7ef and 9d04a85.

📒 Files selected for processing (3)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/InfoFields.tsx (3 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/components/EmbeddedDatasourcePathField.tsx (1 hunks)
  • app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/styles.ts (1 hunks)
🔇 Additional comments (4)
app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/styles.ts (1)

10-12: LGTM!

The implementation is clean and follows responsive design principles.

app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/InfoFields.tsx (2)

7-7: LGTM: Clean import of styled components

The import of styled components from a separate styles file follows good separation of concerns.


18-18: LGTM: Improved spacing with Flex container

The addition of gap="spaces-4" provides consistent spacing between children elements.

app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/components/EmbeddedDatasourcePathField.tsx (1)

95-95: LGTM: Good use of design system tokens

Using gap with design system tokens improves spacing consistency and maintainability.

Comment on lines +19 to +30
<Styled.RequestMethodSelectContainer>
<RequestDropdownField
className={`t--apiFormHttpMethod ${replayHighlightClass}`}
data-location-id={btoa("actionConfiguration.httpMethod")}
disabled={!props.changePermitted}
name="actionConfiguration.httpMethod"
options={props.options}
placeholder="Method"
width={"110px"}
>
<div />
</RequestDropdownField>
</div>
<DatasourceWrapper className="t--dataSourceField">
</Styled.RequestMethodSelectContainer>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

RequestMethodSelectContainer needs padding adjustments per design specs

The styled component's implementation only specifies width but lacks padding specifications mentioned in issue #37214. Please update the component to include the correct padding values from the design system.

  • app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/styles.ts: Add padding specifications to RequestMethodSelectContainer
🔗 Analysis chain

Verify styling consistency with design system

The new RequestMethodSelectContainer wraps the dropdown field. Please ensure this styled component follows the design system specifications mentioned in issue #37214.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other RequestMethodSelectContainer usages to verify consistency
rg -l "RequestMethodSelectContainer"

# Check the implementation in styles.ts
rg "RequestMethodSelectContainer" -A 5 "styles.ts"

Length of output: 340


Script:

#!/bin/bash
# Check the implementation in the correct styles.ts file path
rg "RequestMethodSelectContainer" -A 5 "app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/styles.ts"

# Search for design system styled components patterns
rg "styled\." -A 3 "app/client/src/PluginActionEditor/components/PluginActionForm/components/CommonEditorForm/styles.ts"

Length of output: 613


Script:

#!/bin/bash
# Search for design system specifications in issue #37214
gh issue view 37214

# Look for other similar dropdown containers in the codebase
ast-grep --pattern 'styled.div`
  width: $_;
  .ads-v2-select > .rc-select-selector {
    $$$
  }
`'

Length of output: 498

albinAppsmith
albinAppsmith previously approved these changes Nov 5, 2024
…components/CommonEditorForm/RequestTabs.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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/components/editorComponents/form/fields/KeyValueFieldArray.tsx (1)

Line range hint 84-91: Consider consolidating dropdown styles.

The dropdown styles are split between inline styles and styled-components. Consider moving the .ads-v2-select styles into a separate styled component for better maintainability.

const DynamicDropdownFieldWrapper = styled.div`
  position: relative;
  margin-left: var(--ads-v2-spaces-3);
  border-color: var(--ads-v2-color-border);
  color: var(--ads-v2-color-fg);
+
+  .ads-v2-select {
+    &> .rc-select-selector {
+      min-width: 77px;
+      width: 77px;
+      height: 36px;
+    }
+  }
-
-  .ads-v2-select > .rc-select-selector {
-    min-width: 77px;
-    width: 77px;
-    height: 36px;
-  }
`;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 08221b3 and e94458a.

📒 Files selected for processing (1)
  • app/client/src/components/editorComponents/form/fields/KeyValueFieldArray.tsx (3 hunks)
🔇 Additional comments (3)
app/client/src/components/editorComponents/form/fields/KeyValueFieldArray.tsx (3)

36-36: LGTM: Consistent use of design token for margin.

The change from dynamic theme spacing to CSS variable --ads-v2-spaces-3 aligns with the PR's objective of standardizing padding across components.


55-55: LGTM: Fixed margin for better spacing.

The margin adjustment from 5px to 8px improves alignment consistency in the flex container when size is 3.


84-84: LGTM: Standardized dropdown field spacing.

Good use of the design token --ads-v2-spaces-3 for margin-left, maintaining consistency with the design system.

albinAppsmith
albinAppsmith previously approved these changes Nov 5, 2024
@hetunandu hetunandu merged commit 79a7979 into release Nov 5, 2024
19 of 20 checks passed
@hetunandu hetunandu deleted the fix/paddings-and-scrolls branch November 5, 2024 11:30
@github-actions github-actions bot added QA Needs QA attention QA Pod Issues under the QA Pod labels Nov 5, 2024
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Nov 20, 2024
## Description

Updates the padding and fixes the unnecessary scrolls renders in the new
Plugin Action Editor flow



Fixes appsmithorg#31573
Fixes appsmithorg#37214

## Automation

/ok-to-test tags="@tag.Datasource"




## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new `TabbedViewContainer` for improved layout in the
`CommonEditorForm`.
- Added support for binary file uploads in the `PostBodyData` component.

- **Improvements**
- Enhanced padding and border behavior in the `Section` component based
on the new `withoutPadding` attribute.
- Adjusted minimum height for the `.CodeMirror` class in the
`PostBodyData` component.
- Improved layout and styling in the `InfoFields` component with new
styled components.
- Updated tooltip content handling in the `DatasourceConfig` component
for better clarity on invalid entries.
- Refined layout behavior in the `CommonEditorForm` with the addition of
the `TabbedViewContainer`.
- Enhanced layout in the `EmbeddedDatasourcePathField` component with
updated styling.

- **Bug Fixes**
	- No new bug fixes reported.

- **Refactor**
- Streamlined the `RequestTabs` component by integrating styles directly
into the `Tabs` component.
- Refined handling of datasource URLs in the
`EmbeddedDatasourcePathField` component.
- Updated styling and structure in the `KeyValueFieldArray` component
for improved layout.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This was referenced Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working IDE Navigation Issues/feature requests related to IDE navigation, and context switching IDE Pod Issues that new developers face while exploring the IDE IDE Product Issues related to the IDE Product Low An issue that is neither critical nor breaks a user flow Needs Triaging Needs attention from maintainers to triage ok-to-test Required label for CI Production QA Pod Issues under the QA Pod QA Needs QA attention Task A simple Todo UI Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Fix Paddings at various places [Bug]: Unnecessary scroll in a couple of areas in split panes
3 participants