-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Overflow list new UI restore (#34658)
## Description Overflow list view changes was reverted because of Anvil failures in EE. This PR add the changes back. Fixes #33432 ## 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/9802067318> > Commit: 18b7a57 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9802067318&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Cypress dashboard</a>. > Tags: @tag.All > The following are new failures, please fix them before merging the PR: <ol> > <li>cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_spec.ts</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>Fri, 05 Jul 2024 03:11:20 UTC <!-- end of auto-generated comment: Cypress test results --> ## 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 several new React components (`FileTab`, `AddTab`, `List`, `ScreenModeToggle`, `EditorTabs`) to enhance the IDE tab management and user interaction. - **Bug Fixes** - Improved drag-and-drop (DnD) simulation logic by using `realMouseMove` method. - **Refactor** - Simplified and refactored the `FileTabs` component, improving its encapsulation and rendering logic. - Enhanced state and props handling across various tab components and hooks. - **Tests** - Updated test IDs and test logic to ensure consistency and correctness for tab interactions and states. - **Style** - Updated styled components, replacing tab-related styles with list-related styles to improve UI consistency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
2adb12d
commit a1b3109
Showing
26 changed files
with
494 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import clsx from "classnames"; | ||
|
||
import { Flex, Icon } from "design-system"; | ||
import { sanitizeString } from "utils/URLUtils"; | ||
|
||
interface FileTabProps { | ||
isActive: boolean; | ||
title: string; | ||
onClick: () => void; | ||
onClose: (e: React.MouseEvent) => void; | ||
icon?: React.ReactNode; | ||
} | ||
|
||
export const StyledTab = styled(Flex)` | ||
position: relative; | ||
height: 100%; | ||
font-size: 12px; | ||
color: var(--ads-v2-colors-text-default); | ||
cursor: pointer; | ||
gap: var(--ads-v2-spaces-2); | ||
border-top: 1px solid transparent; | ||
border-top-left-radius: var(--ads-v2-border-radius); | ||
border-top-right-radius: var(--ads-v2-border-radius); | ||
align-items: center; | ||
justify-content: center; | ||
padding: var(--ads-v2-spaces-3); | ||
border-left: 1px solid transparent; | ||
border-right: 1px solid transparent; | ||
border-top: 2px solid transparent; | ||
&.active { | ||
background: var(--ads-v2-colors-control-field-default-bg); | ||
border-top-color: var(--ads-v2-color-bg-brand); | ||
border-left-color: var(--ads-v2-color-border-muted); | ||
border-right-color: var(--ads-v2-color-border-muted); | ||
} | ||
& > .tab-close { | ||
position: relative; | ||
right: -2px; | ||
visibility: hidden; | ||
} | ||
&:hover > .tab-close { | ||
visibility: visible; | ||
} | ||
&.active > .tab-close { | ||
visibility: visible; | ||
} | ||
`; | ||
|
||
export const TabTextContainer = styled.span` | ||
width: 100%; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
`; | ||
|
||
export const TabIconContainer = styled.div` | ||
height: 12px; | ||
width: 12px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-shrink: 0; | ||
img { | ||
width: 12px; | ||
} | ||
`; | ||
|
||
export const FileTab = ({ | ||
icon, | ||
isActive, | ||
onClick, | ||
onClose, | ||
title, | ||
}: FileTabProps) => { | ||
return ( | ||
<StyledTab | ||
className={clsx("editor-tab", isActive && "active")} | ||
data-testid={`t--ide-tab-${sanitizeString(title)}`} | ||
onClick={onClick} | ||
> | ||
{icon ? <TabIconContainer>{icon}</TabIconContainer> : null} | ||
<TabTextContainer>{title}</TabTextContainer> | ||
{/* not using button component because of the size not matching design */} | ||
<Icon | ||
className="tab-close rounded-[4px] hover:bg-[var(--ads-v2-colors-action-tertiary-surface-hover-bg)] cursor-pointer p-[2px]" | ||
data-testid="t--tab-close-btn" | ||
name="close-line" | ||
onClick={onClose} | ||
/> | ||
</StyledTab> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.