Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5d6c310
setup with integration
hetunandu Aug 15, 2024
84662bd
Merge branch 'release' into feat/app-ide-transitions
hetunandu Aug 15, 2024
be2b59c
Sync changes from EE excluding enterprise directory
hetunandu Aug 15, 2024
e05c222
add type dependency
hetunandu Aug 15, 2024
7c12d18
Sync changes from EE excluding enterprise directory
hetunandu Aug 15, 2024
1866d2f
Merge branch 'release' into feat/app-ide-transitions
hetunandu Aug 19, 2024
5a60120
fix: tests
hetunandu Aug 19, 2024
cc95473
Updated setup for headless mode
sagar-qa007 Aug 20, 2024
1ebac75
Revert "Updated setup for headless mode"
hetunandu Aug 22, 2024
9664239
Merge branch 'refs/heads/release' into feat/app-ide-transitions
hetunandu Aug 22, 2024
6dc8f62
avoid using the grid row
hetunandu Aug 22, 2024
226160b
Merge branch 'refs/heads/release' into feat/app-ide-transitions
hetunandu Aug 23, 2024
55c40b4
fix: height issue
hetunandu Aug 23, 2024
2c82b26
fix: sidebar issue
hetunandu Aug 23, 2024
b0019a9
fix: Other states preview mode
hetunandu Aug 23, 2024
acfae93
Merge branch 'release' into feat/app-ide-transitions
hetunandu Sep 3, 2024
590ffad
fixes for animated layout
hetunandu Sep 3, 2024
156296e
Merge branch 'release' into feat/app-ide-transitions
hetunandu Sep 6, 2024
8fc4c7c
Merge branch 'release' into feat/app-ide-transitions
hetunandu Sep 6, 2024
bff4536
update mock state of ProtectedCallout.test
hetunandu Sep 6, 2024
9080f5c
fix git protech branch tests
hetunandu Sep 6, 2024
44244a0
Merge branch 'release' into feat/app-ide-transitions
hetunandu Sep 6, 2024
75866ef
Merge remote-tracking branch 'origin/release' into feat/app-ide-trans…
hetunandu Sep 6, 2024
a912f5c
Merge branch 'release' into feat/app-ide-transitions
hetunandu Sep 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ describe("Git Branch Protection", { tags: ["@tag.Git"] }, function () {
cy.wait("@gitProtectApi").then((res1) => {
_.agHelper.GetNClick(_.gitSync._closeGitSettingsModal);
expect(res1.response).to.have.property("statusCode", 200);
_.agHelper.AssertElementVisibility(
AppSidebar.locators.sidebar,
false,
);
_.agHelper.AssertElementAbsence(AppSidebar.locators.sidebar);
Copy link
Contributor

Choose a reason for hiding this comment

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

Enhanced Clarity in Assertions

The change from AssertElementVisibility to AssertElementAbsence is a significant improvement. It makes the test assertions more precise by explicitly checking for the non-existence of the sidebar, which aligns better with the test's intent to verify the absence of certain UI elements under specific conditions.

However, consider addressing the use of cy.wait(1000). This method of waiting is generally discouraged because it can lead to flaky tests. It's better to wait for a specific condition or element to appear or disappear, which would make the tests more reliable and faster.

Overall, the modifications enhance the test suite's clarity and robustness. Good job on making these changes.

Consider replacing cy.wait(1000) with a more deterministic wait condition, such as waiting for a specific API call to complete or a UI element to become visible. This approach reduces the potential for flaky tests and improves the reliability of the test execution.

_.agHelper.AssertElementVisibility(
PageLeftPane.locators.selector,
false,
Expand Down
1 change: 1 addition & 0 deletions app/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
"@types/codemirror": "^0.0.96",
"@types/deep-diff": "^1.0.0",
"@types/dom-mediacapture-record": "^1.0.11",
"@types/dom-view-transitions": "^1.0.5",
"@types/downloadjs": "^1.4.2",
"@types/jest": "^27.4.1",
"@types/js-beautify": "^1.13.2",
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/IDE/Structure/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { Divider, Flex } from "@appsmith/ads";
import { AppsmithLink } from "pages/Editor/AppsmithLink";
import { IDE_HEADER_HEIGHT } from "./constants";

interface ChildrenProps {
children: React.ReactNode | React.ReactNode[];
Expand Down Expand Up @@ -59,7 +60,7 @@ const Header = (props: ChildrenProps) => {
alignItems="center"
border="1px solid var(--ads-v2-color-border)"
className="t--editor-header"
height="40px"
height={IDE_HEADER_HEIGHT + "px"}
overflow="hidden"
width="100%"
>
Expand Down
1 change: 1 addition & 0 deletions app/client/src/IDE/Structure/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const IDE_HEADER_HEIGHT = 40;
1 change: 1 addition & 0 deletions app/client/src/IDE/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* These are composable components that you can use to spread the content of the header
* It is possible to use the IDE Header without using these subsections
*/
export { IDE_HEADER_HEIGHT } from "./Structure/constants";
export { default as IDEHeader } from "./Structure/Header";

/* ====================================================
Expand Down
2 changes: 2 additions & 0 deletions app/client/src/ce/entities/FeatureFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const FEATURE_FLAG = {
"ab_learnability_discoverability_collapse_all_except_data_enabled",
release_layout_conversion_enabled: "release_layout_conversion_enabled",
release_anvil_toggle_enabled: "release_anvil_toggle_enabled",
release_ide_animations_enabled: "release_ide_animations_enabled",
} as const;

export type FeatureFlag = keyof typeof FEATURE_FLAG;
Expand Down Expand Up @@ -82,6 +83,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
ab_learnability_discoverability_collapse_all_except_data_enabled: true,
release_layout_conversion_enabled: false,
release_anvil_toggle_enabled: false,
release_ide_animations_enabled: false,
};

export const AB_TESTING_EVENT_KEYS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function LayoutArea(props: LayoutAreaProps) {
>
<div
style={{
minWidth: dimensions?.width || "100%",
width: dimensions?.width || "100%",
height: "100%",
position: "absolute",
overflow: "auto",
Expand Down
6 changes: 4 additions & 2 deletions app/client/src/components/AnimatedGridLayout/constants.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { easings } from "@react-spring/web";
import type { AnimatedGridUnit } from "./types";

/** Default rows config. */
export const DEFAULT_ROWS: AnimatedGridUnit[] = ["1fr"];

export const SPRING_ANIMATION_CONFIG = {
easing: easings.easeInCirc,
duration: 375,
Copy link
Contributor

@alex-golovanov alex-golovanov Aug 16, 2024

Choose a reason for hiding this comment

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

I've a few points to make here:

  1. Duration based animation cancels out physics based animation, so friction/mass/tension are not used in this case and should probably be deleted because it can be quite confusing. So, we should configure using either physics or duration, not both.

  2. [nit] I know we're just experimenting here, but in case we use duration based animations, usage of react-spring doesn't make much sense, we'd be better of using native CSS animations.

  3. [nit] It is subjective, but to me even 375 seems a bit slow, I would speed it up to 250ms.

friction: 32,
mass: 1,
tension: 205,
};
3 changes: 2 additions & 1 deletion app/client/src/components/BottomBar/components.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import styled from "styled-components";
import { Layers } from "constants/Layers";
import { BOTTOM_BAR_HEIGHT } from "./constants";

export const Container = styled.div`
width: 100%;
height: ${(props) => props.theme.bottomBarHeight};
height: ${BOTTOM_BAR_HEIGHT}px;
display: flex;
position: fixed;
justify-content: space-between;
Expand Down
1 change: 1 addition & 0 deletions app/client/src/components/BottomBar/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const BOTTOM_BAR_HEIGHT = 37;
Copy link
Contributor

Choose a reason for hiding this comment

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

37 seems like an odd number to use (some pun intended). Are we not following some sort of multiple of 2 or 4 rule?

16 changes: 10 additions & 6 deletions app/client/src/components/BottomBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ import { Button } from "@appsmith/ads";
import SwitchEnvironment from "ee/components/SwitchEnvironment";
import { Container, Wrapper } from "./components";
import { useSelector } from "react-redux";
import { getCurrentApplicationId } from "selectors/editorSelectors";
import {
getCurrentApplicationId,
previewModeSelector,
} from "selectors/editorSelectors";
import { useDispatch } from "react-redux";
import { softRefreshActions } from "actions/pluginActionActions";
import { START_SWITCH_ENVIRONMENT } from "ee/constants/messages";
import { getIsAnvilEnabledInCurrentApplication } from "layoutSystems/anvil/integrations/selectors";

export default function BottomBar({ viewMode }: { viewMode: boolean }) {
export default function BottomBar() {
const appId = useSelector(getCurrentApplicationId) || "";
const isPreviewMode = useSelector(previewModeSelector);
const dispatch = useDispatch();
// We check if the current application is an Anvil application.
// If it is an Anvil application, we remove the Git features from the bottomBar
Expand All @@ -28,17 +32,17 @@ export default function BottomBar({ viewMode }: { viewMode: boolean }) {
return (
<Container>
<Wrapper>
{!viewMode && (
{!isPreviewMode && (
<SwitchEnvironment
editorId={appId}
onChangeEnv={onChangeEnv}
startSwitchEnvMessage={START_SWITCH_ENVIRONMENT}
viewMode={viewMode}
viewMode={isPreviewMode}
/>
)}
{!viewMode && !isAnvilEnabled && <QuickGitActions />}
{!isPreviewMode && !isAnvilEnabled && <QuickGitActions />}
</Wrapper>
{!viewMode && (
{!isPreviewMode && (
<Wrapper>
<ManualUpgrades showTooltip>
<Button
Expand Down
92 changes: 19 additions & 73 deletions app/client/src/components/editorComponents/PropertyPaneSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,28 @@
import classNames from "classnames";
import React, {
memo,
useCallback,
useContext,
useEffect,
useMemo,
useRef,
} from "react";
import * as Sentry from "@sentry/react";
import { useSelector } from "react-redux";
import React, { memo, useContext, useEffect, useMemo, useRef } from "react";

import { getSelectedWidgets } from "selectors/ui";
import { tailwindLayers } from "constants/Layers";
import WidgetPropertyPane from "pages/Editor/PropertyPane";
import CanvasPropertyPane from "pages/Editor/CanvasPropertyPane";
import useHorizontalResize from "utils/hooks/useHorizontalResize";
import { getIsDraggingForSelection } from "selectors/canvasSelectors";
import MultiSelectPropertyPane from "pages/Editor/MultiSelectPropertyPane";
import { getIsDraggingOrResizing } from "selectors/widgetSelectors";
import { selectedWidgetsPresentInCanvas } from "selectors/propertyPaneSelectors";
import styled from "styled-components";
import WalkthroughContext from "components/featureWalkthrough/walkthroughContext";
import { MAIN_CONTAINER_WIDGET_ID } from "constants/WidgetConstants";

export const PROPERTY_PANE_ID = "t--property-pane-sidebar";

const StyledResizer = styled.div<{ resizing: boolean }>`
${(props) =>
props.resizing &&
`
& > div {
background-color: var(--ads-v2-color-outline);
}
`}
:hover {
& > div {
background-color: var(--ads-v2-color-bg-emphasis);
}
}
`;

interface Props {
width: number;
onDragEnd?: () => void;
onWidthChange: (width: number) => void;
}

export const PropertyPaneSidebar = memo((props: Props) => {
export const PropertyPaneSidebar = memo(() => {
const sidebarRef = useRef<HTMLDivElement>(null);
const prevSelectedWidgetId = useRef<string | undefined>();

const { onMouseDown, onMouseUp, onTouchStart, resizing } =
useHorizontalResize(sidebarRef, props.onWidthChange, props.onDragEnd, true);

const selectedWidgetIds = useSelector(getSelectedWidgets);
const isDraggingOrResizing = useSelector(getIsDraggingOrResizing);
const { isOpened: isWalkthroughOpened, popFeature } =
Expand All @@ -58,17 +35,10 @@ export const PropertyPaneSidebar = memo((props: Props) => {
selectedWidgetIds[0] !== prevSelectedWidgetId.current) ||
selectedWidgetIds[0] === MAIN_CONTAINER_WIDGET_ID;

// This is to keep the theming properties from changing,
// while dragging a widget when no other widgets were selected
const keepThemeWhileDragging =
prevSelectedWidgetId.current === undefined && shouldNotRenderPane;

const selectedWidgetsLength = useSelector(
(state) => selectedWidgetsPresentInCanvas(state).length,
);

const isDraggingForSelection = useSelector(getIsDraggingForSelection);

prevSelectedWidgetId.current =
selectedWidgetIds.length === 1 ? selectedWidgetIds[0] : undefined;

Expand All @@ -91,27 +61,24 @@ export const PropertyPaneSidebar = memo((props: Props) => {
default:
return <CanvasPropertyPane />;
}
}, [
selectedWidgetsLength,
isDraggingForSelection,
shouldNotRenderPane,
keepThemeWhileDragging,
]);
}, [selectedWidgetsLength, shouldNotRenderPane]);

const closeWalkthrough = () => {
const closeWalkthrough = useCallback(() => {
if (popFeature) {
popFeature("PROPERTY_PANE");
sidebarRef.current?.removeEventListener("click", closeWalkthrough);
}
};
}, [popFeature]);

useEffect(() => {
if (isWalkthroughOpened)
sidebarRef.current?.addEventListener("click", closeWalkthrough);
const currentSidebar = sidebarRef.current;
if (isWalkthroughOpened) {
currentSidebar?.addEventListener("click", closeWalkthrough);
}
return () => {
sidebarRef.current?.removeEventListener("click", closeWalkthrough);
currentSidebar?.removeEventListener("click", closeWalkthrough);
};
}, [isWalkthroughOpened]);
}, [closeWalkthrough, isWalkthroughOpened]);

return (
<div className="relative h-full">
Expand All @@ -122,28 +89,7 @@ export const PropertyPaneSidebar = memo((props: Props) => {
id={PROPERTY_PANE_ID}
ref={sidebarRef}
>
{/* RESIZER */}
<StyledResizer
className={`absolute top-0 left-0 w-2 h-full -ml-1 group cursor-ew-resize ${tailwindLayers.resizer}`}
onMouseDown={onMouseDown}
onTouchEnd={onMouseUp}
onTouchStart={onTouchStart}
resizing={resizing}
>
<div
className={classNames({
"w-1 h-full bg-transparent transform transition flex items-center":
true,
})}
/>
</StyledResizer>
<div
className={classNames({
"h-full p-0 overflow-y-auto min-w-72 max-w-104": true,
"transition-all duration-400": !resizing,
})}
style={{ width: props.width }}
>
<div className={"h-full p-0 overflow-y-auto min-w-72 max-w-104 w-full"}>
{propertyPane}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import React, { useEffect, useState } from "react";
import type { ReactNode } from "react";
import styled from "styled-components";
import { Layers } from "constants/Layers";
import { theme } from "constants/DefaultTheme";
import { useDispatch, useSelector } from "react-redux";
import { getAppViewHeaderHeight } from "selectors/appViewSelectors";
import { ReduxActionTypes } from "ee/constants/ReduxActionConstants";
import { useMaxModalWidth } from "widgets/ModalWidget/component/useModalWidth";
import { useAppViewerSidebarProperties } from "utils/hooks/useAppViewerSidebarProperties";

const Container = styled.div<{
width?: number;
height?: number;
Expand All @@ -22,7 +22,6 @@ const Container = styled.div<{
minSize?: number;
isEditMode?: boolean;
headerHeight?: number;
smallHeaderHeight?: string;
leftSidebarWidth?: string;
}>`
&&& {
Expand Down Expand Up @@ -152,7 +151,6 @@ export function ModalOverlayLayer(props: BaseWidgetProps) {
maxWidth={maxModalWidth}
minSize={props.minSize}
right={props.bottom}
smallHeaderHeight={theme.smallHeaderHeight}
top={props.top}
width={props.width}
zIndex={
Expand Down
3 changes: 2 additions & 1 deletion app/client/src/pages/AdminSettings/components.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from "styled-components";
import { Classes } from "@blueprintjs/core";
import { Link, Text } from "@appsmith/ads";
import { IDE_HEADER_HEIGHT } from "IDE";

export const Wrapper = styled.div`
flex-basis: calc(100% - ${(props) => props.theme.homePage.leftPane.width}px);
Expand Down Expand Up @@ -37,7 +38,7 @@ export const BottomSpace = styled.div`
export const ContentWrapper = styled.div``;

export const LoaderContainer = styled.div`
height: ${(props) => `calc(100vh - ${props.theme.smallHeaderHeight})`};
height: calc(100vh - ${IDE_HEADER_HEIGHT}px);
display: flex;
justify-content: center;
width: 100%;
Expand Down
8 changes: 4 additions & 4 deletions app/client/src/pages/AppViewer/Navigation/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ import {
StyledMenuContainer,
StyledSidebar,
} from "./Sidebar.styled";
import { getCurrentThemeDetails } from "selectors/themeSelectors";
import { getIsAppSettingsPaneWithNavigationTabOpen } from "selectors/appSettingsPaneSelectors";
import NavigationLogo from "ee/pages/AppViewer/NavigationLogo";
import MenuItemContainer from "./components/MenuItemContainer";
import BackToAppsButton from "./components/BackToAppsButton";
import { IDE_HEADER_HEIGHT } from "IDE";
import { BOTTOM_BAR_HEIGHT } from "components/BottomBar/constants";

interface SidebarProps {
currentApplicationDetails?: ApplicationPayload;
Expand Down Expand Up @@ -80,7 +81,6 @@ export function Sidebar(props: SidebarProps) {
const isPinned = useSelector(getAppSidebarPinned);
const [isOpen, setIsOpen] = useState(true);
const { x } = useMouse();
const theme = useSelector(getCurrentThemeDetails);
const isPreviewMode = useSelector(combinedPreviewModeSelector);
const isAppSettingsPaneWithNavigationTabOpen = useSelector(
getIsAppSettingsPaneWithNavigationTabOpen,
Expand Down Expand Up @@ -127,10 +127,10 @@ export function Sidebar(props: SidebarProps) {
const suffix = ")";

if (isPreviewMode) {
prefix += `${theme.smallHeaderHeight} - ${theme.bottomBarHeight}`;
prefix += `${IDE_HEADER_HEIGHT}px - ${BOTTOM_BAR_HEIGHT}px`;
} else if (isAppSettingsPaneWithNavigationTabOpen) {
// We deduct 64px as well since it is the margin coming from "m-8" class from tailwind
prefix += `${theme.smallHeaderHeight} - ${theme.bottomBarHeight} - 64px`;
prefix += `${IDE_HEADER_HEIGHT}px - ${BOTTOM_BAR_HEIGHT}px - 64px`;
} else {
prefix += "0px";
}
Expand Down
2 changes: 1 addition & 1 deletion app/client/src/pages/Editor/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Canvas = (props: CanvasProps) => {
<Wrapper
$enableMainCanvasResizer={!!props.enableMainCanvasResizer}
background={isAnvilLayout ? "" : backgroundForCanvas}
className={`relative t--canvas-artboard ${paddingBottomClass} transition-all duration-400 ${marginHorizontalClass} ${getViewportClassName(
className={`relative t--canvas-artboard ${paddingBottomClass} ${marginHorizontalClass} ${getViewportClassName(
canvasWidth,
)}`}
data-testid={"t--canvas-artboard"}
Expand Down
Loading